Aspect Ratio Calculator
Five jobs for the shape of a picture or a screen. Type your numbers and see the working.
https://flxcode.com/aspect-ratio-calculator/
Width and height to a ratio Example
Pixels, inches or anything else. Decimals are fine.
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.
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.
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.
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 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 question | Row |
|---|---|
| What ratio is 1366 × 768? | Width and height to a ratio |
| I have the width and the ratio, I need the height | Find 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
| Situation | Row | You type | Answer |
|---|---|---|---|
| A 1280 px wide 16:9 video. How tall? | side | 16:9, width 1280 | 720 |
| Same ratio, width 1281, even height | side | 16:9, width 1281, even | 720 |
| 1920 × 1080 video in a 1080 × 1920 phone frame | fit | fit inside | 1080 × 608 |
| Same, but cover the whole frame | fit | fill the box | 3413 × 1920 |
| A 27 in monitor at 16:9 | screen | 27 in, 16:9 | 23.53 × 13.24 in |
| A 34 in screen, 16:9 or 21:9 | area | 34 in, 16:9 against 21:9 | 21: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.
| Name | Size | Lowest terms | Nearest common | Exact? |
|---|---|---|---|---|
| VGA | 640 × 480 | 4 : 3 | 4:3 | Yes |
| SVGA | 800 × 600 | 4 : 3 | 4:3 | Yes |
| XGA | 1024 × 768 | 4 : 3 | 4:3 | Yes |
| 720p | 1280 × 720 | 16 : 9 | 16:9 | Yes |
| SXGA | 1280 × 1024 | 5 : 4 | 5:4 | Yes |
| Many laptops | 1366 × 768 | 683 : 384 | 16:9 | No, 0.05% off |
| HD+ | 1600 × 900 | 16 : 9 | 16:9 | Yes |
| 1080p | 1920 × 1080 | 16 : 9 | 16:9 | Yes |
| 1920 × 1200 | 1920 × 1200 | 8 : 5 | 16:10 | Yes |
| Ultrawide 1080 | 2560 × 1080 | 64 : 27 | 2.39:1 | No, 0.82% off |
| 1440p | 2560 × 1440 | 16 : 9 | 16:9 | Yes |
| Ultrawide 1440 | 3440 × 1440 | 43 : 18 | 2.39:1 | No, 0.05% off |
| 4K UHD | 3840 × 2160 | 16 : 9 | 16:9 | Yes |
| DCI 4K | 4096 × 2160 | 256 : 135 | 16:9 | No, 6.67% off |
| Phone, full screen | 1080 × 1920 | 9 : 16 | 9:16 | Yes |
| Instagram portrait | 1080 × 1350 | 4 : 5 | 4:5 | Yes |
| Square post | 1080 × 1080 | 1 : 1 | 1:1 | Yes |
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.