LCM Calculator (Least Common Multiple)

Enter two to four whole numbers. Leave the third and fourth at 0 if you only need two.

Updated

Embed this calculator

Paste this code into your page. The calculator runs inside the frame and links back to the full version.

Keep the credit link in place. Do not resell the calculator.

Formula

For two numbers: lcm(a, b) = a × b ÷ gcd(a, b). For more numbers, fold it: lcm(a, b, c) = lcm(lcm(a, b), c).

Worked example

For 4 and 6: gcd is 2, so lcm = 4 × 6 ÷ 2 = 12. Adding 10: lcm(12, 10) = 12 × 10 ÷ 2 = 60.

A large case: the primes 999999937, 999999929 and 999999893 share no factors, so their lcm is their product, 999999759000018810999521389, shown exactly.

Frequently asked questions

What is the least common multiple?

It is the smallest positive number that every number you entered divides into evenly. The LCM of 4 and 6 is 12, because 12 is the first number on both lists of multiples.

How do I calculate the LCM from the GCD?

For two numbers, LCM = a × b ÷ GCD. For 4 and 6 the GCD is 2, so the LCM is 4 × 6 ÷ 2 = 12.

How do I find the LCM of more than two numbers?

Find the LCM of the first two, then the LCM of that result with the next number. For 4, 6 and 10: LCM(4, 6) = 12, then LCM(12, 10) = 60.

When do I need the LCM?

The LCM gives the common denominator when adding fractions and tells you when repeating cycles line up. Buses every 4 and 6 minutes leave together every 12 minutes.

How large can the LCM be?

Each input can be up to 1,000,000,000. The LCM can be far larger than that, so results above 9,007,199,254,740,991 are computed with exact integer arithmetic and shown as the full digit string, never rounded.