X Xerobit

Video Aspect Ratios — 16:9, 4:3, 21:9, and Embed Best Practices

Video aspect ratios determine how video appears on different screens. Learn 16:9 for standard video, 21:9 for cinematic, 9:16 for vertical, embedding responsive YouTube/Vimeo,...

Mian Ali Khalid · · 4 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 →

Video aspect ratios affect how content displays across screens. 16:9 is universal for web; 9:16 for social/vertical; 21:9 for cinematic widescreen. Embedding videos responsively requires CSS tricks to maintain the correct ratio.

Use the Aspect Ratio Calculator to calculate dimensions for any video ratio.

Standard video aspect ratios

RatioUse caseCommon resolution
4:3Classic TV, old webcams640×480, 800×600
16:9Modern TV, YouTube, streaming1920×1080, 3840×2160
21:9Ultrawide monitors, cinema2560×1080, 3440×1440
9:16Vertical video (Reels, TikTok, Stories)1080×1920
1:1Square (Instagram feed)1080×1080
4:5Instagram portrait1080×1350

Responsive YouTube embed

The classic approach uses a wrapper div with padding-top: 56.25% (= 9/16 × 100):

<!-- Old technique — still works: -->
<div class="video-wrapper">
  <iframe src="https://www.youtube.com/embed/VIDEO_ID"
    frameborder="0" allowfullscreen></iframe>
</div>
.video-wrapper {
  position: relative;
  padding-top: 56.25%;  /* 16:9 ratio: (9/16) × 100 */
  height: 0;
  overflow: hidden;
}

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

Modern CSS approach with aspect-ratio

/* Modern, simpler: */
.video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
}

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

/* For 21:9 cinematic: */
.cinematic {
  aspect-ratio: 21 / 9;
}

/* For vertical video: */
.vertical-video {
  aspect-ratio: 9 / 16;
  max-width: 400px;  /* Prevent it from being too wide */
}

HTML5 <video> element

<!-- Video tag maintains aspect ratio automatically: -->
<video controls width="800" height="450">
  <source src="video.mp4" type="video/mp4">
  <source src="video.webm" type="video/webm">
  Your browser doesn't support HTML5 video.
</video>

<!-- Always set width and height attributes to prevent CLS: -->
<!-- Browser reserves space before video loads -->

<!-- Full-width responsive video: -->
<video controls style="width: 100%; height: auto;">
  <source src="video.mp4" type="video/mp4">
</video>

CSS for different video ratios

/* Calculate padding-top for any ratio: */
/* padding-top = (height / width) × 100 */

/* 16:9 → 9/16 × 100 = 56.25% */
.ratio-16-9 { padding-top: 56.25%; }

/* 4:3 → 3/4 × 100 = 75% */
.ratio-4-3 { padding-top: 75%; }

/* 21:9 → 9/21 × 100 = 42.86% */
.ratio-21-9 { padding-top: 42.86%; }

/* 1:1 → 100% */
.ratio-1-1 { padding-top: 100%; }

/* With aspect-ratio property (modern): */
.video {
  aspect-ratio: 16/9;  /* no padding trick needed */
}

Object-fit for video fills

/* Cover: video fills container, crops excess */
video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Common use: hero background video */
.hero-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -1;
}

Calculate video dimensions

function videoDimensions(ratio, knownDimension, value) {
  const [w, h] = ratio.split(':').map(Number);
  if (knownDimension === 'width') {
    return { width: value, height: Math.round(value * h / w) };
  }
  return { width: Math.round(value * w / h), height: value };
}

videoDimensions('16:9', 'width', 1920)  // { width: 1920, height: 1080 }
videoDimensions('9:16', 'height', 1920) // { width: 1080, height: 1920 }
videoDimensions('21:9', 'width', 2560)  // { width: 2560, height: 1097 }

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.