Index / Media
Aspect Ratio Calculator
Hold a ratio and resize, or hand it two dimensions and get the ratio they reduce to. Pixels have to be whole numbers, so it says when it rounded and by how much.
Ratio
Written
16:9, 16/9, or as
a single number like 1.85, which means 1.85:1.
Size
Fit inside a box
Fill both to see the largest size at this ratio
that fits, and the smallest that covers.
Ratio
--
Width
--
Height
--
Everything that follows from it
How the ratio is reduced, and where it rounds
Two whole numbers reduce exactly. 1920×1080 is divided by
their greatest common divisor, 120, giving 16:9 with nothing lost. The
divisor used is printed below, so the reduction can be checked.
A decimal ratio is approximated, and the error is shown. 2.39:1 is not a ratio of small whole numbers, so the nearest fraction with a denominator of 10,000 or less is found by continued fractions — the same method a slide rule maker would have used — and the page prints how far off it is. Where the error is zero, the fraction is exact.
Pixels are whole, so resizing rounds. 1000 pixels wide at 16:9 is 562.5 pixels high, which does not exist. The page rounds to the nearest whole pixel, prints the exact value beside it, and states the ratio the rounded size actually has — because that is the ratio your file will have, not the one you asked for.
Video wants even numbers. H.264 and H.265 store colour at half resolution in each direction, so an odd width or height has to be padded by the encoder, and some encoders refuse outright. The nearest even size and the nearest multiple of 8 are given for that reason.
“21:9” is not 21:9. A 3440×1440 monitor is 43:18, and a 2560×1080 one is 64:27. Both are sold as 21:9, which would be 2.333 and is neither of them. The page names the nearest real ratio and gives the error against the marketing one.
Fit and cover are the two ways a picture meets a box. Fit is the largest size at this ratio that sits inside the container, leaving bars; cover is the smallest that fills it, losing the overflow. They are what CSS calls
A decimal ratio is approximated, and the error is shown. 2.39:1 is not a ratio of small whole numbers, so the nearest fraction with a denominator of 10,000 or less is found by continued fractions — the same method a slide rule maker would have used — and the page prints how far off it is. Where the error is zero, the fraction is exact.
Pixels are whole, so resizing rounds. 1000 pixels wide at 16:9 is 562.5 pixels high, which does not exist. The page rounds to the nearest whole pixel, prints the exact value beside it, and states the ratio the rounded size actually has — because that is the ratio your file will have, not the one you asked for.
Video wants even numbers. H.264 and H.265 store colour at half resolution in each direction, so an odd width or height has to be padded by the encoder, and some encoders refuse outright. The nearest even size and the nearest multiple of 8 are given for that reason.
“21:9” is not 21:9. A 3440×1440 monitor is 43:18, and a 2560×1080 one is 64:27. Both are sold as 21:9, which would be 2.333 and is neither of them. The page names the nearest real ratio and gives the error against the marketing one.
Fit and cover are the two ways a picture meets a box. Fit is the largest size at this ratio that sits inside the container, leaving bars; cover is the smallest that fills it, losing the overflow. They are what CSS calls
contain and cover, and the bar and
overflow sizes are given in whole pixels.