πŸ“
πŸ“±

Calculate Ratios for Responsive Design

Find the correct height for responsive images and containers given a fixed width and target ratio.

Hakuna kuingia kinachohitajika
Simplified ratio16:9
Decimal ratio1.7778:1
Named ratio16:9
Megapixels2.07 MP
16:9

Common dimensions

Responsive tips

πŸ“±

Responsive containers need a known aspect ratio to maintain layout. Enter your container width and ratio to get the exact height needed.

πŸ’‘

The CSS padding-top trick: padding-top: 56.25% gives a 16:9 container. Calculate your ratio as (h/w Γ— 100)% to get the right percentage.

πŸ–₯️

Modern CSS: aspect-ratio: 16/9 works in all modern browsers. Use the simplified ratio output from this tool directly in CSS.

πŸ“

For <img> tags, always specify width and height attributes matching the image's natural ratio. Prevents layout shift (CLS) as images load.

Jinsi Inavyofanya Kazi

1
Ingiza
Enter your data into the tool above. Everything stays local to your browser.
2
Chakata
The tool processes your data instantly in your browser using JavaScript. No server, no waiting.
3
Pakua
Get your result instantly. Nothing is stored after you leave the page β€” complete privacy.

Kwa nini utumie yetu?

βœ“Bure kabisa β€” bila gharama zilizofichwa, kamwe
βœ“Hakuna akaunti, barua pepe, au kuingia kinachohitajika
βœ“Faili hazitoki kwenye kifaa chako kamwe
βœ“Hakuna kikwazo cha ukubwa wa faili kabisa
βœ“Hakuna alama za maji kwenye matokeo yoyote

Also check out…

Maswali Yanayoulizwa Mara Kwa Mara