Core identity (two numbers)
LCM(a, b) = |a × b| / GCD(a, b)
This is exact for all integers a, b ≠0. Our LCM calculator uses this under the hood after computing GCD with the Euclidean algorithm.
Prime-power formula

Write each integer in canonical form:
a = p1α1 · p2α2 · … and b = p1β1 · p2β2 · …
Then:
LCM(a,b) = p1max(α1,β1) · p2max(α2,β2) · …GCD(a,b) = p1min(α1,β1) · p2min(α2,β2) · …Three or more numbers
LCM is associative:
LCM(a, b, c) = LCM( LCM(a, b), c )Same for GCD. That is why the calculator can accept up to six inputs without a special formula.
Useful properties
| Property | Meaning |
|---|---|
| LCM(a, a) = |a| | A number with itself |
| LCM(a, 1) = |a| | 1 divides everything |
| LCM(a, 0) = 0 | By convention in many texts; we reject 0 in the tool |
| If a divides b | Then LCM(a,b) = |b| |
| Coprime pair | GCD=1 ⇒ LCM = |a×b| |
