Least Common Multiple Calculator

About this calculator

Enter two or more positive whole numbers separated by commas and this calculator returns their least common multiple (LCM): the smallest positive number that every one of them divides evenly.

You also get the greatest common divisor (GCD) and the work shown three ways: prime factorization, listing multiples, and the pairwise GCD method.

Positive whole numbers, up to 18 digits each.
Embed this calculator

Paste this code into a Custom HTML block on your site. The calculator fits the width of the block. Adjust the height in the code if you want more room for results.

Find this widget in the publisher directory

What is the least common multiple?

The least common multiple of a set of whole numbers is the smallest positive number that is a multiple of every number in the set. A multiple of 6 is anything you reach by counting by sixes (6, 12, 18, 24 and so on), and a multiple of 4 is anything reached by counting by fours (4, 8, 12, 16...). The first value on both lists is 12, so the LCM of 4 and 6 is 12. It is also called the lowest common multiple or smallest common multiple.

LCMs show up whenever two repeating cycles need to line up. If one bus leaves every 12 minutes and another every 18 minutes, both depart together every 36 minutes, because 36 is the LCM of 12 and 18. The same idea is what lets you add fractions: the least common denominator of 5/12 and 7/18 is 36.

Three ways to find it

Listing multiples

Write out multiples of each number until one value turns up in every list. For 18 and 26 the multiples of 18 run 18, 36, 54, and so on, while those of 26 run 26, 52, 78, and so on. The two lists first meet at 234. This works fine for small numbers but gets slow when the answer is large, so the calculator shows the full list only when it is short and abbreviates it otherwise.

Prime factorization

Break each number into primes, then build the LCM from every prime at the highest power it reaches in any single number. For 21, 14 and 38:

  • 21 = 3 × 7
  • 14 = 2 × 7
  • 38 = 2 × 19

The primes involved are 2, 3, 7 and 19, each appearing to the first power at most, so LCM = 2 × 3 × 7 × 19 = 798.

Using the greatest common divisor

For two numbers, the product of the LCM and the GCD equals the product of the numbers themselves:

LCM(a, b) = a × b ÷ GCD(a, b)

For more than two numbers, apply that identity step by step: find LCM of the first two, then the LCM of that result with the third, and so on. With 21, 14 and 38: GCD(14, 38) = 2, so LCM(14, 38) = 266; then GCD(266, 21) = 7, so LCM(266, 21) = 798. Same answer, and this route stays quick even for huge numbers because the Euclidean algorithm never needs factoring.

Worked example with four numbers

Take 330, 75, 450 and 225. Their factorizations are 330 = 2 × 3 × 5 × 11, 75 = 3 × 5 × 5, 450 = 2 × 3 × 3 × 5 × 5 and 225 = 3 × 3 × 5 × 5. The highest powers are 2 (once), 3 (twice), 5 (twice) and 11 (once), so the LCM is 2 × 9 × 25 × 11 = 4,950. Every input divides 4,950 exactly, and no smaller positive number does.

Useful facts

SituationLCM
One number divides the other (for example 6 and 18)The larger number
Numbers share no prime factor (for example 8 and 15)Their product
Consecutive integers n and n + 1n × (n + 1)
Any set containing 1The LCM of the other numbers

LCM and GCD together

The two ideas mirror each other. The GCD uses the lowest power of each shared prime, while the LCM uses the highest power of every prime that appears. That is why the calculator reports both numbers: if you know one for a pair, the other follows from the product rule above.

Common mistakes

  • Multiplying all the numbers together gives a common multiple, but usually not the least one.
  • Forgetting that a prime repeated within one number counts at its full power (75 contributes 5 × 5, not a single 5).
  • Mixing up LCM and GCD: the LCM is never smaller than the largest input, while the GCD is never larger than the smallest.

Enter your own list above to see the work for any set of up to thirty numbers.

Frequently asked questions

How do you find the LCM of two numbers?

List the prime factorization of each, then multiply every prime at its highest power. Or compute a × b ÷ GCD(a, b). For 12 and 18, the GCD is 6, so the LCM is 12 × 18 ÷ 6 = 36.

What is the LCM of numbers that share no factors?

When the numbers are coprime, the LCM is simply their product. For example, LCM(8, 15) = 120.

Is the LCM the same as the lowest common denominator?

For fractions, yes. The least common denominator of several fractions is the LCM of their denominators, which is why LCMs are used when adding or subtracting fractions.

Can the LCM be smaller than one of the numbers?

No. The LCM must be a multiple of every number in the list, so it is at least as large as the biggest one.

Formulas and sample results on this page were checked against independent references. Page last reviewed or updated . How we verify calculators. Project led by Shaun Connell.