Skip to content

LCM Calculator

Enter two or more whole numbers to find their least common multiple, with the prime factorization method written out.

MathUpdated Free · No sign-up

How to use the LCM Calculator

  1. Type or paste Whole numbers (Two or more positive whole numbers).
  2. Read your answer in the results panel. It updates as you type, and the breakdown, step-by-step working and any charts or tables appear below it.
  3. Use Share link to save or send the exact calculation, or Copy to paste the results elsewhere.

What the LCM is

The least common multiple of a set of whole numbers is the smallest positive number that every one of them divides into exactly. The LCM of 4 and 6 is 12: the multiples of 4 are 4, 8, 12, 16, … and the multiples of 6 are 6, 12, 18, …, and 12 is the first one they share.

Method 1: prime factorization

Write each number as a product of primes, then take every prime that appears, raised to the highest power it reaches in any of the numbers.

Example: the LCM of 12, 18 and 30.

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

Highest powers: 2², 3² and 5. So LCM = 4 × 9 × 5 = 180. This method works for any number of inputs and makes it easy to see why the answer is right.

Method 2: using the GCD

For two numbers there is a fast shortcut:

lcm(a, b) = a × b ÷ gcd(a, b)

For 12 and 18 the greatest common divisor is 6, so lcm = 12 × 18 ÷ 6 = 36. For more than two numbers, apply it repeatedly: lcm(12, 18, 30) = lcm(36, 30) = 36 × 30 ÷ 6 = 180. The calculator shows this as a check whenever the numbers are small enough.

Where the LCM is used

  • Adding fractions: the lowest common denominator of 1/12 + 1/18 is lcm(12, 18) = 36.
  • Scheduling: if one bus comes every 12 minutes and another every 18, they arrive together every 36 minutes.
  • Gears and cycles: two gears with 12 and 30 teeth return to their starting positions together after 60 teeth have passed.

Tips

  • The LCM is always at least as large as the largest number in the list.
  • If two numbers share no prime factors (they are coprime), their LCM is simply their product.
  • LCMs grow quickly with many inputs. The calculator uses exact big-integer arithmetic, so the answer stays exact even beyond 16 digits.
  • The numbers must be positive whole numbers; the LCM is not defined for fractions in this sense.

Frequently asked questions

How do I find the LCM of two numbers?

Divide their product by their greatest common divisor. For 8 and 12: 8 × 12 ÷ 4 = 24.

What is the difference between LCM and GCF?

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

What is the LCM of two prime numbers?

Their product, because they share no common factors. For example lcm(7, 11) = 77.

Why is the LCM useful for fractions?

The LCM of the denominators is the lowest common denominator, the smallest denominator that lets you add or subtract the fractions directly.