alleasycalc
Suggest
Least Common Multiple Calculator

Least Common Multiple Calculator

Paste two or more whole numbers and see their least common multiple worked out three ways at once: prime factorisation, working via the greatest common factor, and, for smaller answers, listing multiples side by side. All three land on the same figure, so you can check one against another.

Your numbers

2 whole numbers read. Separate them with commas, spaces or new lines; zero is fine to include, but decimals and negative numbers are dropped and listed below.

What the least common multiple is

The least common multiple is the smallest whole number that every number in a list divides into exactly, with nothing left over. Take 4 and 6: their multiples are 4, 8, 12, 16… and 6, 12, 18, 24…, and the first value both lists reach is 12, so 12 is their LCM. No smaller whole number is a multiple of both, which is exactly why it earns the word "least" in its name.

This page finds that answer for any list of two or more whole numbers, then shows the working three separate ways, since school and textbook questions ask for each of them by name. All three methods below always agree; picking between them is really about which suits the numbers in front of you, not about accuracy.

Method one: prime factorisation

Every whole number above 1 breaks down into a unique product of prime numbers, its prime factorisation. Write out the prime factorisation of every number in the list, note every prime that turns up anywhere at all, then multiply those primes together using the highest power any one of them reaches. That product is the LCM.

LCM = (product of every prime that appears anywhere in the list, each at its HIGHEST power)

Worked through with 12 and 18: 12 breaks down to 2²×3, and 18 breaks down to 2×3². Between the two, the highest power of 2 is 2² (from 12) and the highest power of 3 is 3² (from 18), so the LCM is 2²×3², which is 4×9, 36. Notice this is the exact mirror image of finding a greatest common factor: a GCF multiplies the primes every number shares at their LOWEST power, while an LCM multiplies every prime that shows up anywhere at its HIGHEST power. This calculator factorises numbers up to 1,000,000,000 by trial division and says so plainly when a number is too large for that; method two below has no such limit, since it never needs a factorisation at all.

Method two: via the GCF

The least common multiple and the greatest common factor are a matched pair: for exactly two numbers a and b, their product always equals their GCF multiplied by their LCM. Rearranged, that gives a direct shortcut to the LCM once the GCF is known.

LCM = (a × b) ÷ GCF

The GCF itself is found with Euclid's algorithm: divide the larger number by the smaller and note the remainder, then repeat with the smaller number and that remainder, again and again, until a division comes out exact. The last number divided by before that exact division is the GCF. Worked through with 12 and 18: 18 divided by 12 leaves a remainder of 6; 12 divided by 6 leaves 0 exactly, so the GCF is 6. The LCM follows straight away: (12×18)÷6, which is 216÷6, 36, the same answer as method one. Euclid's algorithm is named after the Greek mathematician who described it more than two thousand years ago, and it stays fast even on numbers far too large to factorise by trial division, which is why this page always runs it regardless of size.

With more than two numbers in the list, that clean a×b shortcut only applies to one pair at a time, so the working folds along the whole set instead: find the LCM of the first two, then find the LCM of that result and the third number, then the fourth, and so on. The LCM of the final pair is the LCM of the entire list, since lcm(a, b, c) is the same value as lcm(lcm(a, b), c) however the numbers are grouped.

Method three: listing multiples

The most direct method of all is also the slowest: write out the multiples of each number in turn and read off the first one every list has in common. For 4 the multiples are 4, 8, 12, 16…; for 6 they are 6, 12, 18…. The first value that appears on both lists is 12, the same answer as the other two methods.

This calculator only shows a multiples listing while the LCM itself is 400 or smaller. Above that, reaching the shared value takes so many rows per number that reading the table is more error-prone than helpful, and the prime factorisation or via-the-GCF working above already has the exact answer without the extra scrolling.

The GCF shown alongside

Every result on this page also states the greatest common factor (GCF) of the same list, since the two values are worked out together in method two and it is useful to see both side by side. A dedicated greatest common factor calculator covers the GCF on its own, in the same three-methods format as this page, if that is the value you actually need.

Coprime numbers: when the LCM is the plain product

Two numbers are called coprime, or relatively prime, when their greatest common factor is exactly 1, meaning they share no factor larger than 1. When a pair is coprime their LCM collapses to the simplest case of all: it is just a×b, their plain product, since there is no shared factor to divide out. 7 and 13 show this cleanly: neither shares a prime with the other, so their LCM is 7×13, 91, with nothing smaller doing the job. Coprime does not require either number to be prime itself, only that the two share nothing bigger than 1.

