X Xerobit

Aspect Ratio Guide — Common Ratios for Video, Images, and UI Design

Aspect ratio is the proportional relationship between width and height. Here's a complete reference for common aspect ratios used in video, photography, web design, and...

Mian Ali Khalid · · 5 min read
Use the tool
Aspect Ratio Calculator
Calculate aspect ratios (16:9, 4:3, 21:9, etc.). Given W:H and one dimension, get the other. Responsive padding-top % for CSS aspect-ratio containers.
Open Aspect Ratio Calculator →

Aspect ratio is the proportional relationship between width and height, expressed as width:height. A 16:9 ratio means for every 16 units wide, the content is 9 units tall. Understanding aspect ratios helps you size images, design video players, create responsive layouts, and avoid distortion when scaling content.

Use the Aspect Ratio Calculator to calculate dimensions from any ratio.

Common aspect ratios

Video and screens

RatioDecimalCommon nameUse case
16:91.778WidescreenHD/4K video, YouTube, presentations, most monitors
4:31.333StandardOld TVs, older web cams, medical displays
21:92.333UltrawideCinema, ultrawide monitors
2.39:12.39Cinematic scopeTheatrical film (anamorphic)
1.85:11.85Flat widescreenTheatrical film
9:160.5625VerticalMobile video, TikTok, Reels, Stories
1:11.0SquareInstagram posts, profile photos
4:50.8PortraitInstagram portrait posts

Photography

RatioNotes
3:2DSLR/mirrorless cameras (full-frame sensor), 35mm film
4:3Micro Four Thirds cameras, old digital cameras
1:1Square format (medium format film, Instagram)
5:4Large format film (4×5 inch)
16:9Modern phone video, some phones in photo mode

Web and UI design

RatioUse case
16:9Hero images, video embeds, presentation slides
3:2Blog thumbnails, article feature images
4:3Product images, profile photos
1:1Avatar images, gallery thumbnails
2:1Wide banner images, Twitter card images
OG 1200×630Open Graph meta image (~1.9:1)

Calculating dimensions from ratio

To find height from width and ratio:

height = width × (ratio height / ratio width)
height = width / decimal_ratio

Examples:

16:9 at width 1280px: height = 1280 × (9/16) = 720px
3:2  at width 1200px: height = 1200 × (2/3) = 800px
4:3  at width 800px:  height = 800 × (3/4) = 600px

To find width from height:

width = height × (ratio width / ratio height)
width = height × decimal_ratio

CSS aspect ratio implementation

Modern CSS (aspect-ratio property)

/* Maintain 16:9 ratio for a video container: */
.video-container {
  aspect-ratio: 16 / 9;
  width: 100%;
}

/* Square element: */
.avatar {
  aspect-ratio: 1;  /* or 1/1 */
  width: 80px;
}

/* 4:3 image: */
.thumbnail {
  aspect-ratio: 4 / 3;
  width: 300px;
  overflow: hidden;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;  /* Scale to fill without distortion */
}

Responsive video embed (iframe)

Modern CSS makes this trivial:

.video-wrapper {
  aspect-ratio: 16 / 9;
  width: 100%;
}

.video-wrapper iframe {
  width: 100%;
  height: 100%;
}

The old padding-top hack (for older browsers):

/* Legacy: padding-top percentage trick */
.video-wrapper {
  position: relative;
  padding-top: 56.25%;  /* 9/16 × 100% */
  height: 0;
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

Image with aspect ratio

.card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;    /* Fill and crop */
  object-position: center;  /* Crop from center */
}

object-fit values:

  • cover — fills the box, crops to maintain ratio
  • contain — fits inside the box with letterboxing
  • fill — stretches to fill (distorts)
  • none — natural size, no scaling
  • scale-down — like contain but won’t upscale

Aspect ratio in JavaScript

function calculateAspectRatio(width, height) {
  function gcd(a, b) {
    return b === 0 ? a : gcd(b, a % b);
  }
  const divisor = gcd(width, height);
  return `${width / divisor}:${height / divisor}`;
}

console.log(calculateAspectRatio(1920, 1080));  // "16:9"
console.log(calculateAspectRatio(1280, 720));   // "16:9"
console.log(calculateAspectRatio(800, 600));    // "4:3"
console.log(calculateAspectRatio(1200, 800));   // "3:2"

// Calculate dimensions from ratio:
function dimensionsFromRatio(ratio, knownDimension, isWidth = true) {
  const [w, h] = ratio.split(':').map(Number);
  if (isWidth) {
    return { width: knownDimension, height: Math.round(knownDimension * h / w) };
  } else {
    return { width: Math.round(knownDimension * w / h), height: knownDimension };
  }
}

console.log(dimensionsFromRatio('16:9', 1280));  // { width: 1280, height: 720 }
console.log(dimensionsFromRatio('3:2', 800));    // { width: 800, height: 533 }

Social media image sizes

Getting the aspect ratio right for social media prevents cropping:

PlatformImage typeSizeRatio
Twitter/XSummary card image1200×628~1.91:1
Twitter/XSummary large image1200×6281.91:1
FacebookOpen Graph1200×630~1.9:1
InstagramSquare post1080×10801:1
InstagramPortrait post1080×13504:5
InstagramLandscape post1080×566~1.91:1
InstagramStory/Reel1080×19209:16
YouTubeThumbnail1280×72016:9
LinkedInPost image1200×627~1.91:1

The “Open Graph” meta image standard (~1.9:1) is common across platforms for link previews.

Detecting and preserving aspect ratio in image uploads

async function getImageAspectRatio(file) {
  return new Promise((resolve) => {
    const img = new Image();
    img.onload = () => {
      const { width, height } = img;
      function gcd(a, b) { return b === 0 ? a : gcd(b, a % b); }
      const d = gcd(width, height);
      resolve({
        width,
        height,
        ratio: `${width/d}:${height/d}`,
        decimal: width / height
      });
      URL.revokeObjectURL(img.src);
    };
    img.src = URL.createObjectURL(file);
  });
}

const ratio = await getImageAspectRatio(fileInput.files[0]);
console.log(ratio);  // { width: 1920, height: 1080, ratio: '16:9', decimal: 1.777... }

Related posts

Related tool

Aspect Ratio Calculator

Calculate aspect ratios (16:9, 4:3, 21:9, etc.). Given W:H and one dimension, get the other. Responsive padding-top % for CSS aspect-ratio containers.

Written by Mian Ali Khalid. Part of the Frontend & Design pillar.