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)

16:9

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

  1. Type the Width and Height of your image, video or screen. Decimals are allowed (for example 2.39 and 1).
  2. Or click a Preset: it keeps your current width and sets the matching height.
  3. Read the cards: Simplified ratio, Decimal (width per 1 unit of height), Nearest standard and Orientation. Click a card to copy its value.
  4. In Resize keeping …, type a New width to get the height, or a New height to get the width.
  5. Click Copy CSS to get an aspect-ratio rule 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

RatioDecimalTypical use
1:11.000Square posts, avatars
5:41.250Old LCD monitors, 8×10 prints
4:31.333Classic TV, iPad, many cameras
3:21.50035 mm photos, many DSLRs
16:101.600Laptop screens (1920×1200, 2560×1600)
16:91.778HD/4K video, YouTube, most monitors
1.85:11.850Flat cinema format
2:12.000Some phones and streaming originals
21:92.333Ultrawide monitors (marketing name)
2.39:12.390Anamorphic widescreen cinema
32:93.556Super-ultrawide monitors
4:50.800Instagram portrait
2:30.667Portrait photos, Pinterest
3:40.750Portrait tablet
9:160.563Stories, 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 width and height attributes 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.