← 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

Using the Greatest Common Divisor Tool

  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.

GCD & LCM Calculator is an essential utility for mathematicians and developers working with number theory. The Greatest Common Divisor (GCD), also known as the Highest Common Factor (HCF), 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 all inputs. These concepts are fundamental in fraction reduction, cryptography (RSA key generation), and scheduling algorithms.

Common Divisors and Multiples: Euclidean Algorithm

The relationship between GCD and LCM is: GCD(a,b) × LCM(a,b) = a × b. This HCF calculator uses the Euclidean algorithm: GCD(a,b) = GCD(b, a mod b), terminating when the remainder is 0. This is one of the oldest known mathematical algorithms. For more than two numbers, our tool applies the logic pairwise to find the common divisor and smallest multiple for the entire set.

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.

Check out our other math tools alongside this GCD & LCM Calculator, like the Fraction Calculator, Factorial Calculator, and Average Calculator. This HCF calculator is designed for precision and speed in your browser.