CSSApril 2026 ยท 5 min read

How to Calculate Aspect Ratio for Images and Video

Aspect ratio is the proportional relationship between width and height. A 1920ร—1080 image has a 16:9 aspect ratio. Understanding and calculating aspect ratios is essential for responsive images, video embeds, CSS aspect-ratio property usage, and ensuring content displays correctly across devices.

๐Ÿ“
Try the Aspect Ratio Calculator
Free, no signup
โ†’
DG
Derek Giordano
Designer & Developer
In this guide
01Calculating Aspect Ratio02Common Aspect Ratios03CSS aspect-ratio Property04Aspect Ratios for Responsive Images
โšก Key Takeaways
  • Calculate the aspect ratio of any dimensions.
  • Covers calculating aspect ratio.
  • Covers common aspect ratios.
  • Covers css aspect-ratio property.
  • Covers aspect ratios for responsive images.

Calculating Aspect Ratio

To find the aspect ratio of any dimensions, divide both width and height by their greatest common divisor (GCD). For 1920ร—1080: GCD is 120, so 1920/120 = 16 and 1080/120 = 9. The ratio is 16:9. For 1200ร—630 (common OG image): GCD is 30, ratio is 40:21. The Aspect Ratio Calculator does this instantly โ€” enter any dimensions and get the simplified ratio plus equivalent sizes at common widths.

Common Aspect Ratios

16:9 โ€” HD video, YouTube, desktop monitors. 4:3 โ€” traditional TV, iPad, presentations. 1:1 โ€” Instagram posts, profile pictures. 9:16 โ€” vertical video (TikTok, Stories, Reels). 21:9 โ€” ultrawide monitors, cinema. 4:5 โ€” Instagram portrait posts. 3:2 โ€” DSLR photos, MacBook screens.

๐Ÿ’ก Tip
Use gap instead of margin hacks for flexbox spacing. It keeps layout code cleaner and is supported in all modern browsers.

CSS aspect-ratio Property

CSS has a native aspect-ratio property:

โš  Warning
Avoid animating width, height, top, or left. These trigger layout recalculations on every frame and can drop performance below 60fps.

.video-embed {

aspect-ratio: 16 / 9;

width: 100%;

}

This replaces the old padding-bottom hack for responsive embeds. The element maintains 16:9 proportions at any width. Supported in all modern browsers since 2021.

Aspect Ratios for Responsive Images

Set width and height attributes on tags to reserve space before the image loads (prevents layout shift): Example image with 1200x630 aspect ratio tells the browser the aspect ratio before download. Combined with CSS width: 100%; height: auto, the image scales responsively while the browser reserves the correct space from the start.

Frequently Asked Questions

How do I calculate aspect ratio?+
Divide both width and height by their greatest common divisor. 1920ร—1080 โ†’ 1920/120 : 1080/120 = 16:9. Or use the Aspect Ratio Calculator for instant results.
What aspect ratio is 1920x1080?+
16:9. This is the standard HD/Full HD ratio used by most monitors, TVs, and YouTube videos.
What is the CSS aspect-ratio property?+
A CSS property that maintains an element's proportions: aspect-ratio: 16 / 9 keeps the element at 16:9 regardless of its width. It replaces the old padding-bottom percentage hack.
Try it yourself

Use the Aspect Ratio Calculator โ€” free, no signup required.

โšก Open Aspect Ratio Calculator
DG
Derek Giordano
Written by the creator of Ultimate Design Tools. BA in Business Marketing.