About this calculator
The aspect ratio is the shape of a screen, photo or video: width compared with height. This calculator reduces any width and height to the simplest whole-number ratio, names the nearest common ratio, works out the new size when you resize without stretching, and finds the largest area you can crop to a different ratio.
Formula
Find the ratio
Ratio = (W ÷ g) : (H ÷ g), where g = greatest common divisor of W and H
Decimal values are first scaled to whole numbers (up to 4 decimal places). Marketing names are often approximate: “21:9” monitors are usually 64:27 (2560 × 1080) or 43:18 (3440 × 1440).
Resize keeping the ratio
New height = new width × H ÷ W New width = new height × W ÷ H
The result is rounded to the nearest whole pixel, so the ratio may change very slightly.
Crop to a new ratio
If W/H > target: keep H, width = H × target. Otherwise keep W, height = W ÷ target.
Results are rounded down to whole pixels so the crop fits inside the original.
Worked example
- 1920 × 1080: gcd = 120 → 16 : 9 (1.778 : 1), 2.07 MP.
- 1280 × 1024: gcd = 256 → 5 : 4.
- Resizing 1920 × 1080 to a width of 1280: height = 1280 × 1080 ÷ 1920 = 720.
- Cropping 1920 × 1080 to 4 : 3: keep height 1080, width = 1080 × 4/3 = 1440; 75% of the picture is kept.
Assumptions and limitations
- Assumes square pixels.
- Resizing changes only the number of pixels. Making an image larger does not add detail that was not captured; making it smaller discards detail.
References
- Greatest common divisor (Euclid’s algorithm) and proportional scaling.
