About This Tool
Aspect Ratio Calculator offers Calculate Ratio and Calculate Missing Dimension modes. The first simplifies width and height to their lowest terms. The second finds the missing dimension while preserving the ratio and displays a readable decimal result.
How to Use
- Choose Calculate Ratio or Calculate Missing Dimension.
- To calculate a ratio, enter width and height as positive safe integers.
- To find a missing dimension, enter a positive-integer ratio and a known width or height. The known dimension can be a positive decimal.
- Check the ratio, calculated dimensions, and preview, then copy the result.
Examples
- 1920:1080 has a GCD of 120 and simplifies to 16:9, with a decimal ratio of about 1.7778.
- 1024:768 → 4:3; 1080:1920 → 9:16.
- Ratio 16:9 with a known width of 1920 → height 1080.
How the Calculation Works
The Euclidean algorithm finds the greatest common divisor (GCD) of integer width and height, then divides both by it. Simplification accepts only positive safe integers to avoid precision ambiguity from decimals or excessively large integers. For a W:H ratio, height = width × H / W and width = height × W / H. The known dimension may be a positive decimal; output uses up to 6 decimal places. Input and output use the same dimension unit.
Common Uses
- Check aspect ratios for images, videos, and canvases.
- Resize assets while keeping a fixed ratio.
- Check dimensions before setting CSS aspect-ratio.
Privacy
All input processing, calculations, CSS generation, and previews run in your browser. Your content is never uploaded. No backend, database, online API, or third-party CDN is used, and your input is not saved automatically.
FAQ
What is the aspect ratio of 1920×1080?
16:9. The greatest common divisor of 1920 and 1080 is 120. Divide both values by 120.
Why is 1080×1920 a 9:16 ratio?
Aspect ratios use width:height order. Swapping width and height swaps the ratio, indicating portrait orientation.
How do I calculate height for 16:9?
Use height = width × 9 / 16. For example, a width of 1920 gives a height of 1080.
Can dimensions be 0 or decimals?
Zero and negative values are invalid. Simplifying a ratio requires positive safe-integer width and height. When finding a missing dimension, the known dimension can be a positive decimal, but both ratio values must remain positive integers.