Choosing your numbers and reading the results

The box on this page accepts a pasted list exactly as it comes: commas, spaces and new lines all work as separators, and a list copied straight out of a spreadsheet column reads cleanly. Only whole numbers count towards the answer; anything written with a decimal point, a negative sign, or text that is not a number at all is left out of the calculation and listed underneath the box with the reason, so nothing vanishes without explanation. Zero is worth knowing about on its own: by convention the LCM of any list that includes 0 is 0, since 0 is the only number that 0 is ever a multiple of, so there is no smaller positive shared multiple to find.

The result card leads with the headline LCM, then draws every number entered to scale so a long list still shows its shape rather than only the final figure, followed by a second chart showing the largest number in the list against the LCM, since the LCM can never be smaller than that. The three worked methods follow underneath in full, and either the prime factorisation or the multiples-listing section may say it is hidden rather than show a broken or unreadably long working, always with a plain reason why. Large coprime numbers are the case worth watching: two big numbers that share no common factor produce an LCM close to their full product, which can run to a very large figure indeed. Every result here runs on exact BigInt arithmetic rather than ordinary floating-point numbers, so the answer stays precise however many digits it reaches; the only concession for readability is the comma grouping used to display it.

Where the LCM is actually used

Adding or subtracting two fractions with different denominators is the most common everyday use: the LCM of the two denominators is the smallest common denominator either fraction can be safely converted to, which keeps the numbers involved as small as possible rather than multiplying the denominators together blindly. A dedicated fraction calculator carries this out automatically as part of adding two fractions, using exactly the working shown above.

The LCM also answers timing and cycle questions: if one bus leaves every 12 minutes and another every 18 minutes from the same stop, they next leave together after their LCM, 36 minutes. The same logic covers a pair of traffic lights on independent cycles meeting back at green together, or two gears with different tooth counts lining their marked teeth back up after the LCM of the two counts' worth of rotations. Anything that repeats on its own fixed cycle, alongside something else on a different cycle, meets back at the start after the LCM of the two cycle lengths, not before.

Questions people ask

What is the difference between the LCM and the LCD?

Nothing mathematically when the numbers involved are denominators. The least common denominator used when adding fractions is exactly the least common multiple of those denominators; LCD is simply the name used in that particular context.

Which method should I use, prime factorisation, via the GCF, or listing multiples?

Listing multiples is the most direct for small numbers but gets slow once the LCM runs into the hundreds. Prime factorisation suits numbers you can break down by eye or with a bit of trial division. Working via the GCF is the fastest of the three and the only one that stays practical for very large numbers, since Euclid's algorithm never needs a factorisation at all.

What is the LCM of a number and zero?

0, by convention. The only multiple 0 ever produces is 0 itself, so 0 is the smallest number that both a and 0 are multiples of, whatever a is. This does break the neat a × b = GCF × LCM shortcut, which is exactly why that identity is stated as holding for two positive numbers.

Can the LCM of two numbers ever be smaller than one of them?

No. The LCM has to be a multiple of every number in the list, so it can never be smaller than the largest number entered; at most it equals that largest number, which happens whenever the largest number is itself a multiple of all the others.

What does it mean if two numbers are coprime?

It means their GCF is 1, so they share no common factor bigger than 1. Their LCM then collapses to the plain product of the two numbers, since there is nothing shared to divide back out.

Why is the multiples-listing method sometimes hidden?

Once the LCM itself is above 400, reaching the shared value can take dozens of rows for one or more of the numbers in the list, which is long enough to be more likely to cause a mistake than prevent one. Prime factorisation and the via-the-GCF working above still give the exact LCM regardless of size.

Does the order I enter my numbers in matter?

Not for the final LCM, which comes out the same whatever order the list is typed in. Order only affects which number is labelled first in the working and which bar appears first on the charts.

Every result on this page comes from exact whole-number arithmetic; nothing here is rounded or approximated at any step.

Report a bug

Say what went wrong and where. One sentence is plenty; we read every report.

Embed this calculator

Paste this into your page. The frame sizes itself to fit. Embedding is free while AllEasyCalc grows; the small credit link stays visible.

Email this result

The email comes from AllEasyCalc and carries a link that reopens this calculator with the numbers filled in. One-off, no mailing list.

Suggest a calculator

Name the question you want answered. If it can be worked out, it goes on the build list.