aspect ratio calculator

How to use the aspect ratio calculator

  1. Pick a preset ratio (16:9, 4:3, 21:9, 1:1) or type a custom ratio like '2.35:1'.
  2. Enter any known dimension — width or height — and the other is computed instantly in pixels, rem, or percent.
  3. Reverse: enter two dimensions and the tool simplifies them to the nearest clean ratio (e.g., 1920×1080 → 16:9).
  4. Copy CSS with aspect-ratio: property set, or the manual padding-bottom hack for older browsers.

When to use it

Use it to resize images for social media crops (Instagram 1:1, YouTube 16:9, TikTok 9:16), plan video dimensions, or pre-compute hero image placeholders so pages don't shift layout on load. Alternative: calculator.net has the same math but no CSS output or visual preview.

Frequently asked questions

What's the modern way to lock an aspect ratio in CSS?
aspect-ratio: 16 / 9 on a container. Supported in all modern browsers since 2021. The old padding-bottom hack is only needed for IE11 and very old mobile Safari.
Why does my 16:9 video show black bars?
Because the source video isn't actually 16:9 — it's been letterboxed or pillarboxed into a 16:9 container. Crop the source or change the container ratio.
How do I calculate aspect ratio from odd dimensions?
Divide width by height, then look up the closest common ratio — e.g., 2560÷1600 = 1.6, which is 16:10. This tool's reverse mode does that for you.
What aspect ratio is iPhone video?
Portrait by default (9:16) at 1920×1080 on modern iPhones. Landscape clips recorded in the Camera app are 16:9 at the same resolution.

Related tools

Last updated: 2026-04-22