How to use the aspect ratio calculator
- To identify a ratio, enter a width and height in the first two boxes, such as 1920 and 1080. The result reduces it to whole numbers (16:9) and, if it is near a common format, names that format too.
- To resize, tap a ratio chip or type your own ratio, then enter the new width or new height. The panel shows the other dimension.
- To fit one size inside another, leave your original size in the first two boxes and enter the frame as the new width and height. The “fitted” line gives the largest size that fits without cropping or stretching.
Any units work: pixels, inches or centimeters. The ratio doesn’t care, as long as width and height are in the same unit.
The math behind aspect ratios
An aspect ratio is width compared with height. The CSS specification, as documented on MDN, writes it as width / height, so 16 / 9 is a box 16 units wide for every 9 units tall. To reduce a size to its ratio, divide both numbers by their greatest common factor:
new height = new width × ratio height ÷ ratio width
new width = new height × ratio width ÷ ratio height
So a 16:9 video 1280 pixels wide is 1280 × 9 ÷ 16 = 720 pixels tall, and a 4:3 image 600 pixels tall is 600 × 4 ÷ 3 = 800 pixels wide.
The decimal form, width ÷ height, is handy for comparing: 16:9 is 1.78, 4:3 is 1.33, 3:2 is 1.5, and 1:1 is 1.0. A larger number means a wider shape.
Common aspect ratios
- 16:9 is the widescreen standard for TVs, laptops and online video. YouTube’s help center lists 16:9 resolutions from 426 × 240 to 7680 × 4320, including 1280 × 720, 1920 × 1080 and 3840 × 2160.
- 9:16 is the same shape turned on its side, the vertical format used for phone-first video such as Shorts, Reels and Stories: 1080 × 1920.
- 4:3 is the older TV and computer monitor shape, and the default for many phone and compact cameras: 4000 × 3000 is a 12-megapixel 4:3 photo.
- 3:2 is the classic 35 mm film shape, still used by many interchangeable-lens cameras and for 6 × 4 inch prints.
- 1:1 is square, and 4:5 is a portrait shape (1080 × 1350) that takes up more of a phone screen than a square in a social feed.
- 16:10, also written 8:5, is common on laptops: 1440 × 900 and 1920 × 1200.
- “21:9” ultrawide monitors are a marketing round-off. 2560 × 1080 is really 64:27 (2.37), and 3440 × 1440 is 43:18 (2.39).
When a size is almost, but not quite, a ratio
Several familiar resolutions don’t reduce to the ratio they are sold as, because pixel counts must be whole numbers and some hardware likes multiples of 8 or 16.
854 × 480 is the 480p size on YouTube’s list. Exact 16:9 at a height of 480 would be 853.33 pixels wide, which can’t exist, so it is rounded to 854. Reduced, 854 × 480 is 427:240. Likewise 1366 × 768, a very common laptop panel, reduces to 683:384, which is 1.7786 instead of 16:9’s 1.7778.
The calculator shows the true reduced ratio first, then notes the nearby common format when the shape is within 2% of it. If you see an odd ratio such as 427:240, that note tells you what the size was meant to be.
When you resize, round to whole pixels. Many video encoders also need even widths and heights, so 853.33 would become 854, not 853.
Fitting into a different shape: letterbox or crop
When the source and the frame have different ratios, you have two choices.
Fit (letterbox or pillarbox). Scale the image down until it fits entirely, leaving bars on two sides. A 1920 × 1080 video in a 1080 × 1080 square scales by 1080 ÷ 1920 = 56.25% to 1080 × 607.5, leaving (1080 − 607.5) ÷ 2 = 236.25 pixels of space above and below. This is what the “fitted” result calculates. In CSS, it matches object-fit: contain.
Fill (crop). Scale the image up until it covers the whole frame, then cut off the overflow. Filling that square means scaling the height to 1080 and cropping the width from 1920 to 1080, losing 840 pixels, or 44% of the picture. In CSS, this is object-fit: cover. Before cropping, make sure nothing important sits near the edges.
YouTube’s help page notes that the player adjusts to the video’s own aspect ratio and the viewer’s screen, and advises against adding black bars to the file yourself. Export at the shape you intend people to see.
Pixels, megapixels and print size
The pixel line multiplies width by height. 1920 × 1080 is 2,073,600 pixels, about 2.1 megapixels; 3840 × 2160 is four times as many, about 8.3 megapixels. Doubling both dimensions quadruples the pixel count while keeping the same ratio.
For prints, the ratio of the paper matters as much as the resolution. An 8 × 10 inch print is 4:5, so a 3:2 photo loses part of its long side to fit. The resize section answers how much: a 6000-pixel-wide 3:2 image is 4000 pixels tall, and at 4:5 that height only supports a width of 3200, so 2800 pixels of width are cropped.
Aspect ratio in CSS and web layouts
For web pages, the CSS aspect-ratio property keeps a box’s shape as its width changes. As MDN documents, the value is width / height, so aspect-ratio: 16 / 9 on an element that is 100% wide makes its height follow at 9/16 of the width. A single number also works: aspect-ratio: 1.5 is the same as 3 / 2. This is the modern replacement for the old padding-top: 56.25% trick, where 56.25% is simply 9 ÷ 16 written as a percentage.
Showing old 4:3 video on a 16:9 screen
A 4:3 video shown full height on a 1920 × 1080 screen is 1080 × 4 ÷ 3 = 1440 pixels wide. That leaves (1920 − 1440) ÷ 2 = 240 pixels of black on each side, called pillarboxing. Stretching it to fill the width would make everything look 33% wider than it should, which is why most players and editors keep the original ratio by default.
Screen size from the diagonal
Screens are sold by their diagonal, but the ratio sets the actual width and height. For a 16:9 screen, the diagonal of the 16-by-9 triangle is √(16² + 9²) = 18.36, so a 55-inch screen is 55 × 16 ÷ 18.36 = 47.9 inches wide and 55 × 9 ÷ 18.36 = 27.0 inches tall. A 4:3 screen of the same diagonal is narrower and taller: 44 by 33 inches.
Sources & assumptions
How this calculator gets its numbers. Full method: our methodology.
- Aspect ratio is width : height reduced by the greatest common factor.
- A size is labeled with a common format (16:9, 4:3, 21:9 and others) when its shape is within 2% of it.
- Resizing keeps the ratio: height = width × ratio height ÷ ratio width.
- “Fit” scales the whole image to fit inside the frame without cropping (letterboxing).
Sources
- MDN Web Docs (Mozilla), aspect-ratio (CSS property). An aspect ratio is the ratio of width / height (for example 16 / 9); if the height is omitted it defaults to 1.
- YouTube Help, Video resolution & aspect ratios. 16:9 is YouTube’s standard aspect ratio on computers, with recommended resolutions from 426 × 240 to 7680 × 4320; the player adapts to other ratios and creators are advised not to add bars or padding themselves.
Last reviewed . Round pixel results to whole numbers; check each platform’s current upload guidelines before exporting.
Frequently asked questions
How do you calculate aspect ratio?
Divide the width and height by their greatest common factor. 1920 × 1080 has a GCF of 120, so the aspect ratio is 16:9.
What is the height of a 16:9 image that is 1280 pixels wide?
Multiply the width by 9 and divide by 16: 1280 × 9 ÷ 16 = 720 pixels.
What resolution is 16:9?
Any size where width ÷ height is about 1.78. Common ones are 1280 × 720, 1920 × 1080, 2560 × 1440 and 3840 × 2160.
Is 1366 × 768 a 16:9 resolution?
Almost. It reduces to 683:384, a ratio of 1.7786, while 16:9 is 1.7778. It is sold and treated as 16:9.
What aspect ratio is 1080 × 1350?
It is 4:5, a portrait shape, since both numbers divide by 270 to give 4 and 5.
How do I resize an image without distorting it?
Change one dimension and calculate the other from the aspect ratio, or use a tool that locks the ratio. Stretching only one dimension changes the shape and distorts the image.