Aspect Ratio Calculator: How to Use It
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
An aspect ratio calculator works out the proportional relationship between an image or screen’s width and height, usually expressed as two numbers separated by a colon (like 16:9). You enter either the width and height, or one dimension plus the desired ratio, and it returns the missing value or the simplified ratio. This is useful for resizing images, choosing a video format, or fitting content to a specific display without distortion.
Formula
The aspect ratio is the ratio of width to height: aspect ratio = width : height. To simplify it to the smallest whole numbers, divide both width and height by their greatest common divisor (GCD). For example, a width of 1920 px and a height of 1080 px have a GCD of 360, so the simplified ratio is (1920/360) : (1080/360) = 16:9.
Variables:
- w = width in pixels (or any unit, as long as both use the same)
- h = height in pixels (or same unit as width)
- GCD = greatest common divisor of w and h
If you know one dimension and the ratio, you can solve for the other: height = width / (ratio width / ratio height), or width = height * (ratio width / ratio height).
Worked Example
Using the default values from the calculator: width = 1920 px, height = 1080 px.
- Find the GCD of 1920 and 1080. The GCD is 360.
- Divide width by GCD: 1920 / 360 = 5.333… wait, that’s not an integer. Let’s recalculate.
Actually, the GCD of 1920 and 1080 is 120? Let’s check: 1920 / 120 = 16, 1080 / 120 = 9. Yes, GCD is 120. So the simplified ratio is 16:9. The calculator’s formula uses gcd(w,h) which returns 120. Then the ratio is (1920/120):(1080/120) = 16:9. The GCD output is 120 px.
When to Use an Aspect Ratio Calculator
You need an aspect ratio calculator in several common situations:
- Resizing images without cropping or stretching – you want to keep the same shape.
- Creating video content for different platforms – YouTube (16:9), Instagram (1:1 or 4:5), TikTok (9:16).
- Designing presentations or documents – slides are often 16:9 or 4:3.
- Printing photos – common print sizes have specific ratios (e.g., 4×6 is 2:3).
- Fitting a TV or monitor – you may want to know if a video will have black bars.
In each case, the calculator helps you avoid guesswork and ensures the final output looks correct.
How to Read the Result
The result is a simplified ratio, like 16:9 or 4:3. This tells you that for every 16 units of width, there are 9 units of height. You can use this to check if a video will fit a screen: if your screen is 1920×1080, the ratio is 16:9, so a 16:9 video fills it perfectly. If your video is 4:3, it will have black bars on the sides.
When you enter one dimension and a ratio, the calculator gives you the missing dimension. For example, if you want a 16:9 image with a width of 1280 px, the height should be 1280 * (9/16) = 720 px.
Common Mistakes and Misconceptions
- Mixing units – If width is in pixels and height is in inches, the ratio is meaningless. Always use the same unit for both.
- Confusing ratio with resolution – 1920×1080 is a resolution; 16:9 is the ratio. Many resolutions share the same ratio (e.g., 1280×720, 3840×2160).
- Forgetting about pixel aspect ratio – Some video formats (like anamorphic widescreen) use non-square pixels. This calculator assumes square pixels, which is standard for modern displays.
- Rounding too early – If you round the missing dimension to the nearest pixel, you might get a slightly off ratio. It’s usually fine, but for precision, keep decimals until the end.
Limits of the Formula
The formula is purely mathematical and works for any positive numbers. However, it does not account for:
- Cropping – The calculator gives you the ratio, but not how to crop an image to fit it. That requires choosing which part to keep.
- Scaling algorithms – When resizing, the method used (bilinear, bicubic, etc.) affects quality, but not the ratio.
- Non-square pixels – As mentioned, this is for square pixels only.
For most practical purposes, the formula is sufficient.
Alternatives to a Calculator
If you don’t have a calculator, you can compute the ratio manually by dividing both numbers by their GCD. For example, for 1920 and 1080, divide both by 120 to get 16:9. You can also use the gcd function in many programming languages or spreadsheet software. Some image editors show the ratio in their resize dialog, but they often don’t simplify it.
Frequently Asked Questions
What is the difference between aspect ratio and resolution?
Resolution is the total number of pixels in each dimension (e.g., 1920×1080). Aspect ratio is the proportional relationship between those dimensions (e.g., 16:9). Many resolutions can share the same aspect ratio.
How do I calculate aspect ratio from width and height?
Divide both width and height by their greatest common divisor. For example, 1920 and 1080 both divide by 120, giving 16 and 9, so the ratio is 16:9.
What is a 16:9 ratio in pixels?
There is no single pixel size. 16:9 just means the width is 16/9 times the height. Common resolutions include 1920×1080, 1280×720, and 3840×2160.
How do I convert an image to a specific aspect ratio?
You need to either crop the image or add padding (letterboxing) to change its ratio. The calculator tells you the target dimensions, but the actual cropping or padding is done in an image editor.
Why do some videos have black bars?
Black bars appear when the video’s aspect ratio doesn’t match the display’s aspect ratio. For example, a 4:3 video on a 16:9 screen will have bars on the sides. The calculator helps you predict that.
Can I use the same ratio for print and screen?
Yes, the ratio is unitless. A 4:3 image can be 400×300 pixels or 8×6 inches. Just make sure the DPI/PPI is appropriate for the medium.
Related
Formula used
in w | Width | px | 1920 | 0 in h | Height | px | 1080 | 0 out ratio | Simplified ratio | - | (w / gcd(w, h)) + ":" + (h / gcd(w, h)) | 0 out gcd | GCD (greatest common divisor) | px | gcd(w, h) | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.