How to calculate an aspect ratio
- Enter the ratio in the two Ratio boxes, for example 16 and 9, or 2.35 and 1.
- Type a width or a height. The other side is calculated for the ratio and rounded to a whole pixel, and the preview box takes the same shape.
- To find the ratio of a size you already have, enter its width and height under Find the ratio of a size. Click Use this ratio to carry it up to the calculator.
- Click Copy CSS to copy an aspect-ratio declaration for your stylesheet.
Why use this tool
Resizing images without distortion
A photo is 4000 × 2667 and the page needs it 1200 pixels wide. Reduce the original to its ratio, then type 1200 as the width to get the height that keeps the image undistorted.
Responsive boxes in CSS
Video embeds, cards and image placeholders need a fixed shape at any width. Copy the aspect-ratio declaration and the browser keeps the box at that shape while it resizes.
Social media and ad sizes
Feeds, stories and banners each want a specific shape: 1:1, 4:5, 9:16. Pick the ratio and the width your platform asks for to get the exact height, or check whether an existing file already fits.
Identifying an unfamiliar screen
Reduce a resolution such as 1366 × 768 or 2560 × 1080 to see its exact ratio and the common ratio it is closest to.
Private by design
Every calculation runs in this browser tab, so results update the moment you change a value. There is nothing to upload, no account to create and nothing to install.
Good to know
The formula. For a ratio W:H, height = width × H ÷ W and width = height × W ÷ H. At 16:9, a width of 1280 gives 1280 × 9 ÷ 16 = 720.
Rounding. Pixels are whole numbers, so the calculated side is rounded to the nearest pixel. When that changes the number, the status line says so: a 1000-pixel width at 16:9 gives a height of 563, “rounded from 562.5”. The side you type is kept as you typed it.
The ratio stays locked. Whichever side you edit last is the one that is kept. Change the ratio and the other side is recalculated from it.
Reducing a size. The width and height are divided by their greatest common divisor, so 1920 × 1080 becomes 16:9. Decimals are scaled to whole numbers first: 2.35:1 becomes 47:20. You also get the ratio as a decimal and, when the shape is within 1% of one, the name of the nearest common ratio. That is how 1366 × 768, which reduces to 683:384, is still reported as roughly 16:9.
About “21:9”. Ultrawide monitors are sold as 21:9, but 2560 × 1080 is really 64:27 (2.37:1) and 3440 × 1440 is 43:18 (2.39:1). Both are more than 1% wider than 21:9 (2.33:1), so the calculator gives you their exact ratio rather than calling them 21:9.
The CSS. Copy CSS gives a declaration such as aspect-ratio: 16 / 9; using the simplest form of your ratio. Every current browser supports the aspect-ratio property.
Sharing. The ratio, width and height are kept in the address (?w=1280&h=720&ratio=16:9), so a copied link opens the same calculation.
In — Find the ratio of a size
1366 × 768Out — Simplest ratio, decimal and nearest common ratio
1366 × 768 = 683:384 (1.7786:1) ≈ 16:9| Ratio | Decimal | Example size | Typical use |
|---|---|---|---|
| 1:1 | 1 | 1080 × 1080 | Square posts, profile pictures, app icons |
| 4:3 | 1.3333 | 1024 × 768 | Older monitors and TVs, slides, many iPads |
| 3:2 | 1.5 | 6000 × 4000 | 35 mm film, DSLR photos, some laptops |
| 16:10 | 1.6 | 1920 × 1200 | Laptop and desktop monitors |
| 16:9 | 1.7778 | 1920 × 1080 | HD video, TVs, YouTube, most monitors |
| 21:9 | 2.3333 | 2520 × 1080 | Marketing name for ultrawide screens |
| 9:16 | 0.5625 | 1080 × 1920 | Stories, Reels, TikTok, YouTube Shorts |
| 4:5 | 0.8 | 1080 × 1350 | Portrait posts in social feeds |
| 2:3 | 0.6667 | 1000 × 1500 | Portrait photos, posters, 4 × 6 prints |
| 3:4 | 0.75 | 768 × 1024 | Tablets and phone photos held upright |
Frequently asked questions
How do I calculate the height from the width?
Multiply the width by the second number of the ratio and divide by the first. For 16:9 and a width of 1280: 1280 × 9 ÷ 16 = 720. For 4:3 and a width of 800: 800 × 3 ÷ 4 = 600.
How do I find the aspect ratio of a resolution?
Divide the width and the height by their greatest common divisor. For 1920 × 1080 the divisor is 120, giving 16:9. The Find the ratio of a size box does this and also names the closest common ratio.
Why is 1366 × 768 not exactly 16:9?
Its exact ratio is 683:384, about 1.7786:1, while 16:9 is 1.7778:1. Screen makers rounded the width to a convenient number, so the panel is a hair wider than 16:9. The difference is under 0.05%, which is why it is sold as 16:9.
Why was my result rounded?
Many widths do not divide evenly by a ratio. At 16:9, a 1000-pixel width needs a height of 562.5 pixels, which is rounded to 563. To get whole numbers at 16:9, use a width that is a multiple of 16.
How do I use the ratio in CSS?
Set aspect-ratio on the element, for example aspect-ratio: 16 / 9, and give it a width (or let it fill its container). The browser then calculates the height. For images and videos, add object-fit: cover if the file’s own ratio differs.