Media Production Tools
Menu

Aspect Ratio Calculator

Convert ratios and matching pixel dimensions.

What do you want to work out?
px
px

Aspect ratio

16:9
Exact reduced ratio
Dimensions
3,840 × 2,160 px
Decimal ratio
1.7778:1
Total pixels
8,294,400
Orientation
landscape

How this is calculated

A ratio is the width and height divided by their greatest common divisor, found by Euclid's algorithm. Solving for a missing dimension is one multiplication by the ratio. Fitting a source into a target ratio compares the two decimal ratios and keeps whichever axis the strategy requires.

Dimensions to ratio
  g       = gcd(width, height)
  ratio   = (width / g) : (height / g)
  decimal = width / height

Ratio and one dimension to the other
  heightFromWidth = width  × (ratioH / ratioW)
  widthFromHeight = height × (ratioW / ratioH)

Fit source into target ratio
  contain: the whole source fits inside the target, adding letterbox or pillarbox bars
  cover:   the target is filled completely, cropping the overflowing axis

Units

Dimensions are whole pixels between 1 and 100,000. A ratio has no unit; it is the relationship between two lengths. The decimal ratio is width divided by height, shown to four decimal places, and a value above one is landscape, below one is portrait, and exactly one is square.

Assumptions

  • Pixels are square. Anamorphic and non-square pixel aspect ratios are not modelled.
  • A frame within half a percent of a named ratio is reported under that name, with the exact reduced ratio shown alongside it.
  • Nothing here depends on codec, frame rate or bitrate.

Read how every number on this site is derived.

Worked example

A 4K UHD frame, a vertical frame, and one solved dimension:

gcd(3840, 2160) = 240   →  3840 ÷ 240 : 2160 ÷ 240   = 16:9
gcd(1080, 1920) = 120   →  1080 ÷ 120 : 1920 ÷ 120   = 9:16
height          = 1920 × (9 ÷ 16)                    = 1080

This is test vector V5 in the calculator requirements. Every step is exact, so 3840 × 2160 is 16:9 and nothing else, and a 1,920-pixel-wide 16:9 frame is exactly 1,080 pixels tall.

Frequently asked questions

Why does 1998 × 1080 come back as 1.85:1 and not 37:20?

Both are correct, and both are shown. A short list of ratios people actually name is checked first, and a frame within half a percent of one of them is reported under that name because that is the answer a delivery spec asks for. The exact reduced ratio appears beneath it.

What does Snap to even pixels do?

It rounds the solved dimension to the nearest even number instead of the nearest whole number. Many codecs require even dimensions on both axes, so 16:9 at a width of 1,919 pixels becomes 1,080 rather than 1,079. The exact unrounded value is always shown as well.

What is the difference between contain and cover?

Contain keeps the whole source frame and adds bars, so a 16:9 source placed in a 9:16 target gains letterbox bars above and below. Cover fills the target completely and crops whatever overflows. The calculator states which one applies and how many pixels are added or removed on each edge.

Can I enter a decimal instead of a ratio?

Yes. The ratio field accepts 16:9, 16/9, 16 9 and a bare decimal such as 1.7778, which is read as 1.7778:1. A decimal separator in this field is always a full stop, because a comma would be ambiguous against the separator between the two terms.

Why are pixels whole numbers?

A frame cannot have a fraction of a pixel, so widths and heights are validated as whole numbers between 1 and 100,000. A solved dimension that does not land on a whole pixel is reported with its exact value and a note, rather than being silently rounded without telling you.