Enter the numbers in the box, one per line, and select Calculate. The first line of the result gives the LCM, and below it the pairwise calculation appears, with the GCD of each step. With 12 and 18 you will see GCD(12, 18) = 6 and LCM = |(12 / 6) × 18| = 36. For two numbers, that line is the combined result of the GCD and the LCM; if you only want the divisor, there is the GCD calculator, and if you work with fractions, the least common denominator calculator shows the fractions already converted.
Worked example: two buses that line up
One bus leaves the stop every 12 minutes and another every 18. They leave together at 8:00 a.m. When do they next leave together?
- Find the GCD. GCD(12, 18) = 6.
- Divide one number by the GCD. 12 ÷ 6 = 2.
- Multiply by the other. 2 × 18 = 36.
Result: LCM(12, 18) = 36, so they leave together again at 8:36 a.m.
Check: 36 ÷ 12 = 3 and 36 ÷ 18 = 2 come out exact, and no number smaller than 36 is divisible by both.
You divide before multiplying to work with smaller numbers. Multiplying 12 × 18 = 216 and dividing by 6 gives the same result, but with bigger figures.
Three ways to find the LCM by hand
Each method works best in a different situation. To show that they give the same result, each one uses a different pair here.
| Method | When it fits | Example |
|---|---|---|
| List of multiples | Small numbers | 4 and 6: 4, 8, 12 and 6, 12; LCM = 12 |
| Prime factors | If you already have the factorization | 18 = 2 × 3² and 24 = 2³ × 3; LCM = 2³ × 3² = 72 |
| Formula with the GCD | Large numbers | 28 and 42: GCD = 14; (28 ÷ 14) × 42 = 84 |
The list of multiples stops at the first number that appears in both rows. With prime factors, you take each prime at its highest exponent; the LCM is a multiple of each number, so it is never smaller than the larger one. The formula, which needs no factoring, is the one applied here.
LCM(4, 6) = 12
Three or more numbers
Work two at a time with the running result. For 8, 12, and 20: LCM(8, 12) = 24 and then LCM(24, 20) = 120. The result is divisible by each number on the list, and 120 ÷ 8 = 15, 120 ÷ 12 = 10, and 120 ÷ 20 = 6 confirm it. The calculator takes up to 20 integers of up to 100 digits each.
Cases worth recognizing
| Case | Example | What happens |
|---|---|---|
| No common factors | LCM(5, 8) = 40 | It is the product, 5 × 8 |
| One is a multiple of the other | LCM(3, 12) = 12 | It is the larger of the two |
| One of the numbers is 1 | LCM(9, 1) = 9 | It is the other number |
| A negative number | LCM(−6, 8) = 24 | The absolute value is used |
| A zero | LCM(0, 8) = 0 | Convention: the only multiple of 0 is 0 |
Zero is the only case that does not fit “the smallest positive multiple,” because no common positive multiple exists. That is why an LCM of 0 cannot serve as a denominator, which can never be 0.
Where the LCM is used
In cycle problems, like the buses, the LCM tells you when two repeating events line up. With fractions, the LCM of the denominators is the least common denominator: for 3/10 + 1/4, LCM(10, 4) = 20, and the sum becomes 6/20 + 5/20 = 11/20. The least common denominator calculator does that rewriting directly, and adding fractions applies it to unlike denominators. Why you can’t add denominators explains the reason.
The LCM also helps convert a fraction to an equivalent one with a given denominator. That process, building up the fraction, is explained in equivalent fractions; the opposite, simplifying, uses the GCD. To compare two fractions without looking for a common denominator, comparing fractions shows cross-multiplication. If you need the factors of each number, use prime factorization. OpenStax presents the LCM by listing multiples and by prime factors.
Common pairs: LCM and GCD together
The table gathers the pairs people look up most, with the LCM and GCD of each.
| Numbers | LCM | GCD |
|---|---|---|
| 4 and 6 | 12 | 2 |
| 6 and 9 | 18 | 3 |
| 8 and 12 | 24 | 4 |
| 9 and 12 | 36 | 3 |
| 10 and 15 | 30 | 5 |
| 12 and 16 | 48 | 4 |
| 12 and 18 | 36 | 6 |
| 14 and 21 | 42 | 7 |
| 15 and 20 | 60 | 5 |
| 18 and 24 | 72 | 6 |
| 20 and 30 | 60 | 10 |
| 7 and 9 | 63 | 1 |
When the GCD is 1, the LCM is the product, as with 7 and 9. In the other rows it is smaller than the product, and the larger the GCD, the smaller the LCM is compared with it.
Frequently asked questions
How do I know whether a problem asks for the LCM or the GCD?
Ask what is being looked for. If something repeats and you want to know when it lines up, or you need a number that all of them reach, it is the LCM. If you have to split or cut into equal parts as large as possible, it is the GCD. The GCD vs. LCM guide and the solved word problems practice exactly that choice.
Is GCD × LCM always equal to the product of the numbers?
Only with two numbers. For 10 and 35, the GCD is 5 and the LCM is 70, and 5 × 70 = 350 = 10 × 35. With three or more numbers it no longer holds in general: for 9, 15, and 21 the GCD is 3 and the LCM is 315, and 3 × 315 = 945, while 9 × 15 × 21 = 2,835.
What is the LCM of two different prime numbers?
It is their product: LCM(11, 13) = 143. The exception is when one is prime and the other is a multiple of it, because then they share that prime and the LCM is the larger one: LCM(11, 33) = 33. To recognize primes, use the prime factorization calculator.