Aspect Ratio & Resolution Calculator

Enter a width and height in pixels to get the aspect ratio and megapixel count, and resize to a new dimension without distortion.

What an aspect ratio actually tells you

An aspect ratio describes shape, not size. It is the relationship between the width and the height of a rectangle, written as two whole numbers with a colon between them. A screen that is 1920 pixels wide and 1080 pixels tall is 16:9, and so is a screen that is 1280 by 720 or 3840 by 2160. All three have the same proportions; they simply contain different numbers of pixels. This calculator takes your width and height, reduces them to the simplest whole-number ratio, and reports the total pixel count, the megapixel figure, the plain decimal value of width divided by height, and the standard ratio your image or screen sits closest to. If you also enter a new width or a new height, it works out the matching other side so the picture keeps its shape.

People reach for this kind of tool in everyday situations: fitting a video into a slide deck, choosing the height of a banner once the width is fixed by a page layout, checking whether a photo will survive being cropped for a social feed, or working out what a monitor listing really means when it says "ultrawide". Doing the arithmetic by hand is easy once, but it becomes tedious and error-prone when you repeat it across dozens of assets, and a single pixel of rounding error can show up as a thin stripe on screen.

How the ratio is reduced: the greatest common divisor

To reduce a ratio, divide both numbers by their greatest common divisor (GCD), the largest whole number that divides both of them without a remainder. For 1920 and 1080 the GCD is 120, so 1920 ÷ 120 = 16 and 1080 ÷ 120 = 9, giving 16:9. The calculator finds the GCD with Euclid's algorithm: repeatedly replace the pair (a, b) with (b, a mod b) until the second number reaches zero, and the first number is the answer. It is fast even for very large inputs, and it is exact because it only uses whole-number arithmetic.

The reduced pair is the true ratio of your numbers, which is not always one of the tidy names people use. If you enter 1366 by 768, the GCD is 2 and the result is 683:384. That is not a mistake; 1366×768 is a practical approximation of 16:9 that manufacturers settled on for laptop panels. Its decimal value is about 1.7786, while 16:9 is about 1.7778. The "closest standard ratio" chip shows how far the input is from the nearest familiar shape, as a percentage, so you can judge whether the difference matters for your purpose.

Keeping the shape when you resize

If the original size is W×H and you choose a new width W′, the new height is H′ = W′ × H ÷ W. If you choose a new height H′ instead, the new width is W′ = H′ × W ÷ H. Both formulas say the same thing: the ratio of the sides must not change, so the same scale factor applies to both. Scaling 1920×1080 down to a width of 1280 gives a height of 1280 × 1080 ÷ 1920 = 720 exactly.

When the division does not come out even, the result has to be rounded to a whole pixel because images cannot have fractional pixels. The tool shows both the exact figure and the rounded one. Rounding changes the ratio very slightly, by less than one pixel in the rounded dimension, which is invisible in almost every situation. If you are building something where the shape must be exact, such as a tile that repeats, choose a new width that is a multiple of the reduced ratio's first number, so the height lands on a whole number. For 16:9 that means widths that are multiples of 16.

If you enter both a new width and a new height, the width takes priority and the height is derived from it. Leave the width empty and enter only a height to get the width instead.

Common resolutions compared

Every value in this table is calculated when the page is built, using the same formulas as the tool above. Where the whole-number ratio looks awkward, read it as a variation of the nearest standard shape.

FormatResolutionReduced ratioWidth ÷ heightMegapixels
HD (720p)1280×72016:91.77780.92
Full HD (1080p)1920×108016:91.77782.07
QHD (1440p)2560×144016:91.77783.69
UHD 4K3840×216016:91.77788.29
XGA1024×7684:31.33330.79
SXGA1280×10245:41.25001.31
Laptop 1366×7681366×768683:3841.77861.05
Ultrawide WQHD3440×144043:182.38894.95
Ultrawide UWFHD2560×108064:272.37042.76
Square social post1080×10801:11.00001.17
Vertical short-form video1080×19209:160.56252.07
4:5 portrait feed1080×13504:50.80001.46

