FLXCode Aspect Ratio Calculator

FLXCode apps

Appearance

Aspect Ratio Calculator

Five jobs for the shape of a picture or a screen. Type your numbers and see the working.

Width and height to a ratio Example

Pixels, inches or anything else. Decimals are fine.

×
683 : 384

1366 × 768 is 683:384, closest to 16:9.

  • Greatest common divisor of 1366 and 768: 2. 1366 ÷ 2 = 683 and 768 ÷ 2 = 384.
  • Decimal ratio: 1.7786 : 1 (width ÷ height). Height ÷ width is 0.5622.
  • Nearest common ratio: 16:9 (1.7778), off by 0.05%.
  • Exactly 16:9 at a height of 768 would be 1365.33 wide.

Find the other side Example

Type the ratio and one side. Pick how the answer is rounded.

Ratio , ,
720

16:9 with a width of 1281 gives a height of 720.

Your width 1281 is odd. A 4:2:0 video wants even sizes.

  • height = width × B ÷ A = 1281 × 9 ÷ 16 = 720.5625.
  • Rule: rounded to the nearest even number (halves go up). 720.5625 becomes 720.
  • Size: 1281 × 720.
  • The rounded size is 0.078% off 16:9.

Fit or fill a box Example

Fit keeps the whole picture and adds bars. Fill covers the box and cuts off the rest.

Picture × in a box × ,
1080 × 608

Fit 1920 × 1080 into 1080 × 1920: scaled to 1080 × 608, bars of 1312 px at the top and bottom.

  • Width factor 1080 ÷ 1920 = 0.5625. Height factor 1920 ÷ 1080 = 1.777778. Fit takes the smaller one: 0.5625.
  • Scaled picture: 1080 × 608 px (each side rounded half up to a whole pixel).
  • Bars, top and bottom: 1312 px in total, 656 px top and 656 px bottom.
  • When a total is odd, the extra pixel goes to the right or the bottom.

Screen size from the diagonal Example

The visible picture, not the case.

Diagonal , ratio
23.53 × 13.24 in

A 27 in screen at 16:9 is 23.53 wide and 13.24 high.

This is the visible picture. The case around it adds a few millimetres.

  • Width = diagonal × A ÷ √(A² + B²) = 27 × 16 ÷ √337 (√337 = 18.3576).
  • Height = diagonal × B ÷ √(A² + B²).
  • Width 23.53 in (59.77 cm), height 13.24 in (33.62 cm).
  • Area 311.5 sq in.

Two ratios, same diagonal Example

Which shape has more screen area?

At : against
21:9 has 15.3% less area than 16:9

At the same diagonal, 21:9 is 15.3% smaller in area than 16:9.

  • 16:9: 29.63 × 16.67 in, area 493.96 sq in.
  • 21:9: 31.25 × 13.39 in, area 418.55 sq in.
  • Area at a fixed diagonal = diagonal² × A × B ÷ (A² + B²). The closer to square, the more area.

No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it. What this tool keeps and sends.

Problem or idea? Email us

Which row do I use?

The questionRow
What ratio is 1366 × 768?Width and height to a ratio
I have the width and the ratio, I need the heightFind the other side
Will my video fit the phone frame, or be cut?Fit or fill a box
How big is a 27 inch monitor?Screen size from the diagonal
16:9 or 21:9 at the same inches, which is bigger?Two ratios, same diagonal

To change the shape of an actual picture, use Change aspect ratio. This page only does the numbers. For general ratios like recipes, see the ratio calculator.

Worked examples

SituationRowYou typeAnswer
A 1280 px wide 16:9 video. How tall?side16:9, width 1280720
Same ratio, width 1281, even heightside16:9, width 1281, even720
1920 × 1080 video in a 1080 × 1920 phone framefitfit inside1080 × 608
Same, but cover the whole framefitfill the box3413 × 1920
A 27 in monitor at 16:9screen27 in, 16:923.53 × 13.24 in
A 34 in screen, 16:9 or 21:9area34 in, 16:9 against 21:921:9 has 15.3% less area than 16:9

Common resolutions and their ratio

Every row comes from the same code as the tool. "Nearest" is picked from 16:9, 16:10, 4:3, 3:2, 5:4, 1:1, 21:9, 2.39:1, 9:16, 4:5, 2:3, 3:4, by how far the decimal ratio is from each.

NameSizeLowest termsNearest commonExact?
VGA640 × 4804 : 34:3Yes
SVGA800 × 6004 : 34:3Yes
XGA1024 × 7684 : 34:3Yes
720p1280 × 72016 : 916:9Yes
SXGA1280 × 10245 : 45:4Yes
Many laptops1366 × 768683 : 38416:9No, 0.05% off
HD+1600 × 90016 : 916:9Yes
1080p1920 × 108016 : 916:9Yes
1920 × 12001920 × 12008 : 516:10Yes
Ultrawide 10802560 × 108064 : 272.39:1No, 0.82% off
1440p2560 × 144016 : 916:9Yes
Ultrawide 14403440 × 144043 : 182.39:1No, 0.05% off
4K UHD3840 × 216016 : 916:9Yes
DCI 4K4096 × 2160256 : 13516:9No, 6.67% off
Phone, full screen1080 × 19209 : 169:16Yes
Instagram portrait1080 × 13504 : 54:5Yes
Square post1080 × 10801 : 11:1Yes

