Lelifi·tools

LCM Calculator

LCM(12, 18) = 36, the smallest number that both 12 and 18 divide into. This calculator handles two or three numbers, shows the prime factors and the GCF, lists the multiples where the numbers meet, and turns the result into a common denominator.

Whole numbers from 1 to 1,000,000. Leave the third box at 0 to use two numbers.

Enter two or three whole numbers to get the smallest number they all divide into, plus the GCF, the prime factors and the multiples where they meet.

By the Lelifi editors ·

Key takeaways

Why the LCM of 12 and 18 is 3612 = 2^2 x 318 = 2 x 3^2highest powers of 2 and 3= 4 x 9 = 36Highest power of each prime, not the lowest.
Reading the highest power of every prime across both factorizations gives 36.
A 12-minute bus and an 18-minute train meet every 36 minutes0 minboth leave12 minbus only24 minbus only36 minboth again
The two schedules line up again at the 36-minute mark, which is the least common multiple.
On this page
  1. What the least common multiple is
  2. Three ways to find it
  3. Worked example: 12 and 18
  4. Three numbers: 4, 6 and 10
  5. Repeating schedules: buses, shifts and maintenance
  6. Common denominators use the LCM
  7. LCM versus GCF: which one the question wants
  8. When the LCM gets large

What the least common multiple is

A multiple of a number is what you get when you multiply it by 1, 2, 3 and onward. The multiples of 4 are 4, 8, 12, 16, 20, 24 and so on. The multiples of 6 are 6, 12, 18, 24, 30 and so on. Numbers that appear in both lists are common multiples, and the smallest one is the least common multiple.

For 4 and 6 the shared list starts 12, 24, 36, so LCM(4, 6) = 12. Every other common multiple is a multiple of 12, which is the property that makes the LCM useful: it is the building block for all the rest.

The LCM is never smaller than the largest number you put in. It equals that number when the others divide into it, so LCM(3, 12) = 12. It is never larger than the product of the numbers, and it equals the product when the numbers share no factor above 1.

This calculator takes two or three whole numbers up to 1,000,000 and reports the LCM, the greatest common factor, the prime factors and the multiples where the numbers first meet.

Three ways to find it

Each method suits a different size of number. Listing is fine for small values, prime factorization is the one taught in school, and the GCF shortcut is the fastest once you can find a greatest common factor.

MethodWhat you doBest whenFor 12 and 18
List multiplesWrite multiples of each number until the first match appearsBoth numbers are under about 2012, 24, 36 and 18, 36, so the answer is 36
Prime factorizationBreak each number into primes and take the highest power of every prime that appearsNumbers factor easily into small primes2^2 x 3^2 = 36
GCF shortcutDivide the product by the greatest common factorYou can find the GCF quickly, or a calculator does it12 x 18 / 6 = 36

The listing method fails quietly when the answer is large. Try 9 and 28 by hand and you write 28 lines before the first match at 252. That is why the shortcut exists: it turns a search into one division.

The prime method is the only one that scales cleanly to three or more numbers, because you can line up every factorization and read the highest powers across all of them. Maths Is Fun's LCM page walks through the listing method with diagrams.

Worked example: 12 and 18

Break both numbers into primes. 12 is 2 x 2 x 3, written 2^2 x 3. 18 is 2 x 3 x 3, written 2 x 3^2.

PrimePower in 12Power in 18Highest power used
22^22^12^2 = 4
33^13^23^2 = 9
LCM4 x 9 = 36

Take the highest power of each prime, not the lowest. The lowest powers would rebuild the greatest common factor instead, which for these numbers is 6.

Check the answer by dividing. 36 / 12 = 3 and 36 / 18 = 2, both whole numbers, so 36 is a common multiple. Nothing smaller works: the multiples of 18 below 36 are 18, and 18 does not divide by 12.

The shortcut agrees. The GCF of 12 and 18 is 6, the product is 216, and 216 / 6 = 36. The identity behind it is that the product of two numbers equals their LCM times their GCF, which is why one division finishes the job. MathWorld's LCM entry proves that identity for any pair of positive integers.

Three numbers: 4, 6 and 10

Three numbers follow the same prime rule. 4 is 2^2, 6 is 2 x 3 and 10 is 2 x 5. The highest power of each prime across all three rows is 2^2, 3^1 and 5^1, so the LCM is 4 x 3 x 5 = 60.

The chain method gives the same result. Find the LCM of the first pair, then pair that answer with the third number: LCM(4, 6) = 12, and then LCM(12, 10) = 60. Chaining works because the LCM of a group is the LCM of the running total and the next number.

Note what 60 is not. The product 4 x 6 x 10 = 240 is four times too large, because all three numbers share a factor of 2 and the product counts it three times. With three numbers the rule that ties the LCM to the GCF no longer holds in its simple form, so the product shortcut is unsafe here.

The check is the same as before. 60 / 4 = 15 and 60 / 6 = 10 and 60 / 10 = 6, so 60 is a common multiple, and no smaller number divides by all three.

Repeating schedules: buses, shifts and maintenance

