What this answers
An aspect ratio is the shape of a picture or a screen: how wide it is compared with how tall. The calculator reduces a width and a height to the smallest whole numbers with the same shape, says whether that is one of the common ratios, and tells you the height (or width) a resized version needs so the picture is not stretched.
Formula
Ratio = w / gcd(w, h) : h / gcd(w, h)
New height = new width × h / w
New width = new height × w / h
- w and h — the current width and height
- gcd — the greatest common divisor, found with Euclid’s algorithm
Worked examples
1920 × 1080. The greatest common divisor is 120, so the ratio is 16:9. At a width of 1280 the height is 1280 × 1080 / 1920 = 720.
1366 × 768. The divisor is 2, so the ratio is 683:384. That is not a named ratio, but 1366 / 768 = 1.7786 is within 3% of 16:9 (1.7778), so the page calls it close to 16:9.
What this doesn’t cover
- Cropping. Keeping the shape means scaling; changing the shape means cutting something off.
- Rounding to whole pixels. The new size is shown unrounded, and some tools want even numbers.
Common questions
Why is 2560 × 1080 called 21:9?
Its exact ratio is 64:27, which is 2.370. A true 21:9 is 2.333. Marketing names round, so the
page says close to 21:9 rather than exactly.