fixmint

How to work out an aspect ratio and a missing side

By · · 4 min read

An aspect ratio is the width of a picture compared with its height, written as two numbers such as 16:9. To simplify a size into a ratio, divide both sides by their greatest common divisor, so 1920 × 1080 becomes 16:9. To find a missing side, keep the ratio by cross-multiplying: a 16:9 picture that is 1280 pixels wide is 1280 × 9 ÷ 16 = 720 pixels high. Sizes that are not exact ratios need rounding, and some video formats need even numbers.

Aspect ratio calculatorWhat height keeps the ratio?Open

Simplify a size to a ratio

The greatest common divisor, or GCD, is the largest number that divides both sides exactly. For 1920 and 1080 it is 120. Dividing each side by 120 gives 16 and 9, so the ratio is 16:9. The same method works for any size. For 1600 × 900 the GCD is 100, which gives 16:9 again, and for 1024 × 768 the GCD is 256, which gives 4:3. Dividing in steps reaches the same answer. Both 1920 and 1080 divide by 8 to give 240 and 135, and both of those divide by 15 to give 16 and 9.

The aspect ratio calculator does this division for you. Type a width and a height, and the simplified ratio appears in the answer box, with the decimal form beneath it. For 1920 × 1080 that decimal is 1.78 : 1.

Find the missing side by cross-multiplying

A picture keeps its ratio when its width divided by its height stays the same. If you know the width, the height is the width times the height part of the ratio, divided by the width part. For 16:9 and a width of 1280, that is 1280 × 9 ÷ 16 = 720. Going the other way, a height of 720 gives a width of 720 × 16 ÷ 9 = 1280. A 4:5 picture 1350 pixels high is 1350 × 4 ÷ 5 = 1080 pixels wide.

The same pattern works for any ratio. A 4:3 picture 1000 pixels wide is 1000 × 3 ÷ 4 = 750 pixels high. A useful check is scaling. Multiplying 1920 × 1080 by two thirds gives 1280 × 720, the same 16:9 shape, because 1920 × 2 ÷ 3 = 1280 and 1080 × 2 ÷ 3 = 720. In the calculator, pick a ratio from the common ratio buttons or type its two numbers, then type a width or a height. The side you typed last is the source, and the other box fills in.

Sizes that are not exact ratios

Many real sizes do not reduce to a simple ratio. 1366 × 768 has a GCD of 2, which gives 683:384. Those numbers are correct but awkward to use. The calculator also compares the size with its common ratios, and it shows "≈ 16:9" when the result is within 1 percent of one. The exact value, 1366 ÷ 768, is about 1.7786, against 16 ÷ 9 at about 1.7778, a difference of about 0.05 percent. For practical purposes the two shapes are the same. Use the exact side lengths when you cut or resize, and use the simple ratio only when you describe the shape.

The gap shows up in the other direction too. At 16:9, a width of 1366 gives a height of 1366 × 9 ÷ 16 = 768.375. The calculator shows that exact figure, and then rounds it to 768.

Rounding to whole and even pixels

Screens and files use whole pixels, so the last step is always rounding. The calculator rounds halves upwards. A 16:9 picture 1000 pixels wide is 562.5 pixels high, and the calculator gives 563.

Some video formats need even numbers. Many video encoders require even width and height when the colour is stored at half resolution, which is the usual 4:2:0 layout. An odd 563 may then be refused or padded. In that case use 562 or 564, which keeps the ratio within a fraction of a percent. The calculator does not round to even numbers, so check the requirement of the software that will use the file.

The table lists sizes for common ratios, with the longer side near 640, 1280 and 1920 pixels. Each row uses a whole, even multiple of the ratio, so the 3:2 row shows 642 × 428 and 1278 × 852 rather than exact round numbers.

RatioLonger side near 640Near 1280Near 1920
16:9640 × 3601280 × 7201920 × 1080
4:3640 × 4801280 × 9601920 × 1440
3:2642 × 4281278 × 8521920 × 1280
1:1640 × 6401280 × 12801920 × 1920
4:5512 × 6401024 × 12801536 × 1920
9:16360 × 640720 × 12801080 × 1920

Resize and crop to the ratio

Once you have the size, use it. With the calculator on 16:9 and a width of 1280, the height box fills with 720, so both numbers are ready to type into another tool. The resize tool has a Keep proportions option. Leave one side blank and the other is worked out from the photo's shape. With both sides filled in and Keep proportions on, the photo fits inside the box without distortion. Turn it off, and the photo is stretched to exactly those sizes. The crop tool takes the other route. It cuts the photo to a ratio you choose, such as 1:1, 4:5, 3:4, 16:9 or 9:16, and it keeps the original pixels inside the frame without scaling them.

Edge cases

  • Portrait pictures. A portrait picture is the same ratio turned on its side. A 16:9 frame becomes 9:16 when it is upright, so swap the two numbers.
  • Decimal ratios. The fields accept decimals, so 1.5 to 1 reduces to 3:2. The calculator accepts up to six decimal places.
  • Crop or resize. Cropping removes pixels, so the ratio is whatever frame you draw. Resizing with Keep proportions on keeps the ratio and changes only the size.
  • Where the ratios come from. The common ratios are listed in the photo aspect ratios guide, which explains where they come from.
Cover of AI & Financial Freedom: A Practical Guide to Building Wealth in the Age of IntelligenceAI & Financial Freedom: A Practical Guide to Building Wealth in the Age of Intelligence

A short, practical guide to which skills AI is making cheap, which it is making valuable, and how to earn from the second kind.

$6.72 Get it on Gumroad →