Skip to main content

Aspect ratio calculator

Preserve the correct proportions by calculating a width or height from a custom or predefined aspect ratio.

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Reference dimensions

Target dimension

Was this tool useful?

How does this tool work?

An aspect ratio describes the shape of a rectangle: 16:9 for HD video, 3:2 for a DSLR photo, 1:1 for a square post. This calculator finds the width or height that keeps that ratio exactly when you change one side, so you can resize an image, prepare a video export or size a slot on a web page without stretching anything.

The reference ratio comes either from a common ratio (16:9, 4:3, 3:2, 1:1 or 9:16) or from two values you type into Reference width and Reference height. They can be the pixels of an existing image (6000 × 4000) or a decimal ratio such as 2.39 × 1 for widescreen cinema.

Then type the New width and click Calculate height, or type the New height and click Calculate width. The other side comes from a rule of three and is rounded to the nearest whole pixel, never below 1 px.

Simplified ratio reduces the reference to its smallest whole terms: 1920 × 1080 gives 16:9, 6000 × 4000 gives 3:2 and 2.39 × 1 gives 239:100. Nothing is loaded or transformed: the tool only works with numbers.

How to use this tool

  1. Set the ratio

    Pick a common ratio or type the reference width and height.

  2. Enter the known side

    Type the new width or the new height, in pixels.

  3. Calculate the other side

    Click Calculate height or Calculate width and read the proportional dimensions.

Keeping the aspect ratio

Two rectangles have the same shape when their sides are proportional, so the missing side follows from a rule of three.

Height from a new width

H' = W' × h ÷ w

Used by the Calculate height button.

Width from a new height

W' = H' × w ÷ h

Used by the Calculate width button.

Simplified ratio

w:h = (w ÷ gcd) : (h ÷ gcd)

Both sides are divided by their greatest common divisor; a decimal ratio is first multiplied by a power of 10.

w, h
reference width and height
W', H'
new width and new height
gcd
greatest common divisor of w and h

Use cases

Resize a photo

Find the exact height of a 3:2 photo scaled down to 1200 px wide before exporting it.

Prepare a vertical video

Work out the width of a 9:16 video that is 1920 px tall for a story or short.

Reserve space on a page

Set the height of an image slot in CSS so the layout does not jump while it loads.

Examples

6000 × 4000 photo scaled to 1200 px wide

H' = 1200 × 4000 ÷ 6000 = 800. The photo keeps its original shape; a height of 900 px would have stretched it vertically.

Input

Reference width 6000, reference height 4000, new width 1200

Result

Simplified ratio 3:2; proportional dimensions 1200 × 800

2.39:1 cinema ratio at Full HD

1920 ÷ 2.39 = 803.35, rounded to 803 px. The decimal ratio is simplified without rounding it first, hence 239:100 rather than 2:1.

Input

Reference width 2.39, reference height 1, new width 1920

Result

Simplified ratio 239:100; proportional dimensions 1920 × 803

Tips and best practices

  • To start from an existing image, enter its pixel size as the reference: the simplified ratio tells you its format.
  • For video, prefer sizes divisible by 2, or even by 8: many encoders require it or compress better that way.
  • Rounding to whole pixels can shift the ratio by a fraction: 803 px instead of 803.35 gives 2.391:1, with no visible difference.
  • If the image has to change shape (4:3 to 16:9), the calculation is not enough: crop it or add bars with a dedicated tool.

Sources and references

Frequently asked questions

What is an aspect ratio?

The relationship between width and height, written width:height. 16:9 means 16 units wide for 9 units tall, whatever the actual size.

Which common ratios are available?

16:9, 4:3, 3:2, 1:1 and 9:16. For any other ratio, type your own values and the list switches to Custom.

Can I use a decimal ratio such as 2.39:1?

Yes. Enter 2.39 and 1 as the reference; the simplified ratio becomes 239:100 and the calculation keeps full precision until the final rounding.

Why is the result rounded?

Images are measured in whole pixels. The tool rounds to the nearest pixel and never goes below 1 px.

What is the difference between 16:9 and 1920 × 1080?

1920 × 1080 is a size; 16:9 is its shape. 1280 × 720 and 3840 × 2160 share the same 16:9 ratio at different sizes.

Does the tool change an image?

No. It only calculates numbers; to apply the dimensions you found, use the image resizer.

Related tools

Tools similar or complementary to this one.

Similar tools

Resize an image by setting its exact width and height before downloading the result.

Images & graphicsFeaturedUse this tool

Draw a frame on the image, lock a ratio (1:1, 4:5, 16:9…) and download the cropped part.

Images & graphicsFeaturedUse this tool

Expand or reduce the canvas around an image without resizing its content.

Images & graphicsUse this tool
GuideBest practicesIntermediate

How to Optimize Images for Web Performance

Build a complete Web image optimization pipeline: dimensions, formats, compression, responsive variants, metadata, loading, caching, LCP, CLS, and measurement.

31 August 202613 min
GuideBest practicesIntermediate

Responsive Images: Understanding srcset and sizes

Understand srcset, sizes, width and density descriptors, picture, art direction, and how browsers choose the right responsive image candidate.

31 August 202613 min
GuideConcepts and technologiesBeginner

What Image Resolution Should You Choose?

Distinguish pixel dimensions, pixel density, and DPI so you can resize images for the Web or print without unnecessary loss of sharpness.

31 August 202616 min
GuideBest practicesBeginner

Convert a PDF to images or images to PDF

Learn what changes when PDF pages are rasterized, how resolution and image format affect quality, and when to assemble images into a PDF.

29 August 20262 min