Aspect Ratio Calculator
Enter a width and height to get the simplified ratio and the nearest standard one, then calculate new dimensions that keep the same shape.
Presets (keep the width, set the height)
1920 × 1080 — landscape shape, drawn to scale.
Resize keeping 16:9
Height: 720
Width: —
CSS
.box {
aspect-ratio: 16 / 9;
}
/* Fallback for very old browsers */
.box-legacy {
position: relative;
height: 0;
padding-top: 56.25%;
}What the calculator is for
Aspect ratio is the shape of a rectangle: width divided by height. You need it whenever something has to fit a frame without being stretched or cropped unexpectedly: exporting a video for YouTube or Reels, resizing a hero image, reserving space for an embed so the page does not jump while it loads, or checking whether a monitor is really "21:9". The calculator reduces any pair of dimensions to the smallest whole-number ratio, tells you which standard format it is closest to, and computes the missing side when you scale.
How to use it
- Type the Width and Height of your image, video or screen. Decimals are allowed (for example
2.39and1). - Or click a Preset: it keeps your current width and sets the matching height.
- Read the cards: Simplified ratio, Decimal (width per 1 unit of height), Nearest standard and Orientation. Click a card to copy its value.
- In Resize keeping …, type a New width to get the height, or a New height to get the width.
- Click Copy CSS to get an
aspect-ratiorule for your stylesheet.
Worked example
Enter 1920 × 1080. The ratio is 16:9, the decimal is 1.7778:1, and the nearest standard is an exact match. Type 1280 as the new width and the height is 720. The CSS card produces:
.box {
aspect-ratio: 16 / 9;
}
/* Fallback for very old browsers */
.box-legacy {
position: relative;
height: 0;
padding-top: 56.25%;
}Now try 2560 × 1080, a monitor sold as ultrawide 21:9. The exact ratio is 64:27(2.3704:1), and the nearest standard in the list is 2.39:1, about 0.8% away. That difference matters if you are producing a video that should fill the screen edge to edge.
Standard ratios the tool compares against
| Ratio | Decimal | Typical use |
|---|---|---|
| 1:1 | 1.000 | Square posts, avatars |
| 5:4 | 1.250 | Old LCD monitors, 8×10 prints |
| 4:3 | 1.333 | Classic TV, iPad, many cameras |
| 3:2 | 1.500 | 35 mm photos, many DSLRs |
| 16:10 | 1.600 | Laptop screens (1920×1200, 2560×1600) |
| 16:9 | 1.778 | HD/4K video, YouTube, most monitors |
| 1.85:1 | 1.850 | Flat cinema format |
| 2:1 | 2.000 | Some phones and streaming originals |
| 21:9 | 2.333 | Ultrawide monitors (marketing name) |
| 2.39:1 | 2.390 | Anamorphic widescreen cinema |
| 32:9 | 3.556 | Super-ultrawide monitors |
| 4:5 | 0.800 | Instagram portrait |
| 2:3 | 0.667 | Portrait photos, Pinterest |
| 3:4 | 0.750 | Portrait tablet |
| 9:16 | 0.563 | Stories, Reels, TikTok, Shorts |
Limitations
Pixel dimensions are whole numbers, so a scaled side is rounded to the nearest pixel; when the exact value is fractional the tool shows it next to the rounded one, and the resized image will differ from the ideal ratio by less than one pixel. The calculator assumes square pixels, which is true for almost all modern images and screens but not for some legacy video formats (anamorphic DV, for example). Values up to ten million are accepted.
Tips
- For video, prefer dimensions divisible by 2 (many encoders require even sizes): 1280 × 720 rather than 1279 × 719.
- When an image must fill a box of a different ratio, decide whether to crop (
object-fit: cover) or letterbox (contain) rather than forcing both dimensions. - Setting
widthandheightattributes on<img>lets browsers reserve the right space before the file loads.
To actually change an image, use the image resizer or crop image tools.
Frequently Asked Questions
How do I calculate an aspect ratio from width and height?
Divide both numbers by their greatest common divisor. 1920 and 1080 share a GCD of 120, so the ratio is 16:9. With decimals the calculator scales both values to whole numbers first, so 2.35 × 1 becomes 47:20.
Why is 1366 × 768 not exactly 16:9?
1366 ÷ 768 is 1.7786 while 16:9 is 1.7778, so the exact simplified ratio is 683:384. Screens like this are sold as 16:9 because they are within about 0.05%; the calculator shows that as the nearest standard ratio.
How do I resize an image without distorting it?
Keep the ratio: new height = new width × original height ÷ original width. Type the new width (or height) in the Resize section and the other side is calculated, rounded to whole pixels with the exact value shown.
Is 21:9 really 21:9?
Usually not. 2560 × 1080 is 64:27 (2.37:1) and 3440 × 1440 is 43:18 (2.39:1). "21:9" (2.33:1) is a marketing name for ultrawide screens.
How do I keep a box at a fixed aspect ratio in CSS?
Use the aspect-ratio property, for example aspect-ratio: 16 / 9, and set only the width. It is supported in all current browsers; the padding-top percentage trick is only needed for very old ones.
Does this tool upload anything?
No. It only does arithmetic in your browser; there are no files and no network requests involved.
Related tools
- Percentage CalculatorThree calculation modes: X% of Y, X is what % of Y, and % change between two numbers. Instant results with formula explanation.
- Unit ConverterConvert between units of length, weight, temperature, speed, and area. Instant bidirectional conversion with common unit presets.
- CSS Specificity CalculatorCalculate the specificity of any CSS selector. Breaks down IDs, classes, attributes, pseudo-classes, elements, and pseudo-elements. Compare two selectors.
- Color Opacity CalculatorPick a HEX color and an opacity level to get the equivalent rgba(), 8-digit hex (#RRGGBBAA), and CSS custom property. Live color swatch.
All Calculators tools · Found a bug or a wrong result? Report it.