LCM Calculator

Find the least common multiple of 2 to 20 whole numbers, with the greatest common factor, each number's prime factors and the working.

Your details

Enter 2 to 20 whole numbers above 0, separated by commas or spaces.

Least common multipleLCM of 12, 18, 30
180
GCF (greatest common factor)
6
12 =
2² × 3
18 =
2 × 3²
30 =
2 × 3 × 5
Working
2² × 3² × 5 = 180

Separate numbers with commas or spaces. Each number can be up to 1,000,000,000,000. Results are exact.

How the LCM is calculated

The LCM is the smallest number that every number in your list divides into evenly.

LCM = product of the highest power of each prime that appears in any number

  • Break each number into prime factors. 12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5.
  • For each prime, take the highest power that appears in any number: 2², 3² and 5.
  • Multiply those together: 4 × 9 × 5 = 180. That is the LCM.
  • The GCF uses the lowest power of primes shared by every number: 2 × 3 = 6.
  • For two numbers there is a shortcut: LCM = a × b ÷ GCF.

Worked example — For 12, 18 and 30: the highest powers are 2², 3² and 5, so the LCM is 2² × 3² × 5 = 180. The GCF is 6.

Things to consider

  • If every other number divides the largest one, the largest number is the LCM.
  • Two numbers with no common factor have an LCM equal to their product, such as 7 × 13 = 91.
  • To add fractions, use the LCM of the denominators as the common denominator.
  • LCM problems often show up as timing questions: when will two buses next leave together?

Frequently asked questions

What is the LCM?

The least common multiple is the smallest positive number that each of your numbers divides into exactly. The LCM of 4 and 6 is 12.

How do I find the LCM with prime factors?

Write each number as prime factors, take the highest power of each prime, and multiply them. For 12, 18 and 30 that is 2² × 3² × 5 = 180.

What is the difference between LCM and GCF?

The LCM is the smallest number all of them divide into. The GCF is the largest number that divides all of them. For 12 and 18, the LCM is 36 and the GCF is 6.

Is there a shortcut for two numbers?

Yes. LCM = a × b ÷ GCF. For 8 and 12: 8 × 12 ÷ 4 = 24.

How does the LCM help with fractions?

The lowest common denominator is the LCM of the denominators. To add 1/4 and 1/6, use 12: 3/12 + 2/12 = 5/12.

How big can the numbers be?

Up to 1,000,000,000,000 each, and up to 20 numbers. The LCM is worked out exactly, however large it gets.

Results are estimates for general information only, not financial, medical or professional advice.