Calculate aspect ratios and find missing dimensions for images, videos, and UI elements. Free online aspect ratio calculator with instant results.
Aspect Ratio Calculator is a free, browser-based tool
from UseToolSuite's
Color & CSS Tools collection.
All processing happens locally on your device — your data is never uploaded to any server.
Use the tool below, then scroll down for detailed documentation, frequently asked questions, and related resources.
What is Aspect Ratio Calculator?
Aspect Ratio Calculator is a free online tool that computes the
simplest aspect ratio for any width and height values using the
Euclidean Greatest Common Divisor (GCD) algorithm. It also
allows you to calculate a missing dimension when you know one
dimension and the desired aspect ratio. This makes it easy to
resize images, videos, and UI elements while maintaining their
proportions. All calculations run instantly in your browser with
no data sent to any server.
When to use it?
Use the Aspect Ratio Calculator when you need to determine the
aspect ratio of an image or video, resize media while preserving
proportions, design responsive UI layouts with specific ratios,
or calculate the correct height for a known width (or vice
versa). It is essential for web developers working with
responsive images, video editors preparing content for different
platforms, and designers creating consistent visual layouts.
Common use cases
Web developers use it to set correct CSS aspect-ratio properties
for responsive containers. Video editors verify resolution
ratios before exporting for YouTube (16:9), Instagram (1:1 or
4:5), or TikTok (9:16). Graphic designers calculate print
dimensions that maintain visual balance. Photographers determine
crop dimensions for different frame sizes. UI/UX designers
ensure consistent card and thumbnail proportions across
breakpoints.
Why ratios matter beyond just math
Calculating a ratio (this tool reduces dimensions by their greatest common divisor, so 1920×1080 → 16:9) is the easy part. The valuable part is using ratios to keep layouts stable and media undistorted. A few reference points worth knowing:
| Ratio | Where it’s used |
|---|
| 16:9 | HD/4K video, most monitors, YouTube |
| 4:3 | Classic displays, some cameras |
| 1:1 | Square social posts, avatars |
| 9:16 | Vertical/Stories, mobile video |
| 2.39:1 | Cinematic widescreen |
| 1.91:1 | Open Graph / social share images |
Reserve space, don’t let it jump
The single biggest practical use of aspect ratios is preventing layout shift (see FAQ). The pattern for a responsive, shift-free image:
img { width: 100%; height: auto; } /* fluid */
<img src="…" width="1600" height="900"> /* reserves the 16:9 box */
For ratio-less boxes (a video embed, a hero with a background image), use the property directly:
.video-wrap { aspect-ratio: 16 / 9; }
The browser now holds the right height from the start, so your Core Web Vitals don’t suffer a CLS penalty.
Pair with object-fit
Forcing content into a ratio risks distortion. object-fit: cover scales the media to fill the ratio box and crops the overflow (no stretching), while object-fit: contain fits the whole image inside and may letterbox. For thumbnails and cover images you almost always want cover. Use the ratio you calculate here to set aspect-ratio, then let object-fit: cover handle the fit.
Mind sub-pixel and retina math
Ratio calculations can produce fractional pixel heights (16:9 at 1365px wide = 768.28px), and browsers round these, which can cause a 1px gap or clipping in tight layouts — nudge the width to a value that yields a whole height when it matters. Separately, the ratio is independent of device pixel ratio: a 16:9 image still needs a 2× source (e.g. 3200×1800) to look sharp on a Retina display, even though the ratio is unchanged. Calculate the layout dimensions here, then multiply by DPR for the source resolution.
How helpful was this tool?
Click to rate
Awesome! Glad it helped.
We don't have a marketing budget. The best way to support this free tool is by sharing it with other developers!
Help us improve!
Sorry it didn't meet your expectations. We're always looking to make these tools better. What was missing or broken?
Open GitHub Issue