Design ToolsA little help for every day

Search by name or task, such as JSON or percentage.

Design Tools

Aspect Ratio Calculator

Simplify a width and height to a ratio such as 16:9, scale to a new width or height with optional even rounding, and get CSS aspect-ratio and padding-top code.

View all tools
ResultUpdates as you type
Scaled size1280 × 720
Simplest ratio16:9
Ratio as a decimal1.7778:1
Nearest common ratio16:9 (exact)
CSSaspect-ratio: 16 / 9;
padding-top ratio boxpadding-top: 56.25%;

How to use Aspect Ratio Calculator

Enter the original width and height, say whether you know the new width or the new height, and type it in. The scaled size, simplest ratio, nearest common ratio and CSS appear instantly; choose a rounding mode for pixel or video sizes.

  1. Enter the original sizeType the original width and height, for example 1920 and 1080. Decimals are allowed.
  2. Give the new width or heightChoose which side you know, enter it, and pick two decimals, whole numbers or the nearest even number.
  3. Use the ratio and CSSCopy the scaled size, the simplest ratio, or the aspect-ratio and padding-top CSS lines.

How the ratio and new size are worked out

The simplest ratio divides both sides by their greatest common divisor: 1920 and 1080 share 120, which gives 16:9. Scaling keeps the same proportion, so new height = new width × original height ÷ original width, and a width of 1280 gives a height of 720. The CSS output is aspect-ratio: 16 / 9; and the older padding-top technique uses height ÷ width × 100, here 56.25%, on a wrapper with no height of its own. Portrait sizes work the same way: 1080 × 1920 is 9:16.

When the ratio isn't a neat number

Real screen sizes are not always exact. 1366 × 768 reduces to 683:384, about 0.05% wider than 16:9, and 2560 × 1080 is 64:27, which the tool matches to 2.39:1 (0.82% narrower) even though it's marketed as 21:9. Scaling 1366 × 768 to a width of 1280 gives a height of 719.65, so pick a rounding mode: nearest whole number for images, or nearest even number for video, because many encoders need even dimensions.

Accuracy and data handling

Review colours, dimensions and visual settings in the real component, type size and target display. The calculation runs in your current browser; the tool code does not send the input to a processing API.

FAQ

How do I calculate an aspect ratio?

Divide the width and height by their greatest common divisor. For 1280 × 1024 that's 256, giving 5:4. Enter the two numbers and the ratio appears straight away.

What height is a 16:9 image that's 1280 pixels wide?

1280 × 9 ÷ 16 = 720, so the image is 1280 × 720. Enter 1920 and 1080 as the original size and 1280 as the new width to get the same answer.

Why choose the nearest even number?

Video encoders such as H.264 with 4:2:0 chroma subsampling need even widths and heights. Rounding to an even number avoids encoder errors or automatic cropping when you export.

More Design Tools

Related tools