ximg.es

Aspect ratio calculator

Enter the width and the ratio to get the height, or the other way round. You also get the URL of a ximg.es image with that ratio and the CSS aspect-ratio, ready to copy.

Common ratios

Change the width or the height: the other one is recalculated from the ratio.

Sample ximg.es image with the chosen ratio
URL with ratio
https://ximg.es/1280x16:9
URL with size
https://ximg.es/1280x720
CSS
aspect-ratio: 16 / 9;

Find the ratio of a size

Ratio 683:384 (1.779:1). It’s almost 16:9.

Most common ratios

Ratio Typical use Example (px) Placeholder
Square posts, avatars, product thumbnails 1080 × 1080 https://ximg.es/1080x1:1
Older monitors, iPad, presentations 1024 × 768 https://ximg.es/1024x4:3
Photography (DSLR and mirrorless cameras) 1500 × 1000 https://ximg.es/1500x3:2
HD and 4K video, YouTube, screens, hero images 1920 × 1080 https://ximg.es/1920x16:9
Laptops and office monitors 1440 × 900 https://ximg.es/1440x16:10
Ultrawide monitors and cinema 2560 × 1080 https://ximg.es/2560x21:9
Stories, Reels, Shorts and TikTok 1080 × 1920 https://ximg.es/1080x9:16
Instagram and Facebook portrait posts 1080 × 1350 https://ximg.es/1080x4:5
Pinterest and portrait photography 1000 × 1500 https://ximg.es/1000x2:3
1280 × 1024 monitors and 8 × 10 in prints 1280 × 1024 https://ximg.es/1280x5:4
Blog headers and wide banners 1200 × 600 https://ximg.es/1200x2:1
Link preview image (og:image) 1200 × 628 https://ximg.es/1200x1.91:1
X profile header 1500 × 500 https://ximg.es/1500x3:1

What aspect ratio is

It’s the proportion between an image’s width and height, written as width:height. A 1920 × 1080 image and a 1280 × 720 one have different sizes but the same ratio, 16:9: the second is the first scaled down. That’s why the ratio is what matters when you design a slot, and the pixel size is what matters when you export.

How it’s calculated

To get the height: height = width × ratio height ÷ ratio width. With a width of 1280 and 16:9, 1280 × 9 ÷ 16 = 720. For the width, the other way round: width = height × 16 ÷ 9. And to find the ratio of a size, divide width and height by their greatest common divisor: 1920 and 1080 divided by 120 give 16 and 9.

Not every size gives a “round” ratio. 1366 × 768, the resolution of many laptops, is 683:384, which in practice is treated as 16:9.

Images with a ratio on ximg.es

The generator accepts the ratio directly in the URL: /1280x16:9 returns a 1280 × 720 image, and /16:9x720 works out the width from the height. If the result isn’t a whole number, it is truncated: /600x16:9 gives 600 × 337, not 600 × 338.

<img src="https://ximg.es/1280x16:9" width="1280" height="720" alt="">
<img src="https://ximg.es/1080x4:5/e2e8f0/475569.webp" width="1080" height="1350" alt="">

aspect-ratio in CSS

The aspect-ratio property reserves the space for an image or video before it loads, so the page doesn’t jump. With object-fit: cover, any image is cropped to fit the ratio:

.thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

If you set width and height on the <img> tag, the browser works out that ratio by itself.

Frequently asked questions

What is 16:9 in pixels?

It depends on the width: 1280 × 720 (HD), 1920 × 1080 (Full HD), 2560 × 1440 (QHD) or 3840 × 2160 (4K). They all have the same ratio. For any other width, multiply by 9 and divide by 16.

How do I calculate the height while keeping the ratio?

Multiply the new width by the original height and divide by the original width. If a 1600 × 900 image has to be 1000 wide, its height is 1000 × 900 ÷ 1600 = 562.5, rounded to 563.

What is the difference between 16:9 and 16:10?

16:10 is slightly taller: at 1920 wide, 16:9 gives 1080 high and 16:10 gives 1200. It’s the ratio of many laptops, and leaves more vertical room for documents and code.

What ratio is 1366 × 768?

Exactly 683:384, but it’s almost identical to 16:9 (1.779 against 1.778) and is treated as such.

How do I request an image with a ratio on ximg.es?

Put the ratio instead of the height: /1280x16:9 or /800x4:3. If the height isn’t a whole number, it is rounded down.

What is aspect-ratio for in CSS?

To fix an element’s ratio even when its width changes, and to reserve the space for images and videos before they load. It’s the modern version of the old padding-top: 56.25% trick.

More tools

See all tools · Placeholder image generator