What Is LCM?
The least common multiple (LCM) of two or more whole numbers is the smallest positive integer that is divisible by each of those numbers.
Example: the least common multiple of 12 and 18 is 36, because 36 is the smallest positive integer divisible by both 12 and 18.
LCM Formula
For two integers a and b:
LCM(a, b) = |a × b| / GCD(a, b)
In practice the calculator uses the overflow-safe form:
LCM(a, b) = |a / GCD(a, b) × b|
Dividing by the GCD before multiplying keeps intermediate values smaller and preserves exactness for large integers.
How to Find the LCM
One reliable method is prime factorization:
- Factor each number into primes.
- For every prime that appears, take the highest power required by any input.
- Multiply those highest powers together.
Example:
- 12 = 2² × 3
- 18 = 2 × 3²
Highest powers: 2² × 3² → LCM = 36.
LCM Using the GCD
For two numbers you can also use the relationship with the greatest common divisor:
GCD(12, 18) = 6
LCM = 12 ÷ 6 × 18 = 36
You can check: LCM × GCD = |a × b| → 36 × 6 = 216 = 12 × 18.
LCM of Three or More Numbers
Extend pairwise:
LCM(a, b, c) = LCM(LCM(a, b), c)
Example: 4, 6, 8
- LCM(4, 6) = 12
- LCM(12, 8) = 24
Therefore LCM(4, 6, 8) = 24.
LCM vs GCD
- LCM — the smallest positive common multiple of the numbers.
- GCD — the greatest positive integer that divides all of the numbers.
For 12 and 18: LCM = 36, GCD = 6.
LCM and Coprime Numbers
When two positive integers have GCD = 1 they are relatively prime (coprime). Their LCM equals their product.
Example: 8 and 15 → GCD = 1 → LCM = 120.
LCM of Negative Numbers
The conventional LCM is non-negative. Signs do not change the result.
LCM(−12, 18) = 36.
LCM With One
LCM(1, n) = n for any positive integer n.
Example: LCM(1, 15) = 15.
LCM With Zero
Under the arithmetic convention used by this calculator, LCM(0, n) = 0 for nonzero n. There is no positive common multiple of 0 and a nonzero integer under the strict “smallest positive common multiple” definition; the calculator reports 0 and explains the convention.
LCM(0, 0) is treated as undefined.
Common LCM Mistakes
- Confusing LCM with GCD — LCM finds a common multiple; GCD finds a common divisor.
- Assuming the LCM is one of the inputs — often it is larger than every input.
- Missing a prime power — every prime needed by any input must appear at its highest required exponent.
- Multiplying all numbers blindly — the product is always a common multiple for positive integers, but not always the least. Example: 6 × 8 = 48 while LCM(6, 8) = 24.
- Ignoring signs — the conventional LCM is positive regardless of input signs.