Skip to content

LCM Calculator

This LCM calculator finds the least common multiple of two to ten whole numbers. Type them separated by commas, such as 12, 18. It breaks each number into primes, keeps every prime at its highest power and multiplies them, so you see why the LCM of 12 and 18 is 36.

Last updated November 6, 2026 · Topic: Number Theory

Whole numbers separated by commas

What is the least common multiple?

A multiple of a number is what you get when you multiply it by 1, 2, 3 and so on. The least common multiple of a group of numbers is the smallest multiple they all share. It is written LCM(a, b) or lcm(a, b).

For example, multiples of 4 are 4, 8, 12, 16. Multiples of 6 are 6, 12, 18. The first number in both lists is 12, so LCM(4, 6) = 12.

LCM formula with prime factors

Using prime factorization, take the highest power of every prime that appears in any of the numbers:

lcm⁡(a,b,… )=∏ppmax⁡(ea, eb, … )\operatorname{lcm}(a, b, \dots) = \prod_{p} p^{\max(e_a,\, e_b,\, \dots)}

For two numbers, you can also use the greatest common factor:

lcm⁡(a,b)=a×bgcd⁡(a,b)\operatorname{lcm}(a, b) = \frac{a \times b}{\gcd(a, b)}

How to use the LCM calculator

  1. Type two or more whole numbers in the box, separated by commas or spaces.
  2. Use positive whole numbers only. Decimals and negatives are not allowed.
  3. Read the prime factorization of each number in the steps.
  4. See which prime powers were kept, then read the final LCM.
  5. To check, divide the LCM by each of your numbers. Every result should be a whole number.

LCM examples

Example 1: Two numbers

Find the LCM of 4 and 6.

  • 4 = 2² and 6 = 2 × 3.
  • The highest power of 2 is 2². The highest power of 3 is 3¹.
  • Multiply: 2² × 3 = 4 × 3 = 12.

LCM(4, 6) = 12.

Example 2: Three numbers

Find the LCM of 6, 8 and 15.

  • 6 = 2 × 3, 8 = 2³ and 15 = 3 × 5.
  • Highest powers: 2³, 3¹ and 5¹.
  • Multiply: 8 × 3 × 5 = 120.

Check: 120 ÷ 6 = 20, 120 ÷ 8 = 15 and 120 ÷ 15 = 8. All are whole numbers, so LCM(6, 8, 15) = 120.

Example 3: Adding fractions

Add 5⁄12 and 7⁄18. The common denominator should be the LCM of 12 and 18. Since 12 = 2² × 3 and 18 = 2 × 3², the LCM is 2² × 3² = 36. Rewrite: 5⁄12 = 15⁄36 and 7⁄18 = 14⁄36. Add: 15⁄36 + 14⁄36 = 29⁄36. Using the least common denominator keeps the numbers small.

Example 4: Three numbers

Find the LCM of 4, 6 and 10. Factor each: 4 = 2², 6 = 2 × 3 and 10 = 2 × 5. Take every prime with its largest exponent: 2², 3 and 5. Multiply: 4 × 3 × 5 = 60. Check that 60 divides by each number: 60 ÷ 4 = 15, 60 ÷ 6 = 10 and 60 ÷ 10 = 6.

Other ways to find the LCM by hand

The calculator shows the prime-factor method. Three other methods give the same answer, and teachers often ask for them by name:

  1. Listing multiples. Write out multiples of each number until one appears in every list. Multiples of 6 are 6, 12, 18, 24; multiples of 8 are 8, 16, 24. The LCM is 24. This is quick for small numbers and slow for big ones.
  2. The ladder (cake) method. Divide all the numbers by a prime that goes into at least two of them, and repeat until no prime is shared. For 12 and 18: divide by 2 to get 6 and 9, then by 3 to get 2 and 3. Multiply the divisors and what is left: 2 × 3 × 2 × 3 = 36.
  3. Using the GCF. For two numbers, LCM = (a × b) ÷ GCF. The GCF of 12 and 18 is 6, so the LCM is 216 ÷ 6 = 36. The GCF calculator gives the GCF with steps.

