How to Calculate Aspect Ratio

How to Calculate Aspect Ratio

To calculate aspect ratio, divide width by height and reduce both numbers by their greatest common divisor. A 1920x1080 image becomes 16:9, because both numbers divide evenly by 120. That single ratio lets you resize anything while keeping its proportions intact, and it tells you the exact width or height to use when only one side is known.

How to calculate aspect ratio from width and height

Aspect ratio is simply width:height expressed in the smallest whole numbers. Take your two dimensions, find the greatest common divisor (GCD), and divide both by it.

For 1920x1080, the GCD is 120. Dividing gives 16:9. For 800x600, the GCD is 200, which reduces to 4:3. The math is quick by hand for round numbers but tedious for odd ones, so the Aspect Ratio Calculator reduces any pair instantly.

  1. Open the Aspect Ratio Calculator.
  2. Enter your current width and height.
  3. Read the reduced ratio, then type a new width or height to get the matching dimension.

It runs entirely in your browser, so nothing you enter is sent anywhere.

Solve for a missing width or height

When you know the ratio and only one new dimension, the proportion formula gives you the other:

  • newHeight = newWidth * h / w
  • newWidth = newHeight * w / h

Say you have a 16:9 video and need it 1280 pixels wide. The height is 1280 * 9 / 16 = 720. Want a 4:3 image at 900 tall? The width is 900 * 4 / 3 = 1200. Keeping both sides locked to the same ratio is what prevents stretched or squashed results.

Common aspect ratios and where they are used

  • 16:9 - standard for video, YouTube, and most modern screens.
  • 4:3 - legacy displays, older cameras, and many slide decks.
  • 1:1 - square format for profile photos and social posts.
  • 9:16 - vertical video for stories, Reels, and TikTok.
  • 21:9 - ultrawide monitors and cinematic crops.
  • 3:2 - common in DSLR and mirrorless photography.

Knowing the target ratio first makes resizing predictable, because you only ever pick one dimension and let the formula fill in the rest.

Reserve space with the CSS aspect-ratio property

In the browser you can lock an element to a ratio without doing the math yourself. The CSS aspect-ratio property tells the browser how tall a box should be relative to its width:

.video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
}

img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
}

This reserves the correct height before an image or embed loads, which prevents layout shift as content arrives. It is the cleanest way to keep media responsive while holding its proportions on every screen size.

Find the ratio, lock one side, and let the math handle the other.

← All posts