Aspect Ratio Calculator

Free aspect ratio calculator. Enter a ratio like 16:9 plus one dimension to get the other, or reduce any pixel size (e.g. 1920x1080) to its simplest ratio.

Advertisement

Aspect ratio calculator: solve a missing dimension and reduce pixels to a ratio

You have three of the four numbers and you need the fourth. The video is 16:9 and the container is 1280 px wide — how tall is it? The design calls for a 4:3 crop 1200 px tall — how wide? Someone handed you a 3440×1440 screenshot and asked what ratio it is. This calculator answers all three, and it does the arithmetic as you type rather than after you press a button.

It has two independent cards. The first solves a dimension from a known ratio: enter a ratio width and ratio height, then type into either the width or the height pixel field and the other one updates immediately. The second reduces a pixel size to its simplest whole-number ratio. Everything runs in your browser — the numbers you type are never sent anywhere, because there is nothing on the page that sends them.

The arithmetic, written out

An aspect ratio is just a fraction: width divided by height. If a shape has ratio rW:rH, then for any width you choose, the height that preserves the proportion is:

  • height = width × rH ÷ rW
  • width = height × rW ÷ rH

Those are the two formulas the first card runs, and which one it runs depends on which field you last touched. Type in the width box and it solves for height; type in the height box and it solves for width. It also shows the ratio as a single decimal — 16:9 displayed as 1.7778:1 — which is the number you actually compare when you want to know whether two sizes are the same shape.

Worked example, 16:9 at 1280 px wide:

  • 1280 × 9 = 11520
  • 11520 ÷ 16 = 720
  • Result: 1280×720

Worked example in the other direction, 4:3 at 1200 px tall:

  • 1200 × 4 = 4800
  • 4800 ÷ 3 = 1600
  • Result: 1600×1200

Worked example that does not come out clean, the 2.39:1 cinema preset at 1920 px wide. The preset is stored as 239:100, so the sum is 1920 × 100 ÷ 239 = 803.3473. There is no 803.3473-pixel-tall image. You round — 803 or 804 — and accept a fraction of a pixel of drift, which is invisible. The calculator displays results to four decimal places rather than silently rounding, so you can see when a ratio does not land on a whole pixel and decide yourself which way to go. Rounding to an even number is the usual choice, because several video encoders require even dimensions.

Reducing a pixel size to its simplest ratio

The second card goes the other way. Give it a width and height in pixels and it divides both by their greatest common divisor, which is the definition of reducing a fraction to lowest terms. 1920 and 1080 share a greatest common divisor of 120: 1920 ÷ 120 = 16 and 1080 ÷ 120 = 9, so 1920×1080 is 16:9. A phone photo at 4032×3024 shares a divisor of 1008, giving 4032 ÷ 1008 = 4 and 3024 ÷ 1008 = 3 — a 4:3 image.

This is where the honest answers show up, and they are frequently not the round number people expect:

  • 1366×768, the resolution on a great many budget laptop panels, reduces to 683:384. Its decimal is 1.7786, and 16:9 is 1.7778 — close, but not equal. A true 16:9 at 768 px tall would be 1365.33 px wide, which is not a whole pixel, so the panel is very slightly wider than widescreen.
  • 3440×1440, sold everywhere as a “21:9 ultrawide”, actually reduces to 43:18. Its decimal is 2.3889 against 21:9’s 2.3333. The marketing name is a rounded label, not the geometry.
  • 2560×1600 reduces to 8:5, which is the same shape as 16:10 — a fraction and its double are the same ratio, and the reduced form is the one that survives.

Two things worth knowing about how this card behaves. It expects whole pixel numbers and parses the inputs as integers, so a decimal entered there is truncated rather than honoured; if you need decimal precision, the first card handles it. And it labels a result with a friendly name only when the reduced pair exactly matches one it knows — 16:9, 4:3, 21:9, 1:1, 3:2, 9:16, 16:10, 5:4, 3:4. Because 2560×1600 reduces to 8:5 and not to 16:10, it comes back correctly reduced but unnamed. An absent name means “not in the list”, never “wrong answer”.

The common ratios and where they come from

RatioDecimalWhere it comes fromExample size
16:91.7778The HD and UHD broadcast standard; the default shape of nearly all video1920×1080
4:31.3333Pre-HD television and early computer displays; still the native shape of most phone camera sensors1024×768
21:92.3333Marketing label for ultrawide monitors; real panels reduce to 64:27 (2560×1080), 43:18 (3440×1440) or 12:5 (3840×1600)3440×1440
1:11Square. Avatars, product tiles, and square social placements1080×1080
3:21.5The 35 mm film frame, inherited by most DSLR and mirrorless sensors3000×2000
9:160.562516:9 turned on its side — full-screen vertical video on a phone held upright1080×1920
16:101.6Laptop and tablet displays that want a little extra vertical room for toolbars2560×1600
2.39:12.39Anamorphic widescreen cinema; the source of the black bars on a film shown on a 16:9 screen1920×803

