Calculate aspect ratio

Calculate dimensions that preserve a chosen width-to-height ratio.

freeworks offlinenothing uploaded
ToolAspect Ratio Calculator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

An aspect ratio is width divided by height; preserving it scales one dimension from the other without changing the quotient. Given a target box, the fit or crop policy decides which dimension is constrained.

  • The ratio is dimensionless and applies across pixels, print units, and CSS boxes.

Worked example

HD Resolution
Calculate aspect ratio for a 1920x1080 display
Input
											Width: 1920
Height: 1080
										
Output
												Aspect Ratio Calculator
=======================

Original dimensions: 1920 x 1080
Aspect ratio: 16:9
Decimal ratio: 1.7778
GCD: 120

Closest standard ratio: 16:9 (diff: 0.0000)

Common sizes maintaining this ratio:
  480 x 270 (0.25x)
  960 x 540 (0.5x)
  1440 x 810 (0.75x)
  1920 x 1080 (1x)
  2880 x 1620 (1.5x)
  3840 x 2160 (2x)
  5760 x 3240 (3x)
											

When to use this

Video embeds, social-media exports, and responsive thumbnails calculate dimensions.

Edge cases

  • A zero height makes the ratio undefined.
  • Swapping width and height inverts the ratio.
  • Contain and cover preserve the ratio but create different unused or cropped areas.

References