CSS & Layout
Aspect Ratio Calculator
Turn any width and height into a simplified ratio, or use a ratio to find the missing dimension. The live preview and copied CSS update as you type. Everything runs in your browser — your input never leaves the page.
Your numbers
liveUnits are optional — an aspect ratio only depends on the relationship between the numbers.
Result
liveLive preview
LandscapeCommon ratios
tap to applyEach shape is drawn to scale, so you can compare proportions at a glance. Select one to load it into the calculator.
How it works
An aspect ratio compares width to height. This tool divides both numbers by their
greatest common divisor, so 1920×1080 becomes 16:9, and it can also
work backwards: give it a ratio and one dimension to get the other. The CSS output uses
the modern aspect-ratio property, which keeps an element proportional at
any size. Every calculation happens in your browser and is never sent anywhere.