LCM & GCD Calculator
Calculate the Least Common Multiple (LCM) and Greatest Common Divisor (GCD) for two or more numbers.
LCM & GCD Results
Greatest Common Divisor (GCD) — the largest number that divides all given numbers evenly.
Least Common Multiple (LCM) — the smallest positive number that is a multiple of all given numbers.
Formulas:
- GCD is found using the Euclidean algorithm:
GCD(a, b) = GCD(b, a mod b)until remainder is 0 LCM(a, b) = |a × b| / GCD(a, b)
For multiple numbers:
GCD(a, b, c) = GCD(GCD(a, b), c)LCM(a, b, c) = LCM(LCM(a, b), c)
Example: For 12 and 18:
- GCD(12, 18) = 6
- LCM(12, 18) = (12 × 18) / 6 = 36