Ratio Calculator
Simplify any whole-number ratio a:b using the greatest common divisor, then scale it up or down by a factor.
Enter two whole numbers and an optional scaling factor. The simplified form and scaled form update instantly.
How is this calculated?
GCD found by Euclidean algorithm. Simplified ratio = (A / GCD) : (B / GCD). Scaled ratio multiplies both terms by the scale factor.
About the Ratio Calculator
A ratio expresses the relative size of two quantities as a:b. This calculator simplifies any whole-number ratio by dividing both terms by the greatest common divisor, then scales the result up or down by any factor you choose. It also returns the decimal value of a divided by b and the percentage share of a in the total.
Ratios are scale invariant, so 12:18, 2:3, and 200:300 all describe the same proportion. The canonical form is the simplified ratio where the GCD is 1. The Euclidean algorithm finds that GCD in fewer than 5 log base 2 of the smaller term iterations, which is why every modern computer algebra system uses it.
How the formula works
Simplified: (a, b) -> (a / GCD(a, b)) : (b / GCD(a, b))
GCD via Euclidean algorithm:
while b != 0:
(a, b) = (b, a mod b)
return a
Scaled: scale x simplified terms
Decimal: a / b
Share of a: a / (a + b)
- a, b = the two whole-number terms of the input ratio. Order matters: 2:3 and 3:2 are distinct.
- GCD(a, b) = the largest positive integer that divides both a and b. Found by the Euclidean algorithm in O(log min(a, b)) steps.
- Scale factor = any positive multiplier. Use it to rescale a recipe, blueprint, or odds line.
- Share of a = a divided by (a plus b), expressed as a percentage. Useful when the ratio describes parts of a whole.
Worked example: simplify and scale
A 4K video is 3840 by 2160 pixels. Find the simplified aspect ratio, then scale it to a small thumbnail.
- Inputs: a = 3840, b = 2160.
- Euclidean GCD: GCD(3840, 2160) = GCD(2160, 1680) = GCD(1680, 480) = GCD(480, 240) = GCD(240, 0) = 240.
- Simplified: 3840 divided by 240 is 16, 2160 divided by 240 is 9, so the ratio is 16:9.
- Decimal form: 16 divided by 9 is approximately 1.778, the canonical widescreen aspect.
- Scale to thumbnail: multiply by 20 to get 320:180 pixels, still 16:9.
Common ratios in the wild
| Where it appears | Ratio | Notes |
|---|---|---|
| HDTV, modern laptops | 16:9 | 1.778 widescreen, the dominant display ratio since 2010 |
| Cinema ultrawide monitor | 21:9 | 2.333, matches anamorphic cinema crops |
| Legacy TV and SD video | 4:3 | 1.333, pre-HDTV broadcast standard |
| DSLR full-frame sensor | 3:2 | 1.500, inherited from 35 mm film |
| Instagram square post | 1:1 | 1.000, used for grid feeds |
| Bicycle gear ratio (typical road) | 53:11 | 4.82 turns per pedal stroke at top gear |
| Two-stroke fuel-oil mix | 50:1 | 20 mL oil per 1 L petrol, modern outboards |
| Concrete mix (standard) | 1:2:3 | cement : sand : aggregate by volume, M20 grade |
| Cocktail (classic martini) | 6:1 | gin to dry vermouth, dry style |
| Coffee brew ratio | 1:16 | 1 g coffee to 16 g water, standard pour-over |
Common pitfalls
- Extraneous decimals. A ratio of 1.5:2.5 is awkward. Multiply both terms by 10 to get 15:25, then simplify by GCD 5 to get the canonical 3:5.
- Ratio versus fraction. 2:3 boys to girls does not mean 2 thirds boys. It means 2 parts boys and 3 parts girls, total 5 parts, so the fraction of boys is 2 divided by 5 or 40 percent.
- Order matters. 16:9 and 9:16 are different. 16:9 is landscape video; 9:16 is portrait video used by TikTok and Instagram Reels.
- Three-term ratios. 1:2:3 cannot be reduced two terms at a time. Find the GCD of all three terms at once, then divide each by it.
- Sign convention. Ratios are usually written with positive integers. Negative ratios appear in physics and finance but are uncommon enough to flag explicitly.
Related tools and glossary
Frequently asked questions
What is a ratio?
How do I simplify a ratio?
What is the difference between a ratio and a fraction?
What aspect ratios are most common in displays?
How do I scale a recipe using ratios?
Sources
- Knuth, Donald (1997). The Art of Computer Programming, Volume 2: Seminumerical Algorithms, 3rd edition, Section 4.5.2 (Euclidean algorithm).
- Rosen, Kenneth H. (2018). Discrete Mathematics and Its Applications, 8th edition, McGraw Hill, Section 4.3 (Primes and greatest common divisors).
- ITU-R BT.709 and BT.2020. Parameter values for the HDTV and UHDTV standards (aspect ratio specification).
- SMPTE (2015). Cinema and broadcast aspect-ratio reference.
