Aspect ratio calculator
Reduce a resolution to its ratio, or find the missing side.
Fill in the fields and the result will appear here automatically.
Divides width and height by their greatest common divisor to give the exact ratio, and works the other way too: give a ratio and one side and the other follows. The nearest common ratio is shown alongside, because an exact reduction and the number printed on the box are not always the same thing.
How it works
Formula and logic
Integer width W and height H are divided by gcd(W,H). With known width S and ratio a:b, height is S·b/a; with known height, width is S·a/b. Pixel dimensions must be positive safe integers; ratio parts may be positive fractions. The missing dimension is rounded to one pixel and its unrounded value is shown separately. The nearest format is selected only from the six listed presets.
Example
1920 and 1080 share a divisor of 120, which reduces the pair to 16:9.
Fields and units
- What to calculate — list option
- Width — px
- Height — px
- Ratio width — 1
- Ratio height — 1
- Known side — list option
- Known side value — px
How to use
- — Choose whether you have a resolution or a ratio.
- — Enter the known values.
- — Read the exact ratio or the missing side.
Method and limitations
- Calculation method
- Formula and logic
- Limitation
- Pixel-grid geometry excludes pixel aspect ratio, cropping and codec constraints. A rounded result below one pixel or beyond the safe integer range is rejected.
FAQ
Why does 2560×1080 give 64:27?
That is the exact reduction by the greatest common divisor. The familiar 21:9 is a marketing round number, shown here as the nearest common ratio.
What if the missing side is not a whole number?
The rounded pixel value is shown as the answer and the exact figure appears beside it, so you can see how far the rounding went.
Are non-square pixels supported?
The calculation assumes square pixels. With non-square pixels, the ratio of pixel counts differs from the displayed image ratio and requires a separate pixel-aspect-ratio correction.
Can I use it for images rather than screens?
Yes, the arithmetic is the same for any pair of pixel dimensions.