CSS Aspect Ratio Calculator

Calculate missing dimension or simplified ratio from any two of width, height, and aspect ratio (16:9, 4:3, custom) with CSS aspect-ratio output.

Frequently Asked Questions

What is the CSS aspect-ratio property?

A CSS property that defines a preferred ratio for an element. Set `aspect-ratio: 16/9` and give the box a width; the height is calculated automatically.

Does aspect-ratio work with flex and grid?

Yes. The element's box dimensions are derived from the ratio inside a flex or grid layout, as long as the containing axis is sized.

What about old browsers?

Fallback with `padding-bottom: 56.25%` (= 9/16 · 100) on a wrapper. Modern code can use `@supports` to feature-detect aspect-ratio.

Important Disclaimer: Estimates for informational purposes only.

This calculator provides estimates for informational purposes only. Results are based on assumptions and may not reflect actual outcomes. Consult qualified professionals in relevant fields before making important decisions based on these results.