Aspect Ratio Calculator

Simplify a size into its ratio, solve a missing width or height, or fit a ratio into a container — with CSS aspect-ratio output included.

The Aspect Ratio Calculator runs entirely in your browser. Dimensions are processed on your device and never uploaded.

Open the CSS clamp() Calculator

About Aspect Ratio Calculator

Aspect Ratio Calculator works in all three directions the problem arrives in. Give it a width and height and it simplifies the ratio by greatest common divisor — and, crucially, recognises near-misses: 1366×768 reduces to the useless 683:384, but the calculator also reports it as effectively 16:9, which is the answer you actually wanted. Give it a ratio and one dimension and it solves the other, rounded to whole pixels. Give it a ratio and a container and it returns the largest fit inside. Whatever the direction, you get the standard sizes at that ratio (1280×720 through 3840×2160 for 16:9) and ready-to-copy CSS: the modern aspect-ratio property plus the padding-top percentage for the legacy responsive-embed pattern.

Features

How to use the Aspect Ratio Calculator

  1. Pick the direction: size → ratio, missing dimension, or fit-in-box
  2. Enter what you know
  3. Read the result and the standard sizes at that ratio
  4. Copy the CSS if it is going into a layout

Example

Input

16:9, width 1000

Output

Height 563 px · CSS: aspect-ratio: 16 / 9; · padding hack 56.25%

The 56.25% figure is 9÷16 — the classic responsive-video number.

Common errors & troubleshooting

Frequently asked questions

What resolution is 16:9 at a given width?
Multiply width by 9/16: 1280→720, 1920→1080, 2560→1440, 3840→2160. The calculator solves it for any width or height and lists the standard sizes alongside.
How do I keep an element's aspect ratio in CSS?
The modern way is one line: aspect-ratio: 16 / 9. The legacy pattern gives a container padding-top of 56.25% and absolutely positions the content inside. The calculator emits both, matched to your ratio.
Why do monitors advertise 16:9 when the pixels say otherwise?
Panels like 1366×768 and 1360×768 approximate 16:9 within a percent — close enough for marketing and for full-screen video. The calculator shows the exact ratio and the nearest named one so the discrepancy is visible instead of confusing.
What aspect ratios do social platforms want?
Feed video leans 1:1 or 4:5, stories and shorts are 9:16, landscape uploads 16:9, and cinematic footage 21:9 or 2.39:1. Use the missing-dimension mode with the preset ratios to get exact pixel targets.
How does fit-in-box mode round?
It scales the ratio to the largest rectangle inside the container, then rounds both sides to whole pixels — so 16:9 in a 1000×1000 box is 1000×563. A half-pixel of ratio drift from rounding is normal and invisible.

Related tools

All ArrayKit tools