Math

LCM Calculator

Work out the least common multiple of two or more numbers in one step.

Least common multiple

24

LCM of 4, 6, 8

For reference, the greatest common divisor of these numbers is 2.

How it works

The least common multiple is the smallest number that every value on your list divides into evenly. For 4 and 6 it's 12, because 12 is the first number both 4 and 6 fit into without a remainder.

Rather than list out multiples by hand, this calculator uses the shortcut LCM(a, b) = a × b ÷ GCD(a, b). It folds that across your whole list, so LCM(4, 6, 8) becomes LCM(LCM(4, 6), 8) = LCM(12, 8) = 24.

Type your numbers with commas or spaces between them. Everything updates live, and if a value slips out of a safe range you'll see a dash instead of a wrong answer.

Frequently asked questions

What's the difference between the LCM and the GCD?

The GCD is the largest number that divides all of your values, while the LCM is the smallest number they all divide into. They're linked: multiply two numbers together and divide by their GCD and you land on the LCM.

Can I enter more than two numbers?

Absolutely. List as many as you like, separated by commas or spaces. The calculator combines them two at a time until it has the LCM of the whole set.

Why do I sometimes see a dash?

The LCM of a big or awkward set can grow past the range JavaScript handles precisely. When that happens, or when a value isn't a positive whole number, you'll get a dash rather than a misleading figure.