The least common multiple (LCM), also called the lowest common multiple, of a set of positive integers is the smallest positive integer that every member of the set divides into without a remainder. It is one of the most-used concepts in arithmetic: you need it every time you add or subtract fractions with different denominators, and it reappears in scheduling, music theory, gear-ratio analysis, and any other context where two or more repeating cycles must be synchronised.
This calculator accepts two or more positive whole numbers, computes the LCM instantly, and then walks you through three levels of explanation: a prime-factor table showing which exponent each prime contributes, a step-by-step pairwise fold so you can follow the chain of GCD divisions, and a visual cycle diagram (for two-number inputs up to 1,000) that draws tick marks where each number’s multiples fall and highlights the first position where both sequences land at the same time.
How it works
The core formula is:
LCM(a, b) = (a / GCD(a, b)) x b
Dividing by the GCD before multiplying keeps the intermediate result as small as possible, which matters for large inputs. For three or more numbers the calculator chains this left to right, because LCM(a, b, c) = LCM(LCM(a, b), c), and so on. The GCD at each step is found via the Euclidean algorithm.
Equivalently, via prime factorisation: write each number as a product of prime powers, then for every prime that appears in any of the numbers take the highest exponent seen, and multiply those powers together. For example:
- 4 = 2^2
- 6 = 2^1 x 3^1
- 10 = 2^1 x 5^1
The primes involved are 2, 3, and 5. The highest exponents are 2^2, 3^1, and 5^1, giving LCM = 4 x 3 x 5 = 60.
The tool’s prime-factor table makes this visual: each column is a prime, each row is one of your numbers, and the highlighted entry in each column is the maximum exponent that feeds into the LCM.
Worked example
Find the LCM of 12, 18, and 30:
Factorisations: 12 = 2^2 x 3, 18 = 2 x 3^2, 30 = 2 x 3 x 5.
Take the maximum exponent of each prime: 2^2, 3^2, 5^1.
LCM = 4 x 9 x 5 = 180.
Pairwise fold confirms: LCM(12, 18) = (12 / GCD(12,18)) x 18 = (12/6) x 18 = 2 x 18 = 36; then LCM(36, 30) = (36 / GCD(36,30)) x 30 = (36/6) x 30 = 6 x 30 = 180.
| Numbers | LCM | Notes |
|---|---|---|
| 4, 6 | 12 | common denominator for 1/4 + 1/6 |
| 4, 6, 10 | 60 | three-number fold |
| 12, 18, 30 | 180 | see example above |
| 8, 15 | 120 | coprime pair (GCD = 1), so LCM = product |
| 100, 75 | 300 | GCD = 25, so LCM = 100 x 75 / 25 |
Formula note. LCM(a,b) = (a / GCD(a,b)) x b, where GCD is found by the Euclidean algorithm. For any two positive integers the identity GCD(a,b) x LCM(a,b) = a x b always holds. The calculator prints this identity check for two-number inputs.
The cycle diagram draws tick marks at every multiple of each number up to the LCM, making it immediately clear that the two sequences first coincide at exactly one point within that window. All calculations run entirely in your browser; no data is uploaded or stored.