Aspect Ratio Calculator
Solve the missing width, height or ratio, reduce W:H to lowest terms and scale to fit.
Results are provided as is, for general information. Check anything important before relying on it. See the Terms of Use.
About this tool
An aspect ratio is just width ÷ height, so any two of the three quantities determine the third. Enter the two you know — width and height, width and a ratio, or height and a ratio, with the ratio written as W:H (16:9) or a decimal (1.7778) — and the tool solves the missing value, reduces the pair to lowest terms with a greatest-common-divisor pass, and names the closest standard ratio from a table covering screens, photos and cinema (16:9, 4:3, 3:2, 1:1, 9:16, 21:9, 2.35:1 and more). A second section scales the dimensions to the largest size that fits a target box without distortion, showing the scale factor and which side of the box is the binding constraint. Values are plain numbers in whatever unit you pick — px, cm or in — because a ratio is unitless. All math runs in your browser.
How it works
Ratio = W ÷ H, reduced by the greatest common divisor Height = Width ÷ Ratio, Width = Height × Ratio
An aspect ratio is the width-to-height proportion with common factors removed. Divide both sides by their greatest common divisor to get lowest terms; to resize while keeping the shape, fix one side and derive the other from the ratio.
| Question | Working | Answer |
|---|---|---|
| What is the aspect ratio of 1920 × 1080? | gcd(1920, 1080) = 120; 1920 ÷ 120 : 1080 ÷ 120 | 16:9 |
| An 800 px wide 16:9 image: how tall is it? | 800 ÷ (16 ÷ 9) | 450 px |
When to use it
Questions
Why does 2560×1080 snap to 2.35:1 and not 21:9?
The comparison is multiplicative (log distance), not subtraction. 2560÷1080 is about 2.370, which sits between 21:9 (≈2.333) and 2.35:1 — and it is slightly closer to 2.35. Even 3440×1440 panels, marketed as 21:9, measure 2.389 and land nearer 2.35:1. The tool goes by the math of the ratio, not the marketing label.
Why is the nearest match computed in log space?
Ratios multiply rather than add: going from 1:1 to 2:1 doubles the width, and from 2:1 to 4:1 doubles it again — the same visual change. Log distance treats those equal steps equally, so a wide ratio like 2.34 correctly falls between 2:1 and 2.35:1 instead of being pulled toward whichever preset has the biggest absolute gap.
What does the error about width, height and ratio not agreeing mean?
All three inputs describe the same rectangle, and yours contradict each other: width ÷ height does not equal the ratio you typed (1920×1080 with a 4:3 ratio, for example). Fix whichever one is wrong; the check has a small tolerance for rounding, so 1.7778 with 16:9 dimensions still passes.
Does the unit change the ratio?
No — a ratio is unitless, so 1920×1080 px, 50.8×28.575 cm and 20×11.25 in are all 16:9. The unit selector only relabels the inputs and outputs; the math is identical, which is why mixing units on one side is allowed but pointless.
How does scale-to-fit pick the fitted size?
It computes the scale each axis would need to reach its box edge and applies the smaller one — the binding constraint — so the fitted rectangle never exceeds the box and is never distorted. Fitted pixel sizes are floored so an upscaled image can't spill over the box by a rounding pixel.