Free tool
Aspect ratio calculator
Enter a width and height to get the aspect ratio (1920×1080 is 16:9), then type a new width or height to get the other side at the same ratio. Pick a preset, paste a size like 1366x768, or type a ratio like 2.39:1 directly.
Free · no sign-up · runs in your browser, nothing is uploaded
Aspect ratio
16:9
landscape · 1080p Full HD
Decimal (w ÷ h)
1.7778
1.78:1
Closest common ratio
16:9
exact match
Height as % of width
56.25%
padding-top hack value
1920 × 1080 · 2,073,600 px (2.07 MP)
1280 × 720
Whole-pixel sizes at exactly 16:9, nearest 1280px wide
.box {
aspect-ratio: 16 / 9;
width: 100%;
}
/* Images and video: crop to fill the box */
.box img,
.box video {
width: 100%;
height: 100%;
object-fit: cover;
}How the calculation works
An aspect ratio is width divided by height, written as two whole numbers. To reduce a size, find the greatest common divisor (GCD) of the two sides and divide both by it. To scale a size, keep the ratio and solve for the missing side.
ratio = width ÷ gcd(width, height) : height ÷ gcd(width, height) 1920 × 1080 → gcd 120 → 16:9 new height = new width × ratio height ÷ ratio width 1280 at 16:9 → 1280 × 9 ÷ 16 = 720 new width = new height × ratio width ÷ ratio height 1920 at 9:16 → 1920 × 9 ÷ 16 = 1080
The same in JavaScript:
const gcd = (a, b) => (b ? gcd(b, a % b) : a);
const ratio = (w, h) => { const g = gcd(w, h); return `${w / g}:${h / g}`; };
ratio(1920, 1080); // "16:9"
const heightFor = (w, rw, rh) => (w * rh) / rw;
heightFor(1280, 16, 9); // 720When the new side comes out as a fraction (1080 wide at 16:9 is 607.5 tall), the tool lists nearby sizes where both sides are whole pixels at exactly that ratio. Turn on "even numbers only" for video: H.264 and most other encoders with 4:2:0 chroma need even widths and heights.
Common aspect ratios and where they are used
| Ratio | Decimal | Typical size | Used for |
|---|---|---|---|
| 16:9 | 1.78 | 1920×1080 | HD and 4K video, YouTube, most monitors and TVs |
| 9:16 | 0.56 | 1080×1920 | Vertical video: Reels, TikTok, Shorts, Stories |
| 4:3 | 1.33 | 1024×768 | Older TVs and monitors, iPad screens, many slides |
| 3:2 | 1.50 | 1500×1000 | Full-frame and APS-C camera photos, Surface laptops |
| 1:1 | 1.00 | 1080×1080 | Square posts, avatars, album covers |
| 4:5 | 0.80 | 1080×1350 | Portrait feed posts |
| 16:10 | 1.60 | 1920×1200 | Laptop screens (1920×1200, 2560×1600) |
| 21:9 | 2.37 | 2560×1080 | Ultrawide monitors (2560×1080 is exactly 64:27) |
| 2:1 | 2.00 | 1200×600 | Open Graph share images are close (1200×630 is 40:21) |
| 5:4 | 1.25 | 1280×1024 | 1280×1024 monitors, 8×10 prints |
| 2:3 | 0.67 | 1000×1500 | Portrait photos, posters, Pinterest pins (1000×1500) |
| 32:9 | 3.56 | 5120×1440 | Super-ultrawide monitors (5120×1440) |
| 1.85:1 | 1.85 | 1998×1080 | Widescreen cinema (flat) |
| 2.39:1 | 2.39 | 2048×858 | Anamorphic cinema (scope) |
Screen and video resolutions with their exact ratio
Marketing names round. The exact reduced ratio tells you whether two sizes really scale into each other without cropping.
| Name | Size | Exact ratio | Decimal |
|---|---|---|---|
| 720p HD | 1280×720 | 16:9 | 1.78:1 |
| 1080p Full HD | 1920×1080 | 16:9 | 1.78:1 |
| 1440p QHD | 2560×1440 | 16:9 | 1.78:1 |
| 4K UHD | 3840×2160 | 16:9 | 1.78:1 |
| 8K UHD | 7680×4320 | 16:9 | 1.78:1 |
| DCI 4K (cinema) | 4096×2160 | 256:135 | 1.9:1 |
| Common laptop | 1366×768 | 683:384 (sold as 16:9) | 1.78:1 |
| WUXGA | 1920×1200 | 8:5 | 1.6:1 |
| WQXGA | 2560×1600 | 8:5 | 1.6:1 |
| XGA | 1024×768 | 4:3 | 1.33:1 |
| UXGA | 1600×1200 | 4:3 | 1.33:1 |
| SXGA | 1280×1024 | 5:4 | 1.25:1 |
| Ultrawide FHD | 2560×1080 | 64:27 (sold as 21:9) | 2.37:1 |
| Ultrawide QHD | 3440×1440 | 43:18 (sold as 21:9) | 2.39:1 |
| Vertical video | 1080×1920 | 9:16 | 1:1.78 |
| Square | 1080×1080 | 1:1 | 1:1 |
| Portrait post | 1080×1350 | 4:5 | 1:1.25 |
| Open Graph image | 1200×630 | 40:21 | 1.9:1 |
Aspect ratio in CSS, HTML and Tailwind
The aspect-ratio property has been supported in all major browsers since 2021. Set one side and the browser computes the other:
.video {
width: 100%;
aspect-ratio: 16 / 9; /* "16 / 9", or a single number like 1.7778 */
}
.video iframe { width: 100%; height: 100%; }
/* Images: crop to the box instead of stretching */
.thumb { aspect-ratio: 1; object-fit: cover; width: 100%; }- At least one of width or height must be automatic. If you set both,
aspect-ratiodoes nothing. aspect-ratio: auto 16 / 9uses an image's own ratio once it loads, and 16:9 until then.- On
<img>and<video>, thewidthandheightattributes give the browser the ratio before the file loads, so the page does not jump (layout shift). Set them to the file's real size, then size the element with CSS. - Before 2021 the trick was
height: 0; padding-top: 56.25%(9 ÷ 16), because vertical padding in percent is relative to the width. The tool's "Old browsers" tab writes it for any ratio. - Media queries can test the viewport:
@media (min-aspect-ratio: 16/9)matches screens that are 16:9 or wider. - Tailwind has
aspect-video(16 / 9),aspect-square(1 / 1) and arbitrary values likeaspect-[4/3].
Sizing images for the web? Convert them with the image converter, render SVGs at an exact size with SVG to PNG, or turn pixel sizes into rem with the PX to REM converter. More on design tools on DevHunt.
More free developer tools
FAQ
How do I calculate an aspect ratio?+
Divide the width and the height by their greatest common divisor. For 1920×1080 the divisor is 120, so the ratio is 16:9. For 1366×768 it is 2, which gives 683:384: close to 16:9 but not exact.
How do I find the height for a width at a given ratio?+
height = width × ratio height ÷ ratio width. For 16:9 at 1280 wide: 1280 × 9 ÷ 16 = 720. For the width from a height, swap them: width = height × ratio width ÷ ratio height.
What is a 16:9 resolution?+
Any size whose width divided by its height is 1.7778: 1280×720 (720p), 1920×1080 (1080p), 2560×1440 (1440p) and 3840×2160 (4K UHD) are the common ones. It is the standard ratio for HD video and most monitors and TVs.
What is the aspect ratio of 1080×1350?+
4:5, a portrait ratio (1080 and 1350 share a divisor of 270). It is a common size for portrait posts in social feeds.
Is 21:9 really 21:9?+
Not exactly. Ultrawide monitors sold as 21:9 are usually 2560×1080 (64:27, about 2.37:1) or 3440×1440 (43:18, about 2.39:1). 21:9 itself is 2.33:1. The calculator shows the exact ratio and the closest marketing name.
How do I keep an aspect ratio in CSS?+
Give the element a width and set aspect-ratio: 16 / 9; the browser computes the height. Leave either width or height automatic, or the ratio has no effect. For images and video inside the box, add object-fit: cover to crop instead of stretching.
What does 2.39:1 or 1.85:1 mean?+
Those are ratios written against a height of 1, common in cinema: 1.85:1 is the usual widescreen format and 2.39:1 the anamorphic scope format. Type 2.39:1 or just 2.39 in the ratio field to work with them.
Sources: MDN: aspect-ratio · CSS Box Sizing 4: aspect-ratio · MDN: object-fit · MDN: aspect-ratio media feature · HTML spec: img width and height map to aspect-ratio · web.dev: Optimize Cumulative Layout Shift · Tailwind CSS: aspect-ratio. Checked 2026-10-30.