← All tools
// Number / Math

GCD & LCM Calculator online

Calculate the Greatest Common Divisor and Least Common Multiple of multiple numbers

GCD & LCM Calculator logo
by
CHUNKY
MUNSTER
Separate numbers with commas, spaces, or newlines

How to Use gcd-lcm

  1. Enter two or more integers separated by commas.
  2. The Greatest Common Divisor (GCD) and Least Common Multiple (LCM) are calculated instantly.
  3. See the prime factorisation of each number and how GCD and LCM are derived.
  4. The step-by-step Euclidean algorithm is shown for GCD.

The Greatest Common Divisor (GCD) of two numbers is the largest integer that divides both without a remainder. The Least Common Multiple (LCM) is the smallest positive integer divisible by both. These are fundamental in fraction reduction, cryptography (RSA key generation uses GCD), scheduling problems, and signal processing.

GCD and LCM: Relationship and Algorithms

The relationship between GCD and LCM is: GCD(a,b) × LCM(a,b) = a × b. This means once you have one, computing the other is trivial. GCD is computed using the Euclidean algorithm: GCD(a,b) = GCD(b, a mod b), terminating when the remainder is 0. This is one of the oldest known algorithms — attributed to Euclid around 300 BC. LCM(a,b) = a × b / GCD(a,b). For more than two numbers, apply pairwise repeatedly.

Frequently Asked Questions

How is GCD used in fraction reduction?

To reduce 12/18 to lowest terms, compute GCD(12,18) = 6, then divide both by 6: 12/6 = 2, 18/6 = 3. Result: 2/3. GCD-based reduction always gives the fully reduced fraction in one step.

What is the Euclidean algorithm?

GCD(a,b): divide a by b, get remainder r. Then GCD(b,r). Repeat until remainder is 0; the last non-zero remainder is the GCD. Example: GCD(48,18) → GCD(18,12) → GCD(12,6) → GCD(6,0) = 6.

What does GCD = 1 mean?

Two numbers with GCD = 1 are coprime (or relatively prime) — they share no common factors other than 1. This is important in RSA cryptography, Chinese Remainder Theorem applications, and fraction representation.

Can I find the LCM of more than two numbers?

Yes — apply LCM pairwise: LCM(a,b,c) = LCM(LCM(a,b),c). The tool handles this automatically for up to 10 inputs.

See also the Fraction Calculator, Factorial Calculator, and the Average Calculator.