How to Use the Aspect Ratio Calculator & CSS aspect-ratio Helper
-
1
Enter known width and height (e.g., 1920 × 1080).
-
2
The calculator automatically computes the greatest common divisor (GCD) and displays the simplified ratio (16:9).
-
3
Lock the aspect ratio and change width or height to calculate proportional scaling.
-
4
Copy modern CSS `aspect-ratio: 16 / 9;` rule to eliminate Cumulative Layout Shift (CLS).
Practical Example & Use Case
Calculating the exact proportional height for an embedded responsive video container to prevent Cumulative Layout Shift (CLS) on mobile devices.
Technical Notes & Limitations
Simplifies ratios using Euclidean Greatest Common Divisor algorithm.
Frequently Asked Questions
Why is CSS aspect-ratio better than the old padding-top hack?
Modern `aspect-ratio` allows elements to maintain their proportions cleanly without requiring dummy child elements or confusing percentage padding calculations.