Image ratio calculator: find the right width and height without stretching
Use an image ratio calculator to find the new width or height that keeps a photo in proportion. Free, runs in your browser, and links to a resizer.
You know a photo is 1920 by 1080 pixels and you need it 1280 pixels wide. What height keeps it from looking squashed? An image ratio calculator answers that in one step. The free Aspect Ratio Calculator takes your original size and one new dimension, then works out the other. It also shows the simple ratio, such as 16:9.
This post explains what the ratio is, how to calculate it by hand, and what to do with the result.
The short answer
- Open the Aspect Ratio Calculator.
- Enter the original width and height in pixels.
- Type either a new width or a new height.
- Click "Calculate ratio" and read the original ratio and the new size.
- Use "Resize using these values" to carry the numbers to the image resizer.
The calculator only does the math. It does not open your photo, and it does not crop anything.
What an aspect ratio is
An aspect ratio is the width of a picture compared with its height. A 1920 by 1080 image has a ratio of 16:9. A 4000 by 3000 image has a ratio of 4:3. MDN describes the CSS aspect-ratio property as defining a desired width-to-height ratio of an element's box, written as aspect-ratio: 16 / 9.
To get the simple form, divide both numbers by their greatest common divisor. The calculator does this for you.
| Original size | Divide by | Simple ratio |
|---|---|---|
| 1920 × 1080 | 120 | 16:9 |
| 4000 × 3000 | 1000 | 4:3 |
| 1080 × 1350 | 270 | 4:5 |
How to calculate the new size by hand
If you keep the ratio, the new height is the new width times the original height, divided by the original width.
- Take the original width and height, for example 1920 and 1080.
- Pick the new width you need, for example 1280.
- Multiply 1280 by 1080, then divide by 1920.
- The answer is 720, so the new size is 1280 × 720.
The same works the other way. To start from a height, multiply it by the original width and divide by the original height. Results are rarely whole numbers, so the calculator rounds to the nearest pixel.
Image ratio calculator: step by step
- Open the Aspect Ratio Calculator.
- Enter the original width and height in the two "Original" fields. The page starts with 1920 and 1080.
- Enter a new width, or click the new height field and enter a height instead.
- Click "Calculate ratio".
- Read the original ratio and the new size in the result box.
- Click "Resize using these values" to open the image resizer with those numbers.
If you change the new height, the width is calculated from it. Otherwise the height follows the new width. Either way, the two values stay in proportion.
Why keeping the ratio matters
If you change width and height separately, the shape changes. Faces look wider, circles turn into ovals, and text stretches. Setting one side and calculating the other avoids that.
Ratio also matters on the web. MDN explains that setting the width and height attributes on an image lets the browser calculate its aspect ratio before the file loads. The browser then reserves the space, which reduces or prevents layout shift. Web.dev lists images with unknown dimensions as a common cause of layout shifts, and says a good Cumulative Layout Shift score is 0.1 or less.
So when you resize a photo for your own site, use the new width and height from the calculator in the img tag.
Resize on a Mac with Preview
If you work on a Mac, Preview can do the same job. Apple's guide says to open the image, choose Tools > Adjust Size, and enter new values for width and height. Select "Scale proportionally" and the other value changes to maintain the proportions.
Apple also notes that if you pick a size from the "Fit into" menu, the width or height may end up smaller than the size you chose. That happens because the proportions are kept.
When the ratio does not match your target
Sometimes the target has a different ratio than the photo. A 4:3 photo does not fit a 16:9 slot without a change. You have two options.
- Crop the photo to the new ratio. Use the Image Cropper, which offers fixed ratios.
- Keep the whole photo and accept empty space around it.
Do not stretch the picture to fill the slot. Stretching is what the calculator helps you avoid.
Tips before you resize
- Keep the original file. Make the smaller copy from it.
- Check the result at 100% zoom before you publish it.
- Write down the final width and height if you also need them for a web page.
FAQ
Does the calculator crop my photo?
No. It only finds proportional dimensions. To change the shape, crop first and then calculate again.
Can I use it for a video or a screen size?
Yes. The math is the same for any width and height in pixels, even though the tool is meant for images.
Why is the new height a few pixels off?
The exact answer is often a fraction, and a picture cannot have part of a pixel. The calculator rounds to the nearest whole pixel.
Where do I choose the file to resize?
In the Image Resizer. The calculator hands over the numbers, and you pick and save the file there.
Do I need to upload my photo?
No. You only type numbers into the calculator, and nothing is sent anywhere.