Calculate Image & Video Dimensions

Quickly calculate the aspect ratio of any image or video to prevent layout shifts. Enter your dimensions below to instantly generate the modern CSS aspect-ratio property, or copy the classic padding-bottom snippet for responsive iframe embeds.

Dimensions

px
px

Or Upload Image

Aspect Ratio Result:

16:9

CSS aspect-ratio property:

aspect-ratio: 16 / 9;

CSS padding-bottom (for responsive video/iframe):

56.25%

Responsive embed snippet:

.container {
  height: 0;
  overflow: hidden;
  padding-bottom: 56.25%;
  position: relative;
}
.container > * {
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}
16:9 1920 × 1080 px aspect ratio preview