Display proportions

Aspect Ratio Calculator

Reduce a width and height to their simplest whole-number ratio and show the height-to-width decimal.

Dimensions

Enter pixel or physical dimensions

W:H
Proportion summary

Simplified ratio

The aspect ratio will appear here

Use positive whole numbers in the same unit.

A widescreen rectangle labelled width and height with a sixteen by nine ratio
Aspect ratio describes shape, not physical size or resolution.

What Is an Aspect Ratio?

An aspect ratio describes a shape’s width compared with its height. This Aspect Ratio Calculator reduces two positive whole-number dimensions to their simplest width:height ratio. It also returns the reduced components, the original dimensions and a decimal labeled Height ÷ width.

Use it to compare the proportions of images, video frames, screens or physical rectangles. Both dimensions must use the same unit. The simplified ratio describes shape independently of scale; it does not measure image detail, pixel density or physical size on its own.

How to Calculate Aspect Ratio from Dimensions

  1. Enter the horizontal dimension in Width and the vertical dimension in Height. Keep that order even for a portrait image.
  2. Use positive whole numbers in the same unit, such as pixels for both values or millimetres for both. Each entry must be between 1 and 1,000,000,000.
  3. If your measurements contain decimals, convert both to a common smaller unit or multiply both by the same power of ten to obtain whole numbers. Do not round just one dimension.
  4. Select Calculate aspect ratio. Read the simplified width:height pair and the separate Ratio width and Ratio height components.
  5. Check Height ÷ width carefully: this decimal uses the reverse order of the usual width/height number. Original dimensions repeats your input numbers without adding a measurement unit.

For example, 21.0 cm by 29.7 cm can be entered as 210 and 297 in millimetres. The relationship remains the same because both dimensions were multiplied by ten. The form has no unit selector or automatic conversion.

Aspect Ratio Reduction and Decimal Formula

g = greatest common divisor of width and height

Simplified aspect ratio = (width ÷ g) : (height ÷ g)

Decimal result = height ÷ width

The greatest common divisor, or GCD, is the largest positive whole number that divides both dimensions exactly. Dividing both sides by it removes a common scale factor without changing the proportions. If the dimensions share no factor greater than one, the reduced pair stays unchanged.

MDN’s aspect-ratio definition uses width relative to height. The ratio pair on this page follows that order, but its decimal card intentionally displays height divided by width. For a 16:9 rectangle, that card is 9 ÷ 16 = 0.5625 rather than 16 ÷ 9 ≈ 1.7778.

The exact integer pair is the clearest result when precision matters. The decimal is rounded to four places and may omit trailing zeroes. Different exact ratios can share the same rounded decimal.

Width, Height and Ratio Results

Width
The positive whole-number horizontal dimension, in the same chosen unit as Height.
Height
The positive whole-number vertical dimension. A portrait rectangle has a height larger than its width.
Greatest common divisor, g
The common whole-number factor used to reduce both dimensions. It is explained here but has no separate result card.
Simplified aspect ratio / Simplified ratio
The exact width:height relationship in lowest terms, repeated in the featured result and ratio card.
Ratio width / Ratio height
The two reduced integer components. They represent proportions rather than a resized file’s pixel dimensions.
Height ÷ width
A unitless decimal calculated in the stated order, rounded to at most four decimal places.
Original dimensions
The two entered numbers repeated as width × height. The calculator does not infer or convert their units.

Aspect Ratio Calculation Example

Illustrative example. Enter width 2,520 and height 1,080 for a hypothetical image. The greatest common divisor is 360: 2,520 ÷ 360 = 7 and 1,080 ÷ 360 = 3.

The simplified ratio is 7:3, with Ratio width 7 and Ratio height 3. Height ÷ width is 1,080 ÷ 2,520 ≈ 0.4286. This describes a landscape shape because width exceeds height.

A second image of 1,260 × 540 also reduces to 7:3, despite having fewer pixels along both dimensions. Swapping width and height to 1,080 × 2,520 gives 3:7 and a decimal of 2.3333, describing a portrait shape.

Calculation check. Independent greatest-common-divisor and division checks agree with the calculator results. The example does not imply that the form resizes or edits an image.

Additional illustrative comparison. These hypothetical cases use the assumptions stated in the caption.