The first card ships seven of these as preset buttons — 16:9, 4:3, 21:9, 1:1, 3:2, 9:16 and 2.39:1. Clicking one fills the ratio fields and immediately recalculates the height from whatever width is already there, so you can hold a width fixed and click through presets to see how tall each shape would be. The ratio fields also accept anything you type, decimals included, so 2.35 and 1 is as valid as 235 and 100.

Resizing an image without distorting it

Stretching happens when the width and height are scaled by different factors. The fix is to pick one dimension and derive the other. If a 4032×3024 photo has to fit a 1200 px column, reduce it first to learn it is 4:3, then solve: 1200 × 3 ÷ 4 = 900. Export at 1200×900 and every proportion in the frame is preserved.

If the target box is a fixed width and a fixed height, you cannot satisfy both without either cropping or padding. Solve for both and take the smaller result:

  • Fit (letterbox or pillarbox): scale so the whole image is inside the box, then fill the leftover with background. Nothing is lost, but there are bars.
  • Fill (crop): scale so the image covers the box, then trim the overflow. No bars, but the edges are gone — which matters if a face or a logo lives near them.

Fitting video to a container

This is the letterbox calculation, and it is two uses of the same formula. Put a 16:9 video in a 1024×768 (4:3) frame: scale it to the full width, so 1024 × 9 ÷ 16 = 576. The video occupies 1024×576 and the frame is 768 tall, so 768 − 576 = 192 pixels are empty — 96 above and 96 below. Those are the horizontal black bars.

The reverse produces vertical bars. Put 4:3 content in a 1920×1080 frame: scale to the full height, so 1080 × 4 ÷ 3 = 1440. The content is 1440×1080 inside a 1920-wide frame, leaving 1920 − 1440 = 480 pixels — 240 down each side. That is pillarboxing, and it is why old 4:3 footage sits in a column on a widescreen TV.

The rule that falls out of this: if the source ratio is wider than the container you get bars top and bottom; if it is narrower you get bars left and right. Compare the two decimal ratios and the larger number is the wider shape. This is exactly what CSS object-fit: contain does, and object-fit: cover is the crop version.

Choosing export sizes

Rather than memorising a table of platform pixel sizes that changes without notice, work from the ratio the placement wants and then pick a pixel size on that ratio that is large enough. Full-screen vertical placements are 9:16 territory, feed images are commonly square or 4:5, and anything that plays as normal landscape video is 16:9. Once you know the ratio, the calculator gives you every size on it: at 9:16, a height of 1920 gives 1920 × 9 ÷ 16 = 1080, so 1080×1920. At the same ratio a height of 1280 gives 720×1280.

Two practical cautions. Exporting larger than the placement displays and letting the platform downscale usually looks better than exporting small and letting it upscale, because upscaling invents pixels that were never captured. And a size that is on the right ratio but tiny will still look soft — the ratio controls the shape, never the sharpness.

Failure modes and honest answers

  • The result is not a whole number. Expected, and common on 21:9 and 2.39:1. Round to the nearest whole pixel, or to the nearest even number for video.
  • The reduced ratio is not the one on the box. Also expected. 1366×768 is 683:384 and 3440×1440 is 43:18. The calculator reports the geometry; the box reports the marketing.
  • A field goes blank. Clearing one pixel field clears the other, and a ratio of zero or a non-number is rejected with a message rather than producing a nonsense answer. Divide-by-zero is guarded, not computed.
  • Aspect ratio does not mean pixel dimensions. 1280×720 and 3840×2160 are both 16:9 and will both fit the same frame without distortion; only one of them is 4K.
  • Non-square pixels. Some legacy broadcast formats store non-square pixels, where the stored pixel count and the displayed shape genuinely differ. This calculator works on pixel counts and assumes square pixels, which is correct for essentially everything on the web.

Both cards have a copy button — one copies the solved size, the other copies the reduced ratio — so the answer goes straight into your export dialog or your CSS without being retyped.

Frequently Asked Questions

How do I find the height for a given width at 16:9?+

Select the 16:9 preset (or enter 16 and 9 as the ratio), then type your width in pixels. The height is calculated automatically using height = width x 9 / 16. For example, 1280 px wide gives 720 px tall.

How do I work out the aspect ratio of an image?+

Use the reducer card: enter the image's pixel width and height and the tool divides both by their greatest common divisor to give the simplest ratio. For instance, 1920x1080 reduces to 16:9 and 1024x768 reduces to 4:3.

What are the most common aspect ratios?+

16:9 is standard for HD video and most screens, 4:3 is used by older displays and classic photos, 1:1 is square (common on social media), 9:16 is vertical video for stories and Reels, and 21:9 is ultrawide cinematic.

Why does keeping the aspect ratio matter when resizing?+

If you scale width and height by different amounts, the image stretches or squashes and looks distorted. Calculating the matching dimension keeps the proportions identical so the result looks correct.

This tool is provided for informational and educational purposes only. All processing happens in your browser — no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results.
Aspect Ratio Calculator - Width & Height | InventiveHQ