How the ratio is worked out
An aspect ratio is width divided by height, written as the smallest pair of whole numbers with the same proportion. To get there, divide both sides by their greatest common divisor (GCD), found with Euclid's algorithm: replace the larger number by the remainder of dividing it by the smaller, until the remainder is zero.
1920 mod 1080 = 840
1080 mod 840 = 240
840 mod 240 = 120
240 mod 120 = 0 → GCD = 120
1920 / 120 = 16, 1080 / 120 = 9 → 16:9 (decimal 1.7778)function gcd(a, b) { while (b) [a, b] = [b, a % b]; return a; }
function ratio(w, h) { const g = gcd(w, h); return `${w / g}:${h / g}`; }
ratio(1920, 1080); // "16:9"
ratio(1366, 768); // "683:384"Some sizes do not reduce to a familiar pair. 1366 × 768 gives 683:384, which is 1.7786:1, a hair wider than 16:9 (1.7778:1). The calculator shows the closest common ratio and how far off it is, so you can tell "basically 16:9" from "actually 16:10".
Finding a missing side
To resize while keeping the ratio, scale both sides by the same factor:
newHeight = newWidth × height / width
newWidth = newHeight × width / heightFor a 16:9 video at 1280 wide: 1280 × 9 / 16 = 720. For a 4:5 portrait post 1350 tall: 1350 × 4 / 5 = 1080. If the result has a fraction, round it, and know that the ratio is then only approximate. Video encoders using 4:2:0 chroma subsampling, the usual setting for H.264 and HEVC, need even widths and heights, so round to an even number for video.
Common aspect ratios
| Ratio | Decimal | Typical sizes | Where you see it |
|---|---|---|---|
| 1:1 | 1.0000 | 1080 × 1080 | square posts, avatars, album art |
| 5:4 | 1.2500 | 1280 × 1024 | older desktop monitors |
| 4:3 | 1.3333 | 1024 × 768, 1600 × 1200 | older TVs and monitors, many tablets, many phone camera sensors |
| 3:2 | 1.5000 | 6000 × 4000, 3000 × 2000 | 35 mm film and most interchangeable-lens cameras |
| 16:10 | 1.6000 | 1280 × 800, 1920 × 1200, 2560 × 1600 | many laptop screens |
| 16:9 | 1.7778 | 1280 × 720, 1920 × 1080, 2560 × 1440, 3840 × 2160 | HD and 4K video, most TVs and monitors |
| 1.85:1 | 1.8500 | 1998 × 1080 (DCI flat) | cinema, flat |
| 2:1 | 2.0000 | 2160 × 1080 | some phone screens |
| 64:27 | 2.3704 | 2560 × 1080 | ultrawide monitors sold as 21:9 |
| 43:18 | 2.3889 | 3440 × 1440 | ultrawide monitors sold as 21:9 |
| 2.39:1 | 2.3900 | 2048 × 858 (DCI scope) | widescreen cinema, scope |
| 4:5 | 0.8000 | 1080 × 1350 | portrait photo posts |
| 2:3 | 0.6667 | 4000 × 6000 | portrait photos from 3:2 cameras, posters |
| 9:16 | 0.5625 | 1080 × 1920 | vertical video, phone screens held upright |
"21:9" is a marketing label rather than a ratio: 21 ÷ 9 is 2.333, while the monitors sold under that name are 2.370 (2560 × 1080) or 2.389 (3440 × 1440).
When the ratios do not match
If an image's ratio differs from the space it has to go into, something has to give: either empty bars (aspect fit), cropping (aspect fill) or distortion (stretch). The "Fit an image into a box" calculator on this page gives the numbers for fit and fill. The visualizer draws it and writes the code; aspect fit vs aspect fill explains the math.
Pixel aspect ratio and display aspect ratio
Everything here assumes square pixels, which is true for almost every photo, screen and web video today. Some video formats store non-square pixels: standard-definition DV, for example, stores 720 × 480 pixels and is displayed at 4:3 or 16:9 depending on a flag. In those files the storage ratio (3:2 for 720 × 480) differs from the display aspect ratio, and the player stretches the picture on playback.
Questions
How do you calculate an aspect ratio?
Divide the width and the height by their greatest common divisor. For 1920 × 1080 the greatest common divisor is 120, so the ratio is 16:9. As a decimal it is 1920 ÷ 1080 = 1.7778.
How do I find the height for a new width?
New height = new width × original height ÷ original width. Keeping 16:9 at a width of 1280 gives 1280 × 9 ÷ 16 = 720.
Is 1366 × 768 exactly 16:9?
No. It reduces to 683:384, which is 1.7786:1 against 1.7778:1 for 16:9. It is close enough that it is sold as a 16:9 resolution.
What resolution is 21:9?
21:9 is a marketing name. Common ultrawide monitors are 2560 × 1080, which is exactly 64:27 (2.37:1), and 3440 × 1440, which is 43:18 (2.39:1).