devcalcs

aspect ratio calculator

Find the simplified ratio of any dimensions, or resize one side to match a target ratio. Result updates as you type.

px
px

Ratio

16:9

Widescreen — 1080p video, modern monitors, YouTube · decimal 1.7778

What an aspect ratio is

An aspect ratio is the relationship between the width and height of a rectangle, written as two numbers separated by a colon: 16:9, 4:3, 1:1, 21:9. The numbers are the smallest pair of integers that describe the shape. A 1920×1080 image, a 1280×720 image, and a 16×9 image all share the same aspect ratio — they’re scaled versions of the same shape.

Aspect ratios matter for video players, image containers, hero sections, responsive grids, and anywhere you need a shape to stay visually consistent while its absolute size changes. CSS’s aspect-ratio property accepts a ratio directly — aspect-ratio: 16 / 9 — making the calculator above the lookup you reach for when translating dimensions to that property.

How simplification works

To simplify a ratio, divide both numbers by their greatest common divisor (GCD). For 1920×1080: GCD(1920, 1080) = 120. Dividing gives 16:9. For 1280×720: GCD = 80, also 16:9. For 800×600: GCD = 200, giving 4:3. The calculator runs Euclid’s GCD algorithm and reports the result.

Dimensions that don’t simplify to a common named ratio (1234×891, for example) are reported in their fully-reduced form even if that form is awkward. If the simplified pair matches a known ratio — 16:9, 4:3, 21:9, 1:1, 3:2 — the calculator names it. Otherwise it labels the result as a custom ratio.

Worked examples

A YouTube embed. The standard YouTube player is 16:9. You want it 720px wide; what height should the container be? 720 × 9 / 16 = 405. Use aspect-ratio: 16 / 9 in CSS and the browser computes that automatically.

An Instagram post. Square format is 1:1, portrait feed is 4:5, Stories and Reels are 9:16. Knowing the ratio up front lets you crop or generate at the right shape rather than fitting an existing image into the wrong container.

A monitor.2560×1080 is ultrawide 21:9 (technically 64:27 in fully-simplified form, but the industry rounds it). 2560×1440 is 16:9. The numbers look similar but the shape is different — useful for sizing fullscreen application layouts.

Common aspect ratios

The ratios you’ll encounter day-to-day in screens, video, and image production.

RatioWhere it’s used
16:9Widescreen — 1080p video, modern monitors, YouTube
4:3Standard — SD video, older monitors, iPads
21:9Ultrawide — cinema, ultrawide monitors
1:1Square — Instagram posts, avatars
3:2DSLR / 35mm photography
9:16Portrait video — Stories, TikTok, Reels
8:516:10 widescreen — laptops (MacBook, Surface)
2:3Portrait photo
5:4Pre-widescreen monitor (1280×1024)

Common dimensions and their ratios

Real-world dimensions you might paste into the calculator above.

DimensionsSimplified ratio
1920 × 108016:9
3840 × 216016:9
1280 × 72016:9
1024 × 7684:3
2560 × 108064:27
1080 × 10801:1
1080 × 19209:16
1500 × 10003:2

Using aspect ratios in CSS

Modern CSS has a dedicated property for this. Once you know the ratio, you don’t need to set both width and height — set one and let the browser compute the other.

/* A responsive 16:9 video container */
.video {
  aspect-ratio: 16 / 9;
  width: 100%;
  /* height is computed from width × 9/16 */
}

/* A square avatar */
.avatar {
  aspect-ratio: 1 / 1;
  width: 64px;
}

/* An Instagram-portrait card */
.story {
  aspect-ratio: 9 / 16;
  width: 200px;
  /* height computes to ~356px */
}

Common mistakes

  1. 1. Setting width and height separately and hoping they line up. Hand-calculated dimensions for a 16:9 box always have a fractional pixel somewhere. Use aspect-ratio CSS instead and let the browser handle the math.
  2. 2. Confusing 21:9 with 64:27. True ultrawide monitor ratios are usually 64:27 (≈2.37:1) but everyone calls them 21:9 (≈2.33:1). Close, but not identical. The calculator returns the gcd-reduced form; the marketing label is what people remember.
  3. 3. Rounding before simplifying. 720.5 × 405.28 simplified rounds-then-divides to weird numbers. Always work with the original integers, then simplify.
  4. 4. Ignoring container constraints. aspect-ratio is a hint, not a hard constraint. A flex or grid parent can override it. If your aspect-ratio isn’t holding, check the layout context above the element.

Accessibility

Aspect ratio itself doesn’t affect accessibility, but the elements it shapes often do. Video and image containers should preserve aspect ratio across viewports so content isn’t cropped or distorted at smaller screen sizes — the aspect-ratio property handles this without needing the old padding-bottom hack and works with screen readers and zoom levels predictably.

For embedded video, always pair the ratio with proper captioning and a meaningful title attribute on the iframe. The container shape is one piece; the content inside has its own accessibility requirements.

FAQ

What does “16:9” actually mean?

For every 16 units of width, there are 9 units of height. Could be 16cm × 9cm, 1600px × 900px, or 1920px × 1080px — the shape is the same. It’s a relationship, not a size.

Why is 1920×1080 called 16:9 and not 240:135?

Because 240:135 divides down further. The simplified form is the smallest pair of integers that describes the same relationship. Both ratios refer to the same shape; 16:9 is just what we say out loud.

Should I use the CSS aspect-ratio property or the padding-bottom hack?

Use the property. It’s supported in every modern browser, doesn’t require an empty pseudo-element, and works with the natural width/height flow. The padding hack is a workaround for browsers that haven’t been relevant since 2021.

What ratio is best for hero images on a website?

16:9 is the safe default — matches video, monitors, and most modern phones held in landscape. For a more cinematic feel, 21:9 or 2.35:1 cropped down. For visual emphasis on the subject (e.g. a portrait), 3:2 or 4:3. There’s no single right answer — pick the ratio that frames the content best.

Can I have a non-integer aspect ratio?

Mathematically yes (1.85:1 and 2.35:1 are common in cinema), but CSS’s aspect-ratio property accepts any positive number, so you can write aspect-ratio: 2.35 / 1 directly. The calculator above simplifies to integer form when possible — switch to the resize tab and use decimal ratio inputs if you need the non-integer case.