LCM Calculator – Least Common Multiple and GCF with Steps

Find the least common multiple and the greatest common factor of up to 10 numbers, with the prime factorization shown step by step.

Runs in your browser 100% free No sign-up
Quick answer

The least common multiple (LCM) is the smallest number that all your numbers divide into. For 12 and 18 it is 36, and their greatest common factor (GCF) is 6. A quick check: LCM × GCF = 12 × 18 = 216.

How to use LCM & GCF Calculator

  1. Type two or more whole numbers, separated by commas or spaces (for example 12, 18, 30).
  2. The LCM and GCF appear instantly.
  3. Read the prime factorization of every number below the result to see how the answer was found.
  4. Click “Copy” to copy both results.

What are the LCM and GCF?

The least common multiple (LCM) of two or more numbers is the smallest positive number that each of them divides into exactly. It is what you need to add fractions with different denominators: to add 1/12 and 1/18 you rewrite both over 36. The greatest common factor (GCF) — also called the greatest common divisor (GCD) or highest common factor (HCF) — is the largest number that divides all of them. You use it to simplify fractions: 12/18 becomes 2/3 after dividing both by 6.

Method 1: prime factorization

Break every number into primes:

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

For the LCM, take every prime with its highest power: 2² × 3² = 36. For the GCF, take only the primes they share with their lowest power: 2 × 3 = 6. This method works for any number of values, which is why the calculator shows it.

Method 2: list the multiples

Write out multiples until one appears in every list. Multiples of 4: 4, 8, 12, 16, 20 … Multiples of 6: 6, 12, 18 … The first shared one, 12, is the LCM. This is easy for small numbers but slow for big ones.

Method 3: the formula

For two numbers, LCM(a, b) = a × b ÷ GCF(a, b). Find the GCF with Euclid’s algorithm — divide the larger number by the smaller and keep the remainder until it is zero — then use the formula. For 8 and 12: the GCF is 4, so the LCM is 8 × 12 ÷ 4 = 24.

Common pairs

NumbersLCMGCF
4 and 6122
6 and 8242
8 and 12244
12 and 18366
15 and 20605

Popular worked examples: LCM of 12 and 18, LCM of 6 and 8 and LCM of 15 and 20. For graphing homework, try the Slope Calculator.

You may also find these free tools useful: GPA Calculator, Slope Calculator and Standard Deviation Calculator.

Popular calculations

Frequently asked questions

How do you find the LCM of two numbers?

Write both numbers as products of primes and multiply every prime with its highest power. Or divide the product of the numbers by their GCF.

What is the LCM of 12 and 18?

The LCM of 12 and 18 is 36, and the GCF is 6.

What is the difference between LCM and GCF?

The LCM is the smallest number all values divide into; the GCF is the largest number that divides all values. The LCM is always at least as big as the largest number, the GCF never bigger than the smallest.

Can the calculator handle more than two numbers?

Yes. Enter up to 10 whole numbers. The LCM and GCF are found for all of them together.

What if the GCF is 1?

Then the numbers are coprime (they share no prime factors), and their LCM is simply their product. For example, the LCM of 8 and 9 is 72.

Last updated: