Aspect Ratio Calculator
Find the aspect ratio of any width and height, the closest common ratio, the height for a new width, and the CSS aspect-ratio value.
Free · No sign-up · Your inputs stay in your browser
Input
Calculate aspect ratios and resized dimensions
Output
16:9
Decimal ratio
1.7778
Closest common ratio: 16:9
Height at width 1280
720px
CSS
aspect-ratio: 16 / 9;
Padding hack (legacy)
padding-top: 56.2500%;
The CSS aspect-ratio property reserves the box's height before an image or video loads, so the page does not jump (cumulative layout shift). For images, width and height attributes on the img tag do the same: browsers compute the ratio from them.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Prevent layout shift
When an image or embed loads without reserved space, the content below jumps, which Core Web Vitals measures as cumulative layout shift. width and height attributes on an img let the browser compute the ratio before loading; for other boxes, the aspect-ratio property reserves the space.
Common ratios
16:9 for video, 16:10 for many laptop screens and covers, 1.91:1 for Open Graph link images, 4:5 and 9:16 for portrait social posts.