The most common real use is finding when two repeating events line up again. A bus leaves every 12 minutes and a train leaves every 18 minutes. Both leave at 8:00. The next time both leave together is 36 minutes later, at 8:36, because 36 is the LCM of 12 and 18. Over a three-hour window of 180 minutes they line up 180 / 36 = 5 times.

Work schedules use the same arithmetic. One crew works an 8-day rotation and another works a 12-day rotation. If both start on the same day, they overlap again after 24 days, which is LCM(8, 12) = 24, and the GCF of 4 tells you they share a rest day every 4 days.

Maintenance planning is a third case. If filters are changed every 15 days and belts every 20 days, the jobs collide every 60 days, which is LCM(15, 20) = 60. Knowing that lets you bundle them into one visit instead of two.

One caution: this only holds when the intervals stay fixed. A bus that runs every 12 minutes at rush hour and every 20 minutes at night will not meet the schedule the formula predicts.

Common denominators use the LCM

Adding fractions needs the same denominator, and the smallest one that works is the LCM of the denominators. That value is often called the least common denominator, or LCD. It is not a different idea, just the LCM applied to the bottom numbers of fractions.

Take 1/12 + 1/18. The LCM of 12 and 18 is 36, so rewrite both fractions over 36: 1/12 becomes 3/36 and 1/18 becomes 2/36. Add the tops and the answer is 5/36, which is about 0.1389.

A second example: 5/6 + 3/8. The LCM of 6 and 8 is 24, so 5/6 becomes 20/24 and 3/8 becomes 9/24. The sum is 29/24, or 1 and 5/24, which is about 1.2083.

Any common denominator works for the addition, but the LCM keeps the numbers small. Using 12 x 18 = 216 as the denominator would give 18/216 + 12/216 = 30/216, which reduces to the same 5/36 after more work. The calculator prints the reduced form so you can skip that step.

LCM versus GCF: which one the question wants

Both ideas compare two numbers, and students mix them up because the words sound alike. The question tells you which one to use. Look for the phrase that describes the answer you want.

Question wordingWhat you needFor 12 and 18
Largest number that divides bothGreatest common factor6
Smallest number both divide intoLeast common multiple36
When do two cycles line up againLeast common multipleAfter 36 units
How do I simplify a fractionGreatest common factorDivide both by 6
What is the common denominatorLeast common multiple36

The quick test is size. A common factor can never be larger than the smaller number, and a common multiple can never be smaller than the larger one. If your answer is bigger than both inputs, you found a multiple. If it is smaller than both, you found a factor.

This page answers the multiple question. The GCF calculator answers the factor question, works the Euclidean steps and reduces fractions, so use that one when the task is simplifying rather than scheduling.

When the LCM gets large

The LCM grows fast when the numbers share no factor. For 9 and 28 the only shared factor is 1, so the LCM is the product, 252. Neither number is large, yet the answer is ten times the bigger input. That is why hand listing fails on coprime pairs.

Adding more numbers makes it worse. The LCM of every whole number from 2 through 10 is 2,520, which is the smallest number divisible by all of them. It is also why the classic puzzle about gear teeth and clock hands produces answers in the hundreds.

Three numbers can push the result past a billion even when each input is modest. The calculator caps inputs at 1,000,000 and each multiple list at 12 entries, so the page stays readable even when the answer runs to twelve digits.

If two numbers are coprime, the LCM is just their product, and you can skip the factoring. If one number divides the other, the LCM is the larger one. Those two shortcuts cover a fair share of homework problems before any arithmetic starts.

Frequently asked questions

What is the least common multiple of 12 and 18?

36. The prime factors are 2^2 x 3 and 2 x 3^2, so the highest powers give 4 x 9 = 36.

What is the LCM of 4, 6 and 10?

60. The highest powers across the three numbers are 2^2, 3 and 5, which multiply to 60.

What is the LCM of 8 and 12?

24. The GCF is 4, and 8 x 12 / 4 = 24.

What is the LCM of 9 and 28?

252. The numbers share no factor above 1, so the LCM is their product.

Is the least common denominator the same as the LCM?

Yes. The LCD is the LCM of the denominators, so the arithmetic is identical.

What is 1/12 plus 1/18?

5/36, which is about 0.1389. Over the common denominator 36 the fractions are 3/36 and 2/36.

How are the LCM and GCF related?

For two numbers, the LCM times the GCF equals the product, so 36 x 6 = 216 for 12 and 18.

What is the LCM of 1 and any number?

The other number, because every number is a multiple of 1.

Can the LCM be smaller than the numbers?

No. It is at least as large as the biggest input, since it has to be a multiple of that number.

What is the LCM of 15 and 20?

60. 15 is 3 x 5 and 20 is 2^2 x 5, so the highest powers give 4 x 3 x 5 = 60.

What is the LCM of the numbers 2 through 10?

2,520. It is the smallest number that every value from 2 to 10 divides into.

What if the two numbers are coprime?

Then the LCM is their product and the GCF is 1. 9 and 28 are coprime, so the LCM is 252.

Does the calculator accept decimals?

No. It takes whole numbers from 1 to 1,000,000, because the LCM is defined on integers.

Spotted a wrong number or a broken result?

More Math tools

See all Math tools

Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.