LCM Calculator

Find the least common multiple of two whole numbers. Enter the numbers, and this LCM calculator gives the LCM, the greatest common factor and the prime factorization of each number. For a longer list of numbers, use the LCM and GCF calculator instead.

A positive whole number.

A positive whole number.

Formula: LCM(a, b) = (a x b) / GCF(a, b), where GCF is the greatest common factor found with the Euclidean algorithm.

How to Use the LCM Calculator

Enter two whole numbers and the calculator finds their least common multiple, the greatest common factor and the prime factorization of each number.

  1. Enter the first whole number. The example uses 12.
  2. Enter the second whole number. The example uses 18.
  3. Press Calculate, or press Enter. The LCM appears first and large, with the GCF and the prime factors below.
  4. Press Reset to clear the form and start over.
A photo of a student writing multiples of 12 and 18 in two columns on a whiteboard and circling the first number in both columns
The multiples of 12 and 18 first meet at 36, so the LCM of 12 and 18 is 36.

The LCM Formula

The least common multiple of two numbers is the smallest positive number that both of them divide into exactly. The fastest way to find it uses the greatest common factor, or GCF.

The formula is LCM(a, b) = (a x b) / GCF(a, b). The GCF is the largest number that divides both a and b, found with the Euclidean algorithm, which keeps taking remainders until one of them is zero. For 12 and 18, the GCF is 6, so the LCM is (12 x 18) / 6 = 216 / 6 = 36.

The two numbers are linked by a neat identity. LCM x GCF always equals a x b. Here 36 x 6 = 216 = 12 x 18, which is a quick check that the answer is right. Our LCM and GCF calculator finds the LCM and GCF of a longer list of numbers, and our prime factorization calculator breaks any number into primes.

Worked Example: The LCM of 12 and 18

Find the LCM of 12 and 18.

  1. Find the GCF with the Euclidean algorithm. 18 = 1 x 12 + 6, then 12 = 2 x 6 + 0, so the GCF is 6.
  2. Multiply the numbers. 12 x 18 = 216.
  3. Divide by the GCF. 216 / 6 = 36, so the LCM of 12 and 18 is 36.
  4. Check by prime factors. 12 = 2 squared x 3 and 18 = 2 x 3 squared. Take the highest power of each prime, 2 squared x 3 squared = 4 x 9 = 36.

As a second check, the multiples of 12 are 12, 24, 36, 48, and the multiples of 18 are 18, 36, 54. The first number in both lists is 36. The same steps work for any two whole numbers, so try your own numbers in the tool above.

A photo of a notebook page with a handwritten prime factorization tree for the numbers 12 and 18 and a pencil on a wooden desk
12 = 2 squared x 3 and 18 = 2 x 3 squared, so the LCM is 2 squared x 3 squared = 36.

Three Ways to Find an LCM

The listing method is the most direct. Write out the multiples of each number until one appears in both lists. It works well for small numbers, and it shows what the LCM means, but it gets slow when the numbers are large.

The prime factorization method works for any size. Break each number into primes, take the highest power of each prime that appears, and multiply them. For 12 and 18, that is 2 squared x 3 squared = 36. This is the method the calculator shows in its steps.

The GCF method is the fastest for two numbers. Find the GCF with the Euclidean algorithm, then divide the product of the numbers by it. For three or more numbers, find the LCM two at a time. The LCM of 12, 18 and 24 is the LCM of 36 and 24, which is 72. Check it by prime factors. 36 = 2 squared x 3 squared and 24 = 2 cubed x 3, so the highest powers give 2 cubed x 3 squared = 8 x 9 = 72. Our fraction calculator uses the LCM to find a common denominator when you add fractions.

Common Mistakes to Avoid

The most common mistake is confusing the LCM with the GCF. The LCM is the smallest number both numbers divide into, and it is always at least as large as the larger number. The GCF is the largest number that divides both, and it is never larger than the smaller number. For 12 and 18, the LCM is 36 and the GCF is 6.

A second mistake is multiplying the numbers and stopping there. The product 216 is a common multiple of 12 and 18, but it is not the least one. Always divide by the GCF.

A third mistake is entering zero or a decimal. The LCM is defined for positive whole numbers, so this calculator asks for whole numbers from 1 up. Zero has no least common multiple in school math, and decimals need a different method.

Where the LCM Shows Up in Real Life

Adding fractions is the classic LCM job. To add 1/12 and 1/18, you need a common denominator, and the smallest one is the LCM, 36. The sum is 3/36 + 2/36 = 5/36.

Schedules use the LCM too. Two buses that leave every 12 and 18 minutes meet again after 36 minutes. Two lights that blink every 4 and 6 seconds blink together every 12 seconds. Gears, flashing signs and repeating events all line up again after the LCM of their periods.

Music uses it as well. Two rhythms that repeat every 3 and 4 beats line up again after 12 beats. Whenever two cycles repeat, the LCM tells you when they next coincide.

A photo of two buses arriving at the same bus stop at the same time on a city street in natural daylight
Two buses that leave every 12 and 18 minutes meet again after 36 minutes.

Frequently asked questions

How do you find the LCM of 12 and 18?

Use LCM = (12 x 18) / GCF(12, 18). The GCF is 6, so the LCM is 216 / 6 = 36.

What is the LCM of 4 and 6?

The LCM of 4 and 6 is 12. The multiples of 4 are 4, 8, 12, and the multiples of 6 are 6, 12, so 12 is the first number in both lists.

What is the difference between LCM and GCF?

The LCM is the smallest number both numbers divide into, while the GCF is the largest number that divides both. They are linked by LCM x GCF = a x b, so for 12 and 18, 36 x 6 = 216.

What is the LCM of two prime numbers?

Their product, because two different primes share no factor except 1. The LCM of 5 and 7 is 35.

What is the LCM when one number divides the other?

The larger number. The LCM of 3 and 9 is 9, because 9 is already a multiple of 3.

What is the LCM used for?

It finds the smallest common denominator when you add fractions, and it tells you when two repeating events next coincide, like buses leaving every 12 and 18 minutes meeting again after 36 minutes.

Start Calculating Now!

Discover the power of smart tools at KitQuarter.

Explore All Tools