On this page
Formula
LCM(a, b) = a × b ÷ GCF(a, b)
- a, b
- the whole numbers (for longer lists, apply the formula to the running result and the next number)
- GCF(a, b)
- the greatest common factor of a and b
- LCM
- the smallest positive number that every input divides into evenly
What the least common multiple is
The least common multiple (LCM) of a set of whole numbers is the smallest positive number that each of them divides into exactly. The multiples of 6 are 6, 12, 18, 24, 30, 36, … and the multiples of 10 are 10, 20, 30, 40, … The first number on both lists is 30, so LCM(6, 10) = 30. It’s sometimes called the lowest common multiple, and when the numbers are denominators it’s the least common denominator (LCD).
How to use the LCM calculator
- Enter two or more whole numbers separated by commas, spaces or new lines, such as 9, 12, 15.
- The LCM appears immediately. Large answers are shown in full, with every digit, even past the point where a phone calculator switches to scientific notation.
- Below the answer you’ll find the GCF, the prime factorization of the LCM, and how many times each number goes into the LCM. Those quotients are the factors you multiply each fraction by when rewriting over a common denominator.
- The steps list each number’s prime factorization and the pairwise LCM(a, b) = a × b ÷ GCF(a, b) calculations, so you can follow either method.
How to find the LCM by hand
Listing multiples
Write out multiples of the largest number and stop at the first one that every other number divides. For 4 and 14: 14, 28. Since 4 divides 28, the LCM is 28. This is quick for small numbers but slow when the LCM is large.
Prime factorization
Break each number into primes and take the highest power of every prime that appears anywhere.
- 8 = 2³
- 12 = 2² × 3
- 20 = 2² × 5
The highest power of 2 is 2³, of 3 is 3¹ and of 5 is 5¹, so the LCM is 2³ × 3 × 5 = 120. Check: 120 ÷ 8 = 15, 120 ÷ 12 = 10, 120 ÷ 20 = 6, all whole numbers. This LCM calculator uses this method in its steps.
Using the GCF
For two numbers, divide their product by their greatest common factor: LCM(a, b) = a × b ÷ GCF(a, b). For 21 and 35, the GCF is 7, so the LCM is 21 × 35 ÷ 7 = 105. For more numbers, repeat: LCM(a, b, c) = LCM(LCM(a, b), c). Dividing before multiplying, as the calculator does, keeps the numbers small.
The ladder (division) method
Many classrooms teach a ladder. Write the numbers in a row and divide by any prime that divides at least two of them, carrying the others down unchanged. Repeat until no prime divides two numbers, then multiply every divisor down the side and every number left at the bottom. It gives the same answer as prime factorization.
LCM reference table
| Numbers | LCM | GCF |
|---|---|---|
| 2, 3 | 6 | 1 |
| 4, 6 | 12 | 2 |
| 6, 8 | 24 | 2 |
| 12, 15 | 60 | 3 |
| 14, 21 | 42 | 7 |
| 16, 24 | 48 | 8 |
| 3, 4, 5 | 60 | 1 |
| 6, 10, 15 | 30 | 1 |
| 1 through 10 | 2,520 | 1 |
Where the LCM is used
Adding and subtracting fractions
To add 1/6 + 3/8, rewrite both over the least common denominator, LCM(6, 8) = 24: 4/24 + 9/24 = 13/24. Using the LCM rather than simply multiplying denominators (48) keeps the numbers small and often avoids a simplification step at the end.
Schedules that repeat
Two medications taken every 6 hours and every 8 hours coincide every LCM(6, 8) = 24 hours. Gears with 18 and 30 teeth return to the same starting position after LCM(18, 30) = 90 tooth movements, which is 5 turns of the small gear and 3 of the large one.
Buying in matching quantities
Hot dogs come in packs of 10 and buns in packs of 8. To buy the same number of each, you need LCM(10, 8) = 40 of each, which is 4 packs of hot dogs and 5 packs of buns.
Music and patterns
Rhythms of 3 and 4 beats line up every 12 beats, which is why a 3-against-4 polyrhythm repeats after 12 counts.
Common mistakes
- Multiplying the numbers and stopping. The product is a common multiple, but often not the least one. 6 × 8 = 48, while the LCM is 24.
- Using the lowest powers. Taking the lowest power of each shared prime gives the GCF. The LCM needs the highest power of every prime, shared or not.
- Leaving out primes that appear in only one number. In the LCM of 8, 12 and 20, the 5 from 20 must be included even though 8 and 12 don’t contain it.
- Mixing up the LCM and the GCF in word problems. Asking “when will these line up again?” calls for the LCM. Asking “what’s the largest equal group size?” calls for the GCF.
Glossary
- Multiple: the result of multiplying a number by a whole number (12 is a multiple of 4).
- Least common denominator: the LCM of the denominators of a set of fractions.
- Prime factorization: writing a number as a product of primes, such as 90 = 2 × 3² × 5. The exponent calculator evaluates the powers.
Worked examples
LCM of two numbers
Find the smallest number that both 12 and 18 divide into evenly.
Inputs: Whole numbers = 12, 18
12 = 2² × 3 18 = 2 × 3² Highest power of each prime: 2² × 3² = 36 lcm(12, 18) = 12 × 18 ÷ 6 = 36
Answer: The least common multiple of 12, 18 is 36.
When three bus routes line up again
Buses leave a terminal every 15, 20 and 25 minutes. All three left together at 6:00 a.m.
Inputs: Whole numbers = 15, 20, 25
15 = 3 × 5 20 = 2² × 5 25 = 5² Highest power of each prime: 2² × 3 × 5² = 300 lcm(15, 20) = 15 × 20 ÷ 5 = 60 lcm(60, 25) = 60 × 25 ÷ 5 = 300
Answer: The least common multiple of 15, 20, 25 is 300.
Coprime numbers
Edge case: 8 and 9 share no factor, so their LCM is simply their product.
Inputs: Whole numbers = 8, 9
8 = 2³ 9 = 3² Highest power of each prime: 2³ × 3² = 72 lcm(8, 9) = 8 × 9 ÷ 1 = 72
Answer: The least common multiple of 8, 9 is 72.
Large result beyond a phone calculator
Three large primes; the LCM has 18 digits and is kept exact.
Inputs: Whole numbers = 999983, 999979, 1000003
999,983 = 999,983 999,979 = 999,979 1,000,003 = 1,000,003 Highest power of each prime: 999,979 × 999,983 × 1,000,003 = 999,965,000,243,001,071 lcm(999,983, 999,979) = 999,983 × 999,979 ÷ 1 = 999,962,000,357 lcm(999,962,000,357, 1,000,003) = 999,962,000,357 × 1,000,003 ÷ 1 = 999,965,000,243,001,071
Answer: The least common multiple of 999,983, 999,979, 1,000,003 is 999,965,000,243,001,071.
Assumptions and limitations
- Enter 2 to 20 positive whole numbers, each from 1 to 1,000,000,000,000. Decimals, fractions, 0 and negative numbers aren't accepted.
- Separate numbers with commas, spaces or new lines, and don't use thousands separators inside a number.
- Results use exact big-integer arithmetic, so an LCM with dozens of digits is shown in full with no rounding.
- For lists longer than two, the LCM is built up pairwise, LCM(LCM(a, b), c) and so on. The working shows each step.
- The prime factorization of the LCM takes the highest power of every prime that appears in any of the numbers.
Frequently asked questions
How do you calculate the LCM of two numbers?
Multiply the numbers and divide by their greatest common factor. For 18 and 24, the GCF is 6, so the LCM is 18 × 24 ÷ 6 = 72. Or list the multiples of the larger number (24, 48, 72, …) until you reach one the smaller number divides.
How do you calculate the LCM of 3 numbers?
Find the LCM of the first two, then the LCM of that result and the third number. For 4, 6 and 10, LCM(4, 6) = 12 and LCM(12, 10) = 60. You can also use prime factorization and take the highest power of every prime.
How is the LCM used with fractions?
The least common denominator of two fractions is the LCM of their denominators. To add 5/12 + 7/18, use LCM(12, 18) = 36, so the sum is 15/36 + 14/36 = 29/36. The [fraction calculator](/fraction-calculator/) handles the whole sum.
Is the LCM always bigger than the numbers?
It is at least as big as the largest number. It equals the largest number when that number is a multiple of all the others. The LCM of 5 and 20 is 20.
How are the LCM and GCF related?
For any two positive whole numbers, LCM × GCF = a × b. So once you know one, you can find the other with a single division. The [GCF calculator](/gcf-calculator/) shows the greatest common factor with its own steps.
What is the LCM of two prime numbers?
Their product, because two different primes share no factor. The LCM of 7 and 11 is 77. The same holds for any two coprime numbers, such as 9 and 10, whose LCM is 90.
Sources
- 2.5 Prime Factorization and the Least Common Multiple — Prealgebra 2e — OpenStax, Rice University. Checked October 10, 2026.
- Least Common Multiple — Wolfram MathWorld. Checked October 10, 2026.