LCM Calculator

The least common multiple (LCM) of two or more numbers is the smallest number that all of them divide into exactly. This LCM calculator finds it with two methods: taking the highest power of each prime factor, and the formula LCM = product ÷ GCF. Both methods must agree.

Try:

How to use the lcm calculator

  1. Enter two or more whole numbers, separated by commas.
  2. Press Calculate.
  3. See the LCM, the prime factorisations and the GCF check.

Formula

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

Worked example: 12, 18

  • Numbers: 12, 18

✓ Answer checked

3636
Step-by-step working (3 steps)
  1. Prime factorise each number Prime factorisation

    Write each number as a product of primes.

    12=22×318=2×32\begin{gathered}12 = 2^{2} \times 3\\18 = 2 \times 3^{2}\end{gathered}
  2. Take the highest powers

    Use every prime that appears, each to its highest power.

    22×32=362^{2} \times 3^{2} = 36
  3. Check with the GCF lcm(a,b) = ab / gcd(a,b)

    For two numbers, LCM = product ÷ GCF.

    lcm⁡(12,18)=12×186=36\operatorname{lcm}(12, 18) = \frac{12 \times 18}{6} = 36
Formulas used
lcm⁡(a,b)=a×bgcd⁡(a,b)\operatorname{lcm}(a, b) = \frac{a \times b}{\gcd(a, b)}
How this was checked
  • ✓ 36 is a multiple of every number.
  • ✓ The prime-power method gives the same result.

Frequently asked questions

What is the LCM of 12 and 18?

36. It is the smallest number that both 12 and 18 divide into.

How do I find the LCM with prime factors?

Prime factorise each number, then multiply each prime to its highest power. 12 = 2² × 3 and 18 = 2 × 3², so the LCM is 2² × 3² = 36.

When do I use the LCM?

To find a common denominator when adding fractions, or to work out when repeating events happen together.

Related calculators

Related guides