How the ratio is found

Divide both numbers by their greatest common divisor, the biggest number that goes into both. Euclid's way finds it by repeated division, and it stops when the remainder is 0. For 1920 and 1080:

  • 1920 = 1 × 1080 + 840
  • 1080 = 1 × 840 + 240
  • 840 = 3 × 240 + 120
  • 240 = 2 × 120 + 0

The last non-zero remainder, 120, is the divisor. 1920 ÷ 120 = 16 and 1080 ÷ 120 = 9, so the ratio is 16:9. The page about the greatest common factor shows the same method for any numbers.

A ratio is exactly 16:9 only when width ÷ height is exactly 16/9. For 1366 × 768 the divisor is 2, so the lowest terms are 683 : 384. That is the real ratio. The decimal is 1.7786, against 1.7778 for 16:9. At a height of 768, exact 16:9 would be 768 × 16 ÷ 9 = 1365.33 wide, and there are no half pixels. The same happens with the monitors sold as 21:9: 2560 × 1080 is 64 : 27 and 3440 × 1440 is 43 : 18, while 21:9 is 7:3.

Rounding rules

  • Find the other side: the answer is rounded to a whole number, half up. Other choices are round up, round down, nearest even number (halves go up) and no rounding. The row also tells you how far the rounded size is from your ratio.
  • Fit and fill: each scaled side is rounded half up to a whole pixel. Bars and cut-off pixels split in two. If the total is odd, the extra pixel goes to the right or the bottom.
  • Screen size: shown to 2 decimals, half up. The square root is calculated to 15 decimals first.

Even numbers matter for video. Video stores colour at a lower size than brightness: 4:2:0 is "subsampled at a factor of 2 both horizontally and vertically" (Wikipedia, Chroma subsampling). FFmpeg's scale filter has a way to ask for a size "divisible by n" for the same reason (FFmpeg filters documentation). With n = 2, the row "round to an even number" does the same.

Limits

  • The size row and the screen rows take decimals. Fit and fill take whole pixels only.
  • Up to 40 digits per number. A ratio needs exactly two numbers above 0.
  • Screen sizes are the visible picture. The case and the bezel are not included, and a curved screen is measured along its curve by the maker.
  • The common ratio list has 12 entries. A ratio outside it gets the nearest one and the distance to it.

FAQ

Why is 1366 × 768 not exactly 16:9?

768 is not divisible by 9, so no whole width gives exactly 16:9 at that height. 768 × 16 ÷ 9 is 1365.33. Panels were made 1366 wide, which is 0.05% off. The tool shows it as 683:384, the true lowest terms.

What is the real ratio of a "21:9" monitor?

Most are 64:27 (2560 × 1080) or 43:18 (3440 × 1440). 21:9 is 7:3, which is 2.333. These are 2.370 and 2.389. The name is a rounded marketing label, and the tool says which common ratio is nearest.

Why do video sizes need to be even?

Common video formats store colour at half the size in both directions (4:2:0), so encoders want an even width and height. Pick "round to an even number" in the second row and the answer is even.

What is the difference between fit and fill?

Fit scales the picture until all of it is inside the box and leaves bars. Fill scales it until it covers the box and cuts off what sticks out. Same picture, one keeps every pixel of it and the other keeps every pixel of the box.

Does a wider screen of the same diagonal have less area?

Yes. At a fixed diagonal the area is highest for a square and drops as the shape gets wider. A 34 in 21:9 has about 15% less area than a 34 in 16:9. The last row gives the number for any two ratios.

How do I get the size of a screen from its diagonal?

Width is the diagonal times A over the square root of A² + B², and height is the same with B. The result is the visible picture. A 27 in 16:9 screen is 23.53 in wide and 13.24 in high.

More from FLXCode

  • Change Aspect RatioMake a picture 1:1, 4:5, 16:9 or 9:16 by cropping or adding space. Pixels are not scaled. Nothing is uploaded.
  • Ratio CalculatorSolve A:B = C:D, simplify a ratio, split a total in a ratio, or turn a ratio into percents.
  • Image ResizerResize photos by pixels, percent or preset for Instagram and email. Batch and zip. Nothing is uploaded.
  • Crop ImageCrop a photo with drag handles, arrow keys or exact pixels. Presets for 1:1, 4:5 and 16:9. Nothing is uploaded.

Share Aspect Ratio Calculator