dev101.io

Aspect Ratio Calculator

Reduce any resolution to its simplest ratio, or solve a missing width/height.

Runs online in your browserNo installNo accountFree

Loading tool…

How to use Aspect Ratio Calculator

  1. Enter a width and height in the "Ratio from resolution" panel to see the simplified ratio, decimal, and common name.
  2. To solve for a missing side, use the "Solve a dimension" panel — choose a ratio preset (or type your own), then enter the one dimension you know.
  3. The other dimension recalculates instantly to preserve the ratio; copy either result with the copy button.

Aspect Ratio Calculator

An aspect ratio is the proportional relationship between an image or video's width and height, written width:height. This calculator does the two things you actually reach for: it reduces a raw pixel resolution (like 1920×1080) to its simplest ratio (16:9), and it solves for a missing dimension when you want to keep a target ratio.

Everything runs client-side. No uploads, no tracking — just the math.

Ratio from a resolution

Give it a width and a height and it returns:

  • The simplified ratio — reduced by the greatest common divisor. 1920×108016:9, 2560×160016:10, 1080×19209:16.
  • The decimal ratio16:9 shown as 1.78:1, which is how cinema and cameras often express it.
  • A common name when the ratio matches a known standard within a small tolerance: 4:3 (SDTV), 16:9 (HD/4K), 21:9 (ultrawide), 2.39:1 (anamorphic scope), 9:16 (vertical/stories), and more.

The reduction is exact integer math — no floating-point drift. 3840×2160 (4K UHD) reduces to the same 16:9 as 1920×1080, because they share the ratio even though the pixel counts differ 4×.

Solve a missing dimension

This is the everyday developer case: you're building a responsive layout, generating thumbnails, or sizing a video container, and you need the height that keeps a width at 16:9 (or vice versa).

Pick a ratio — the presets cover 16:9, 4:3, 21:9, 1:1, 9:16, 3:2, and 2.39:1, or type any ratio including decimals like 2.39:1. Enter the dimension you know, and the other is computed:

  • Width 1280 at 16:9 → height 720
  • Height 1080 at 16:9 → width 1920
  • Width 1912 at 2.39:1 → height 800

Because pixels are whole numbers, the tool rounds the computed side to the nearest pixel and flags when it had to round. If an exact fit matters (say, encoding where dimensions must be divisible by 2 or 16), choose a base dimension that's a multiple of the ratio's numerator.

Why aspect ratio matters for developers

  • Responsive media without layout shift. Reserving the right box ahead of load is what the CSS aspect-ratio property is for. Compute the ratio once, set aspect-ratio: 16 / 9, and the browser holds the space so your Cumulative Layout Shift (CLS) stays near zero.
  • Thumbnail and preview generation. Cropping or letterboxing to a target ratio needs the exact companion dimension — this gives it to you without eyeballing.
  • Video pipelines. Encoders and players care about ratio. Feeding a 4:3 source into a 16:9 frame without accounting for the ratio gives you stretched faces or unexpected pillarboxing.
  • Canvas and WebGL. Backing-store size, viewport, and drawing-buffer dimensions all need consistent ratios to avoid distortion, especially across device pixel ratios.

Common aspect ratios, at a glance

  • 16:9 (1.78:1) — HD, Full HD, 4K/UHD, most modern displays and video.
  • 4:3 (1.33:1) — legacy SD TV, older monitors, many tablets in portrait math.
  • 16:10 (1.6:1) — a lot of laptop and productivity displays.
  • 21:9 (2.33:1) — ultrawide monitors and cinematic desktop video.
  • 1.85:1 / 2.39:1 — theatrical "flat" and anamorphic "scope" film formats.
  • 1:1 — square social posts and avatars.
  • 9:16 (0.56:1) — vertical video: stories, reels, shorts.
  • 4:5 — the portrait ratio favored by social feeds for maximum screen real estate.

Notes on precision

The ratio reduction uses the Euclidean GCD algorithm on integer pixel dimensions, so results are exact. Decimal inputs (non-integer pixel dimensions) are rounded to the nearest pixel before reducing, since fractional pixels aren't real. Named-ratio matching uses a 0.5% tolerance, so a resolution that's a hair off a standard (common with cropped exports) still gets labeled sensibly, while genuinely custom ratios return no name rather than a misleading one.

Frequently asked questions

How do I calculate the aspect ratio from a resolution?

Divide the width and height by their greatest common divisor (GCD). For 1920×1080, the GCD is 120, so the ratio is 16:9. This tool does that reduction for you and also shows the decimal ratio (1.78:1) and the common name.

What is 16:9 as a decimal?

16 ÷ 9 = 1.777…, usually written 1.78:1. It's the standard ratio for HD, Full HD (1080p), and 4K/UHD video.

How do I keep an image 16:9 when I only know one dimension?

Use the "Solve a dimension" panel — pick or type the 16:9 ratio, enter the width or height you have, and the other dimension is computed to preserve the ratio. For width 1280 at 16:9 the height is 720.

Why does my computed height say "rounded"?

Pixels are whole numbers, but not every width divides evenly for a given ratio. 1000px wide at 16:9 is exactly 562.5px tall, so we round to 563 and flag it. If you need an exact fit, pick a width that's a multiple of the ratio's numerator (16 here).

Is this the same as pixel aspect ratio (PAR)?

No. This calculates the display/storage aspect ratio from pixel dimensions assuming square pixels. Pixel aspect ratio (non-square pixels, common in legacy SD/anamorphic formats) is a separate multiplier applied on top — modern web, mobile, and HD content all use square pixels, so this tool covers the vast majority of cases.

Related tools