Aspect Ratio Calculator

Get the simplified ratio of any width and height, then scale a new dimension to match it.

Common:

How to use

  1. Type the original width and height (pixels, inches, millimeters, anything), or click one of the Common ratio chips.
  2. The ratio is drawn as a frame of that exact shape, with your width and height on its edges, next to the simplified ratio, its decimal value and its common name (if it has one).
  3. Under Scale to a new size, type a new width or height, and the other one updates to keep the same ratio.
  4. Click any resolution in the list, or the Copy result button, to copy it.

One ratio, two directions

This tool solves the two problems that come up together in practice: what ratio is this image already, and what height do I need for a new width at that same ratio(or the reverse). Entering a width and height answers the first; the scale section answers the second, using the exact ratio just computed rather than a rounded version of it, so a long chain of resizes never drifts off the original proportions.

Example

1920 × 1080 (a common HD video frame) reduces to:

16:9 (16:9 (Widescreen/HD video))
Decimal: 1.7778
CSS padding-hack: 56.25%

Scaled to a 1280px-wide version, the height becomes:

1280 × 720 (same 16:9 ratio, smaller size)

Options explained

Edge cases and common errors

Do the same thing in code

// JavaScript: reduce width/height to a ratio
function gcd(a, b) { return b ? gcd(b, a % b) : a; }
const g = gcd(width, height);
const ratio = `${width / g}:${height / g}`;

// Scale a new width to match an existing ratio
const newHeight = newWidth * (height / width);

/* CSS: lock an element to a ratio without JavaScript */
.box { aspect-ratio: 16 / 9; }

Converting the other direction (pixels into a file size instead of a shape) is a job for theData Size Converter. If the number you're scaling is a timestamp or a duration rather than a dimension, see theUnix Timestamp Converter.

Aspect Ratio Calculator FAQ

How is the aspect ratio actually calculated?

Width and height are reduced to the smallest whole-number ratio that produces the same value when divided, using the greatest common divisor: the same arithmetic as reducing a fraction. 1920 × 1080 reduces to 16:9 because both numbers share a greatest common divisor of 120. Decimal inputs work the same way: 8.5 × 11 (US Letter paper) reduces to 17:22 exactly, not a rounded approximation, by scaling both numbers up before reducing.

Why does a “21:9” ultrawide monitor show as 43:18 or 7:3, never literally 21:9?

Two separate reasons stack here. First, 21:9 isn't a reduced fraction: 21 and 9 share a common factor of 3, so its true lowest terms is 7:3, and a genuine 21:9-family resolution like 2520×1080 reduces to exactly 7:3 here, never to "21:9" itself. Second, most monitors sold as "21:9" aren't even that: a 3440×1440 panel reduces to 43:18 (2.3889), noticeably different from 7:3's 2.3333. "21:9" is the marketing name for a family of similar wide ratios, not one exact pixel ratio, so this tool always shows the real reduced ratio, meaning a mismatch with a spec sheet points at the marketing name, not this page.

How does the “scale to a new size” section work?

It multiplies your new dimension by the current ratio: a 1920×1080 (16:9) image resized to 1280 wide becomes exactly 720 tall, calculated as 1280 × (1080 ÷ 1920). Typing into either the new width or new height field updates the other one, so you can work from whichever dimension you actually know.

What is the “CSS padding-hack %” value for?

It's the percentage used in the classic CSS technique for a responsive, ratio-locked box before the aspect-ratio property existed: padding-bottom: 56.25% on an element with height: 0 keeps a 16:9 box in ratio at any width. Modern CSS can use aspect-ratio: 16 / 9; directly instead, but the percentage is still needed for older browser support or email HTML.

Does it work for portrait (taller-than-wide) sizes, like Instagram Reels or Stories?

Yes. Enter the taller height as the second number and it's marked "Portrait" rather than "Landscape," with no separate mode to switch. 1080×1920 reduces to 9:16, the standard vertical video ratio, and 360×640, 720×1280, 1080×1920, 1440×2560, 2160×3840, 2880×5120, 4320×7680 are the exact resolutions this tool lists for it.

What happens with zero, negative or non-numeric input?

Both are refused rather than guessed at: a zero or negative width or height returns "Width and height must both be greater than 0.", and non-numeric text names the specific field, since a ratio needs two positive numbers to mean anything.

Runs entirely in your browser: this page is a static file with no server behind it, so nothing you paste can be uploaded. Last reviewed by Parthesh Gupta.