Aspect Ratio Resize Calculator

Resize width or height while keeping the original proportions.

New height
Adjust the inputs

Your result updates live as you type.

Resizing proportionally means scaling both dimensions by the same factor. Given an original size and one new dimension, the other follows: new height is new width times original height divided by original width.

A 1920×1080 image constrained to 800px wide becomes 450px tall, because the ratio 1.7778 has to hold. That ratio simplifies to 16:9, which is the value to put in the CSS aspect-ratio property.

Declaring aspect-ratio in CSS, or width and height attributes on the img element, lets the browser reserve the right space before the image loads. That removes the layout shift that otherwise happens when it arrives, which is a measured ranking factor as well as an irritation.

The formula

new height = new width × (original height ÷ original width)
w₁, h₁
Original width and height
w₂
The new width you want
h₂
The height that preserves the ratio
ratio
w₁ ÷ h₁, simplified to whole numbers

How it works, step by step

  1. Enter the original width and height.
  2. Enter the new width you need.
  3. The gauge shows the matching height.
  4. Use the simplified ratio in your CSS aspect-ratio declaration.

Worked examples

Fitting a 16:9 image to an 800px column

1920×1080 scaled to 800px wide gives 450px tall. The scale factor is 41.7 per cent, and the pixel count drops from 2.07 megapixels to 0.36 — about 83 per cent less data to encode.

A portrait crop

A 1200×1600 portrait at 400px wide becomes 533px tall. The ratio is 3:4, so declaring aspect-ratio: 3 / 4 reserves the correct box before the file arrives.

How to read your score

0–200ThumbnailList images and avatars.
200–600Content imageInline article images.
600–1,200LargeHero images and full-width media.
1,200–—Very largeSource assets; serve something smaller.

Frequently asked questions

Why does aspect ratio matter for page speed?

Because without it the browser cannot reserve space for an image it has not downloaded, so the content below jumps when it loads. That shift is measured by Cumulative Layout Shift, which is part of Core Web Vitals.

Should I use CSS aspect-ratio or width and height attributes?

Both. The HTML attributes give the browser a ratio before any CSS is parsed, and the CSS property handles cases where the rendered size differs from the intrinsic one.

What are the common ratios?

16:9 for video, 4:3 for older photography and slides, 3:2 for most cameras, 1:1 for social avatars and 21:9 for cinematic crops. Any of them can be expressed as a decimal if the numbers are awkward.

Does resizing change the ratio at all?

It should not, but rounding to whole pixels can shift it by a fraction. On a small thumbnail that rounding is occasionally visible as a one pixel band, which object-fit: cover resolves.

Proportional heights for common ratios

Height produced by each ratio at four widths
RatioDecimal400px wide800px wide1200px wide
1:11.0000400px800px1200px
4:31.3333300px600px900px
3:21.5000267px533px800px
16:101.6000250px500px750px
16:91.7778225px450px675px
21:92.3333171px343px514px
3:40.7500533px1067px1600px

Heights rounded to the nearest pixel, which is what a browser does when laying out.

Related calculators