🔗

GCD & LCM Calculator

Find the Greatest Common Divisor and Least Common Multiple of two or more numbers with step-by-step working.

GCD (HCF)

6

Greatest Common Divisor

LCM

144

Least Common Multiple

Prime Factorization

48 = 2^4 × 3

18 = 2 × 3^2

LCM × GCD = 48 × 18 = 864

About the GCD & LCM Calculator

The Greatest Common Divisor (GCD) and Least Common Multiple (LCM) are foundational number theory concepts with surprisingly broad practical applications: simplifying fractions (use GCD), synchronizing repeating events (use LCM), and optimizing packaging or cutting problems (use GCD). The Euclidean algorithm finds GCD efficiently for any two numbers.

GCD and LCM

GCD(a,b): Euclidean algorithm - repeatedly replace (a,b) with (b, a mod b) until b=0 · LCM(a,b) = (a × b) / GCD(a,b)

GCD(48, 36): 48 mod 36 = 12, 36 mod 12 = 0 → GCD = 12 · LCM(48, 36) = (48×36)/12 = 144 · GCD = 1 means the numbers are coprime (no common factors)

Worked Example

Two buses leave a stop at the same time. Bus A every 15 min, Bus B every 20 min. When do they next leave together?

Bus A interval:15 minutes
Bus B interval:20 minutes

LCM(15, 20) = 60 minutes · Both buses next depart together after 60 minutes

Tips & Insights

  • 1

    GCD is used to reduce fractions to lowest terms - divide both numerator and denominator by GCD(numerator, denominator).

  • 2

    LCM is used to find the common denominator when adding or subtracting fractions.

  • 3

    In manufacturing, LCM determines when two production cycles next coincide - useful for maintenance scheduling.

Why this matters for you

GCD and LCM solve real scheduling, packing, and synchronization problems. Beyond textbook exercises, they appear in computer science (memory alignment), music theory (rhythmic patterns), and event planning (when multiple recurring events next coincide). The Euclidean algorithm for GCD is one of the oldest algorithms in mathematics and still runs efficiently on modern computers.

Related Calculators

Frequently Asked Questions