3tej home

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.

Simplified ratio-
GCD-
Decimal (A ÷ B)-
Percentage (A of total)-
Scaled ratio-
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.

  1. Inputs: a = 3840, b = 2160.
  2. Euclidean GCD: GCD(3840, 2160) = GCD(2160, 1680) = GCD(1680, 480) = GCD(480, 240) = GCD(240, 0) = 240.
  3. Simplified: 3840 divided by 240 is 16, 2160 divided by 240 is 9, so the ratio is 16:9.
  4. Decimal form: 16 divided by 9 is approximately 1.778, the canonical widescreen aspect.
  5. Scale to thumbnail: multiply by 20 to get 320:180 pixels, still 16:9.
Result: 3840:2160 simplifies to 16:9. The Euclidean algorithm took 4 division steps. Any multiple of 16:9 (320:180, 640:360, 1280:720, 1920:1080, 3840:2160) renders at the same aspect.

Common ratios in the wild

Where it appearsRatioNotes
HDTV, modern laptops16:91.778 widescreen, the dominant display ratio since 2010
Cinema ultrawide monitor21:92.333, matches anamorphic cinema crops
Legacy TV and SD video4:31.333, pre-HDTV broadcast standard
DSLR full-frame sensor3:21.500, inherited from 35 mm film
Instagram square post1:11.000, used for grid feeds
Bicycle gear ratio (typical road)53:114.82 turns per pedal stroke at top gear
Two-stroke fuel-oil mix50:120 mL oil per 1 L petrol, modern outboards
Concrete mix (standard)1:2:3cement : sand : aggregate by volume, M20 grade
Cocktail (classic martini)6:1gin to dry vermouth, dry style
Coffee brew ratio1:161 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?
A ratio expresses the relative size of two quantities, written a:b and read 'a to b'. A class of 12 boys and 18 girls has a 12:18 ratio that simplifies to 2:3. Ratios are scale invariant: 2:3, 4:6, and 10:15 all describe the same proportion.
How do I simplify a ratio?
Find the greatest common divisor of both terms using the Euclidean algorithm, then divide both terms by it. For 12:18 the GCD is 6, so 12 divided by 6 is 2 and 18 divided by 6 is 3, giving the simplified ratio 2:3. The calculator above runs the Euclidean algorithm and prints the GCD.
What is the difference between a ratio and a fraction?
A ratio a:b compares two parts to each other. A fraction a divided by b normally compares one part to a whole. A 2:3 ratio of boys to girls means the class is 2 parts boys, 3 parts girls, total 5 parts, so the fraction of boys is 2 divided by 5 or 40 percent, not 2 divided by 3.
What aspect ratios are most common in displays?
16:9 dominates HDTVs and most laptops since 2010. 21:9 is the cinema ultrawide spec used in modern monitors. 4:3 was the legacy standard before HDTV. 3:2 is common in DSLR sensors and several Surface and Chromebook tablets. 1:1 is square, used by Instagram early posts.
How do I scale a recipe using ratios?
Express the recipe as a ratio of dry to wet, or flour to sugar to butter, then multiply every term by the same scale factor. A pancake batter at flour:milk:egg = 200:300:1 (grams to count) scales to 400:600:2 for double batch. Round to whole eggs where the ingredient cannot be split.

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.

Last updated 2026-05-28.