Note that 3440×1440 is sold as "21:9" but its true reduced ratio is 43:18, about 2.39:1, and 2560×1080 reduces to 64:27. The 21:9 label is a marketing shorthand for "roughly the shape of a cinema frame". Also notice how little the megapixel figure for video resolutions has to do with photography: a 4K frame is about 8.29 MP, which is less than many phone cameras capture in a single still.

Height for a given width, by ratio

This second table answers the question designers ask most often: the width is fixed, so how tall should the box be? Values with a decimal part must be rounded in real work.

RatioHeight at 640px wideHeight at 1280px wideHeight at 1920px wide
16:9360px720px1080px
4:3480px960px1440px
1:1640px1280px1920px
9:161137.8px2275.6px3413.3px
21:9274.3px548.6px822.9px
3:2426.7px853.3px1280px

Familiar ratios and where they come from

Worked examples with checked numbers

Example 1: a phone photo. A photo of 4032×3024 pixels has a GCD of 1008, so the ratio is 4:3. The total is 12,192,768 pixels, or about 12.19 MP. To crop it to 16:9 at full width, the height must be 4032 × 9 ÷ 16 = 2268, so 3024 − 2268 = 756 pixels have to be removed from the top and bottom. Cropping a 4:3 photo to a widescreen shape therefore discards a quarter of its area.

Example 2: shrinking a video. Scaling 1920×1080 to a width of 1280 gives a height of 1280 × 1080 ÷ 1920 = 720. The new frame has 921,600 pixels against 2,073,600 originally, which is about 44.4%. Two thirds of each side is four ninths of the area, which is why a modest-looking reduction in dimensions cuts the amount of detail, and often the file size, by more than half.

Example 3: square to portrait. To turn a 1080×1080 image into 4:5 while keeping the full height, you would need a width of 1080 × 4 ÷ 5 = 864, so the image is cropped to 864×1080 and 216 pixels are removed from the sides. If you want to keep the full 1080 width instead, the height would need to be 1080 × 5 ÷ 4 = 1350, which a square source cannot provide without adding new pixels, for example a background extension or padding.

Common mistakes and limits

Putting the result to use

Start by comparing your ratio with what the destination requires. If it matches, you only need to scale. If it does not, decide what to give up: crop edges, add bars, or extend the background. On the web, setting both the width and height attributes on an image, or giving a container the CSS aspect-ratio property with the reduced values, reserves space before the file loads and reduces the layout shift that makes pages jump. For print work, the ratio is only half the story, since the pixel count also decides how large the image can be printed before it looks soft. The print resolution and PPI tools linked below cover that part. Always check the destination platform's current upload guidance, because recommended sizes change over time.

Frequently Asked Questions

What does megapixel mean?

A megapixel is one million pixels. It is the total pixel count of an image or screen divided by 1,000,000. A 1920×1080 frame has 2,073,600 pixels, so about 2.07 MP. It tells you how much detail the grid can hold, not how good the lens or sensor is.

Why does my ratio come out as something odd like 683:384?

Because the calculator reports the exact ratio of the numbers you typed. Resolutions such as 1366×768 are close to 16:9 but are not exact multiples of 16 and 9, so the reduced fraction is awkward. The "closest standard ratio" chip shows the familiar shape and how far off you are.

How do I fit 16:9 video onto a 4:3 screen?

There are two options. Letterboxing keeps the whole frame and adds bars above and below. Cropping fills the screen but cuts the sides. Cropping 1920×1080 to a 4:3 shape at full height leaves 1440 pixels of width, so 480 pixels are lost.

What happens if I fill in both a new width and a new height?

The new width is used and the height is calculated from it. To work from a height instead, clear the new width field. If you need both to be fixed, first check that they have the same ratio as the original, otherwise the image will be distorted.

Which ratio should I use for uploading video?

Standard landscape video is 16:9 and vertical short-form video is 9:16. Other shapes usually play with bars. Platforms update their recommendations from time to time, so confirm the current specification in their help pages before you export.

Related tools