Math · Live
Least Common Multiple Calculator,
with full prime factorization.
Calculate the LCM of two or more integers, with step-by-step prime factorization, a visual factor table showing which prime powers contribute to the result, and the GCD computed alongside. Enter up to 20 numbers at once.
Inputs
Enter integers
Quick examples
3 numbers · max 20
Enter 2–20 positive integers. Results update instantly as you type.
Least Common Multiple
Greatest Common Divisor
GCD of the same 3 numbers
LCM formula
2³ × 3² = 8 × 9 = 72
Factor table
Prime factorizations
| Number | 2 | 3 | Factorization |
|---|---|---|---|
| 12 | 2² | 3 | 2² × 3 |
| 18 | 2 | 3² | 2 × 3² |
| 24 | 2³ | 3 | 2³ × 3 |
| LCM = 72 | 2³ | 3² | 2³ × 3² |
Highlighted cells (amber) = highest power of that prime used in the LCM.
Working
Step-by-step
LCM via prime factorization
- Step 1: Prime factorize each number:
- 12 = 2² × 3
- 18 = 2 × 3²
- 24 = 2³ × 3
- Step 2: Take the highest power of each prime:
- 2: max(2, 1, 3) = 3 → 2³ = 8
- 3: max(1, 2, 1) = 2 → 3² = 9
- Step 3: LCM = 2³ × 3² = 8 × 9 = 72
GCD via Euclidean algorithm
- GCD via Euclidean algorithm:
- GCD(12, 18) = 6
- GCD(6, 24) = 6
- GCD = 6
Multiples
First 8 multiples of 72
Complete guide
What is the Least Common Multiple?
The Least Common Multiple (LCM) of two or more integers is the smallest positive integer that is divisible by every number in the set without leaving a remainder. Also called the lowest common multiple or smallest common multiple, it is the foundation for adding fractions with different denominators, synchronising repeating events, and many problems in number theory.
Example: The LCM of 4 and 6 is 12, because 12 is the smallest number that is a multiple of both 4 (4, 8, 12, 16…) and 6 (6, 12, 18…).
How to find the LCM, with just three methods
Method 1: Prime factorization (most educational)
This is the method shown in the factor table above. Break each number into its prime factors, then for each prime take the highest exponent that appears in any of the numbers, and multiply all these prime powers together:
12 = 2² × 3¹
18 = 2¹ × 3²
24 = 2³ × 3¹
Primes present: 2 and 3
Highest power of 2: max(2, 1, 3) = 3 → 2³ = 8
Highest power of 3: max(1, 2, 1) = 2 → 3² = 9
LCM = 2³ × 3² = 8 × 9 = 72
Method 2: Using GCD (most efficient for two numbers)
The LCM and GCD are linked by the identity:
LCM(12, 18):
GCD(12, 18) = GCD(18, 12) = GCD(12, 6) = GCD(6, 0) = 6
LCM = (12 × 18) / 6 = 216 / 6 = 36
For more than two numbers, apply the formula repeatedly: LCM(a, b, c) = LCM(LCM(a, b), c).
Method 3: Listing multiples (only practical for small numbers)
Write out multiples of each number until a common value appears:
Multiples of 4: 4, 8, 12, 16, 20…
Multiples of 6: 6, 12, 18, 24…
First common multiple: 12
LCM(4, 6) = 12
LCM reference table for common pairs
| Numbers | GCD | LCM | LCM formula |
|---|---|---|---|
| 2, 3 | 1 | 6 | 2¹ × 3¹ |
| 4, 6 | 2 | 12 | 2² × 3 |
| 6, 8 | 2 | 24 | 2³ × 3 |
| 9, 12 | 3 | 36 | 2² × 3² |
| 10, 15 | 5 | 30 | 2 × 3 × 5 |
| 12, 18 | 6 | 36 | 2² × 3² |
| 4, 6, 8 | 2 | 24 | 2³ × 3 |
| 3, 5, 7 | 1 | 105 | 3 × 5 × 7 |
| 12, 18, 24 | 6 | 72 | 2³ × 3² |
| 15, 20, 25 | 5 | 300 | 2² × 3 × 5² |
The relationship between LCM and GCD
The LCM and GCD (Greatest Common Divisor) are complementary concepts. While the GCD is the largest number that divides all the inputs, the LCM is the smallest number that all inputs divide into. They are related by:
LCM(a, b) × GCD(a, b) = a × b
Example: LCM(12, 18) = 36, GCD(12, 18) = 6:
36 × 6 = 216 = 12 × 18 ✓
This identity means that once you know either the LCM or the GCD, you can find the other without factorising: if you know the GCD from Euclid's algorithm, compute the LCM directly.
LCM and fractions: finding the LCD
The Least Common Denominator (LCD) of two or more fractions is the LCM of their denominators. It is the smallest denominator that all fractions can be rewritten with, enabling addition and subtraction:
LCD = LCM(4, 6) = 12
1/4 = 3/12
1/6 = 2/12
1/4 + 1/6 = 3/12 + 2/12 = 5/12
Without the LCD, adding fractions requires expanding to a common denominator that might not be the smallest — the arithmetic still works but the result requires additional simplification.
LCM in scheduling and repeating events
Any problem involving two or more periodic events that must coincide reduces to an LCM calculation:
- Traffic lights: Light A cycles every 40 seconds, Light B every 60 seconds. They next synchronise at LCM(40, 60) = 120 seconds (2 minutes).
- Gear teeth: Two meshing gears with 12 and 18 teeth return to the same starting position every LCM(12, 18) = 36 tooth engagements.
- Planetary conjunctions: Planets with orbital periods of 12 years (Jupiter) and 30 years (Saturn) align every LCM(12, 30) = 60 years.
- Music: A rhythm on beat 3 and a rhythm on beat 4 both land on beat 1 every LCM(3, 4) = 12 beats.
Prime numbers and the LCM
The LCM of a set of distinct prime numbers is simply their product, because distinct primes share no common factors:
LCM(2, 3, 5, 7, 11) = 2 × 3 × 5 × 7 × 11 = 2310
This means the LCM grows rapidly when inputs are coprime (share no common factors). Two numbers are coprime if and only if their GCD is 1, in which case their LCM equals their product.
Special cases
- LCM(n, 1) = n: 1 divides every integer, so adding 1 to a set never changes the LCM.
- LCM(n, n) = n: The LCM of a number with itself is the number.
- LCM(a, b) = a × b when GCD(a, b) = 1: Coprime numbers have an LCM equal to their product.
- LCM of multiples: LCM(6, 12, 24) = 24, because 24 already contains 6 and 12 as factors.