Illustrative dimensions; decimal means height divided by width
Width × heightReduced W:HH ÷ W
2,520 × 1,0807:30.4286
1,260 × 5407:30.4286
1,080 × 2,5203:72.3333
1,000 × 6671,000:6670.667

Aspect Ratio, Resolution and Resizing

The same shape can have many different sizes. Aspect ratio fixes a relationship between dimensions, while resolution and physical measurements supply additional information. Preserve that distinction when preparing an export or comparing a frame with an image.

Illustrative relationships between shape and dimensions
ChangeExampleEffect on shape
Scale both dimensions equally1,260 × 540 to 2,520 × 1,080Both remain 7:3
Swap the two dimensions2,520 × 1,080 to 1,080 × 2,5207:3 becomes 3:7
Use equal dimensions900 × 900Reduces to 1:1
Keep the rounded decimal onlyA four-decimal approximationMay hide a small exact difference

A 1,260 × 540 pixel image contains 680,400 pixels, while a 2,520 × 1,080 image contains 2,721,600. Doubling each dimension quadruples the pixel count, but both still have the same 7:3 proportions. The ratio does not establish whether extra detail was captured or merely interpolated.

In a CSS width/height ratio, the matching pair is 7 / 3. The calculator’s H ÷ W card is the reciprocal decimal, about 0.4286. Keep that orientation clear when carrying a result into another program; this form does not export CSS or calculate cropping instructions.

How to Read Width and Height Proportions

Read a:b as “a units wide for every b units high.” A ratio with equal components describes a square. A width component larger than the height component describes landscape orientation; the reverse describes portrait orientation.

Images can have the same aspect ratio and different resolutions. Increasing both dimensions by a common factor preserves shape, but the resulting pixel count changes. Stretching only one dimension changes the ratio and can distort the subject.

When fitting a source image to a differently shaped frame, a display system may crop content or leave unused space. This calculator reports the input relationship only. It does not choose a crop, calculate missing dimensions, select a platform preset or assess a non-square-pixel video format. MDN’s aspect-ratio property reference provides a separate example of how a width/height ratio is used in web layouts.

Common Aspect Ratio Calculation Mistakes

  • Reversing width and height without intending to change orientation.
  • Mixing units, such as width in inches and height in centimetres.
  • Entering fractional values directly even though this form requires whole numbers.
  • Reading the Height ÷ width card as the more familiar width/height decimal.
  • Expecting a common format name instead of a mathematically reduced pair: 21:9 reduces to 7:3.
  • Rounding a measured shape to the nearest popular ratio and calling it an exact match.
  • Using aspect ratio alone to judge print quality or determine an image’s pixel density.

Aspect Ratio Questions

How do I find an aspect ratio from width and height?

Divide both whole-number dimensions by their greatest common divisor, keeping width first. For 2,520 × 1,080, dividing both by 360 gives 7:3.

Why does the calculator show 7:3 rather than 21:9?

Both pairs describe the same proportions, but 21 and 9 share a factor of three. This calculator returns the lowest whole-number terms, so it reduces 21:9 to 7:3.

Why is the decimal 0.5625 for a 16:9 image?

The decimal card is explicitly Height ÷ width. For a 16:9 shape it calculates 9/16, or 0.5625. The simplified ratio itself still uses width:height.

Can I use inches or centimetres instead of pixels?

Yes, if both values use the same unit and are whole numbers. Convert decimal dimensions to matching smaller units or multiply both by a common factor before entering them.

Is aspect ratio the same as image resolution?

No. Ratio describes proportions; resolution gives dimensions such as 1,260 × 540 pixels. Several different resolutions can reduce to the same ratio.

What happens when width and height are equal?

The simplified ratio is 1:1 and the height/width decimal is 1. The entered numbers describe a square, regardless of their common size.

Will the calculator crop or resize my photo?

No. It accepts two numbers and reports their proportions. It does not upload an image, choose a crop, calculate an export size or change a file.

Why does my ratio not reduce to a familiar format?

Some dimensions share no large common factor or do not exactly match a standard shape. For example, 1,000 × 667 stays 1,000:667 rather than becoming exactly 3:2.

Sources and References

  • MDN Web Docs: Aspect ratio defines width-to-height proportions and distinguishes common ratio representations.
  • MDN Web Docs: aspect-ratio documents width/height proportions in a web-layout context. It does not imply this calculator changes a page or edits a file.