For a three-number check: 12 = 2² × 3, 16 = 2⁴ and 21 = 3 × 7, so the LCM of 12, 16 and 21 is 2⁴ × 3 × 7 = 336.

When the LCM is just the product

If two numbers share no prime factor, their LCM is the two numbers multiplied. 8 and 15 share nothing, so their LCM is 120. When they do share a factor, the LCM is smaller than the product. The prime factorization calculator shows quickly whether two numbers share a prime.

Tips

  • If the numbers share no factor other than 1, the LCM is their product. For 8 and 9, it is 72.
  • If one number divides the other, the LCM is the larger number. For 6 and 24, it is 24.
  • For two numbers, the LCM equals their product divided by their GCF. For 12 and 18, that is 216 ÷ 6 = 36.
  • Use whole numbers. The tool rejects decimals and negatives, with a clear message.
  • Try the GCF calculator on the same numbers to see the link between the two.

Common LCM mistakes

  • Confusing LCM with GCF. The LCM is a multiple, so it is never smaller than your biggest number. The GCF is a factor, so it is never larger than your smallest.
  • Stopping at the first common multiple you spot. It must be the smallest one. Using prime factors avoids this.
  • Multiplying all the numbers together. That gives a common multiple, but often a much bigger one than the least.
  • Adding powers instead of taking the highest. For 12 and 18 the answer uses 2² and 3², not 2³ and 3³.
  • Dropping a prime. A prime that appears in only one number still belongs in the LCM.

What the LCM is used for

The LCM helps you add and subtract fractions with unlike denominators, since the least common denominator is the LCM of the denominators. It also solves timing puzzles. If one bus comes every 12 minutes and another every 18 minutes, they leave together every 36 minutes. Event planners use it to line up repeating schedules, and teachers use it to build matching sets of items. For a full comparison, see our guide to GCF and LCM.

The ladder method, for LCM

The ladder method on the GCF calculator page also gives the LCM: multiply every prime used on the left of the ladder by the numbers left at the bottom. For 48 and 36 that is 2 × 2 × 3 × 4 × 3 = 144, which is the least common multiple. If you already have the GCF, a shorter identity is LCM(a, b) = a × b ÷ GCF(a, b): 48 × 36 ÷ 12 = 144.

FAQ

Frequently asked questions

01What is the least common multiple?

The least common multiple of a set of numbers is the smallest positive number that is a multiple of all of them. For 4 and 6, the multiples of 4 are 4, 8, 12 and the multiples of 6 are 6, 12, so the LCM is 12.

02How do you find the LCM with prime factors?

Write each number as a product of primes. For every prime that appears, keep the highest power it has in any number. Multiply those prime powers together. For 12 and 18, that is 2² × 3² = 36, because 12 = 2² × 3 and 18 = 2 × 3².

03What is the LCM of two prime numbers?

When two numbers share no prime factors, their LCM is simply their product. For the primes 5 and 7, the LCM is 35. This also works for any two numbers whose GCF is 1, which are called coprime or relatively prime numbers.

04How are LCM and GCF related?

For two numbers, GCF × LCM equals the product of the numbers. For 12 and 18, the GCF is 6 and the LCM is 36, and 6 × 36 = 216 = 12 × 18. This gives a quick check, or a way to find one when you know the other.

05When do I need the LCM?

You use the LCM to add or subtract fractions, because the least common denominator is the LCM of the denominators. You also use it for repeating schedules, such as finding when two buses that run every 12 and 18 minutes leave together again.

06Is the LCM always bigger than the numbers?

It is at least as big as the largest number in the list. It equals the largest number when every other number divides it, as with 6 and 24, where the LCM is 24. Otherwise it is bigger. It can never be smaller than the largest number.

07How do you find the LCM of two numbers using the GCF?

Multiply the two numbers and divide by their greatest common factor. For 12 and 18, the product is 216 and the GCF is 6, so the LCM is 216 ÷ 6 = 36. This shortcut works for two numbers at a time. For three or more, apply it to the first two, then repeat with the next number.

08What is the LCM of 0 and another number?

Most textbooks define it as 0, or leave it undefined, because 0 is a multiple of every number but is not a positive common multiple. This calculator asks for whole numbers above 0 for that reason.