Formula
g = gcd(W, H) · ratio = W/g : H/g
Scale decimals to integers when necessary, compute the greatest common divisor, then divide both dimensions by it.
Turn width and height into a reduced, unitless aspect ratio. Integer dimensions use an exact greatest common divisor; decimals are rationalized to a controlled nine-place scale before simplification.
g = gcd(W, H) · ratio = W/g : H/g
Scale decimals to integers when necessary, compute the greatest common divisor, then divide both dimensions by it.
The ratio is unitless as long as width and height use the same unit.
Formula v1.0.0
Reviewed 2026-08-03
CalcFlow engineering review
gcd(1920, 1080) = 120. Dividing both values by 120 gives 16:9, with a decimal quotient of 1.777778.
For every 16 equal width units there are 9 equal height units. It does not prescribe a pixel resolution.
Yes, when both dimensions use the same unit. The resulting ratio is unitless.
The exact quotient is close to a recognized common ratio but is not mathematically identical.