Skip to content
thecalculatorstudio

Least Common Multiple Calculator (LCM)

Enter two to six whole numbers. You will see their least common multiple, how it follows from the greatest common factor and from the prime factors, and the first multiples of each number.

Last reviewed

Least common multiple of 12, 18

36

2² × 3²

The next common multiples
72, 108, 144
Each number goes into it
12 × 3 · 18 × 2

Using the greatest common factor

  • LCM(12, 18) = 12 × 18 ÷ GCF 6 = 36

Using prime factors, highest power of each

  • 12 = 2² × 3
  • 18 = 2 × 3²

Every prime to its highest power: 2² × 3² = 36.

The first multiples of each number

  • 12: 12, 24, 36, 48, 60, 72, 84, 96 …
  • 18: 18, 36, 54, 72, 90, 108, 126, 144 …

The least common multiple is the smallest number every one of them divides exactly. Every other common multiple is a multiple of it.

What the least common multiple is

The least common multiple (LCM) of two or more whole numbers is the smallest positive number that every one of them divides exactly. It is also called the lowest common multiple. A multiple of a number is what you get by multiplying it by 1, 2, 3 and so on.

For 4 and 6, the multiples of 4 are 4, 8, 12, 16, 20, 24 and the multiples of 6 are 6, 12, 18, 24. The common ones are 12, 24, 36 and so on, and the smallest is 12. Every common multiple is a multiple of the LCM, which is why the page also lists the next few.

Method 1: the greatest common factor

For two numbers the LCM follows from their greatest common factor:

LCM(a, b) = a × b ÷ GCF(a, b)

  • 12 and 18: GCF 6, so LCM = 12 × 18 ÷ 6 = 216 ÷ 6 = 36.
  • 21 and 6: GCF 3, so LCM = 126 ÷ 3 = 42.
  • 8 and 12: GCF 4, so LCM = 96 ÷ 4 = 24.

For three or more numbers, take the first two, then that answer with the third, and so on. For 3, 4 and 5: LCM(3, 4) = 12, then LCM(12, 5) = 60. The page shows each step.

Method 2: prime factors

Write each number as a product of primes (the prime factorization calculator does this), then multiply every prime that appears in any of the numbers, each to the highest power it has.

  • 12 = 2² × 3
  • 18 = 2 × 3²
  • Highest powers: 2² and 3². LCM = 4 × 9 = 36.

Compare this with the GCF, which uses only the primes shared by all the numbers, to their lowest power. For 12 and 18 that gives 2 × 3 = 6.

Short cases

  • One number divides the other. The LCM is the larger. LCM(3, 9) = 9, and LCM(7, 7) = 7.
  • The numbers are coprime (GCF 1). The LCM is the product. LCM(5, 7) = 35 and LCM(8, 15) = 120.
  • Shared factors count once. The LCM of 6, 10 and 15 is 30, smaller than 6 × 10 = 60, because the 2, 3 and 5 they share are counted once each.
  • The numbers 1 to 10. The LCM is 2,520 = 2³ × 3² × 5 × 7. It is the smallest number divisible by every whole number from 1 to 10.

GCF and LCM together

For two numbers, GCF × LCM = a × b. For 12 and 18: 6 × 36 = 216 = 12 × 18. This does not hold for three or more numbers, so do not use it there; the page works pair by pair.

Where the LCM is used

  • Adding and subtracting fractions. The LCM of the denominators is the smallest common denominator. 1/4 + 1/6: the LCM of 4 and 6 is 12, so 3/12 + 2/12 = 5/12. Check the result in the fraction calculator.
  • Repeating schedules. Two buses leave a stop every 12 and every 18 minutes. They leave together again after 36 minutes.
  • Gears and cycles. Two cycles of lengths 4 and 6 line up again after 12 steps.
  • Ratios. Scaling a ratio to whole numbers uses a common multiple. See the proportion calculator.

Common mistakes

  • Mixing up LCM and GCF. The LCM is at least as big as the largest number. The GCF is at most as big as the smallest.
  • Using the product. a × b is a common multiple, but only the LCM when the numbers are coprime. The product of 12 and 18 is 216, not 36.
  • Using the lowest power of each prime. That gives the GCF. For the LCM take the highest.
  • Dropping a prime that is in only one number. It must be included. For 4 and 9 the LCM is 36, which has both the 2s and the 3s.
  • Using decimals. The LCM is for whole numbers. Convert a decimal such as 0.25 to a fraction first.
  • Greatest common factor calculator.
  • Factor calculator and prime factorization calculator.
  • Common factor calculator, which gives the GCF, the LCM and every common factor together.
  • Fraction calculator and proportion calculator.

How it is calculated

The numbers are read as exact whole numbers. The LCM is built pair by pair as a × b ÷ GCF, using exact integer arithmetic, so the answer stays correct when it is far larger than the numbers entered (the LCM of 10¹⁵ and 999,999,999,999,989 has 30 digits). Separately, each number is split into prime powers by trial division and the highest power of each prime is taken. The two methods give the same value. The multiples are the number times 1 to 8, and the common multiples are the LCM times 1 to 5.

Frequently asked questions

What is the least common multiple?

The smallest positive number that every number in a set divides exactly. The LCM of 4 and 6 is 12, because 12 is the first number on both lists of multiples: 4, 8, 12 and 6, 12.

How do I find the LCM using the GCF?

For two numbers, multiply them and divide by their greatest common factor. For 12 and 18 the GCF is 6, so the LCM is 12 × 18 ÷ 6 = 36. For more than two numbers, do the first pair and then that answer with the next number.

How do I find the LCM by prime factors?

Write each number as a product of primes and take every prime that appears in any of them, to the highest power it has anywhere. 12 = 2² × 3 and 18 = 2 × 3², so the LCM is 2² × 3² = 36.

What is the LCM of two coprime numbers?

Their product. Coprime numbers share no factor except 1, so the GCF is 1 and the LCM is a × b. The LCM of 5 and 7 is 35, and the LCM of 8 and 15 is 120.

What is the difference between LCM and GCF?

The GCF is the largest number that goes into all of them, so it is never bigger than the smallest. The LCM is the smallest number that all of them go into, so it is never smaller than the biggest. For two numbers, GCF × LCM = a × b.

Why do I need the LCM to add fractions?

It is the smallest common denominator. To add 1/4 and 1/6, use the LCM of 4 and 6, which is 12: 3/12 + 2/12 = 5/12. Any common multiple works, but the LCM keeps the numbers small.

Related calculators

Sources