5 min read
2026-02-04
A tool that calculates the greatest common divisor (GCD) and least common multiple (LCM) for two or more numbers.
GCD — the largest number that divides all given numbers without a remainder
LCM — the smallest number that is divisible by all given numbers without a remainder
**Euclidean Algorithm** for GCD:
Divide the larger number by the smaller
If the remainder is zero — the smaller number is the GCD
Otherwise, replace the larger number with the smaller, and the smaller with the remainder
Repeat until the remainder equals zero
**GCD and LCM Relationship:**
LCM(a, b) = (a × b) / GCD(a, b)
Enter two or more numbers separated by commas
Click "Calculate"
Get the GCD and LCM with a step-by-step solution
| Numbers | GCD | LCM |
|---|---|---|
| 12 and 18 | 6 | 36 |
| 24 and 36 | 12 | 72 |
| 15, 25, and 35 | 5 | 525 |
The calculator also shows the prime factorization of each number, which helps understand the nature of the GCD and LCM.
See also: Fraction Calculator, Prime Number Checker, Factorials and Combinatorics