Menu

LCM Calculator

Least common multiple of any set of numbers, three ways, with the working shown.

By Nethanel Bar, Co-founder & CEO

Last updated

Want to solve these without the calculator?

The Coddy math course teaches the method itself - you work each step on an interactive board and get told exactly where a move went wrong.

What the least common multiple is

A multiple of a number is what you get by multiplying it by a whole number: the multiples of 4 are 4, 8, 12, 16, and so on forever. A common multiple of two numbers appears in both of their lists. The least common multiple is the smallest number in both lists - the first place the two counting patterns meet.

The LCM of 4 and 6 is 12, because 12 is the first number that is both a multiple of 4 and a multiple of 6. That is genuinely all the definition says, and if you ever lose track of a method you can always fall back to writing out the two lists.

Where it earns its keep is adding fractions. To add 1/4 and 1/6 you need a common denominator, and the least common multiple of 4 and 6 gives you the smallest one available - 12, so 3/12 + 2/12 = 5/12. Any common multiple would work; the least one just leaves you less to simplify afterwards.

What to watch for in the working

  • The prime table shows the exponent each number contributes for every prime. For an LCM you take the highest of each column - that is the whole rule in one picture.
  • A prime that appears in only one number still goes into the LCM at full strength. The LCM has to be a multiple of both, so nothing can be dropped.
  • The multiples listing is the definition made visible. If the two methods disagree, the listing is the one to trust.
  • For exactly two numbers, product ÷ GCF = LCM. This is the fastest hand method and a free check on the other two.

How to find the LCM of two numbers

  1. Enter your numbers

    Type two or more whole numbers separated by commas or spaces - 12, 18 or 4 6 8. Up to ten at once.

  2. Read the answer, then pick a method

    The LCM is at the top. Below it, the same answer is reached three ways: prime factorisation, listing the multiples, and the product-over-GCF shortcut. Follow whichever one your class is using.

  3. Check the prime table column by column

    Each row is a prime and each column a number. The highlighted cell in each row is the highest exponent, which is the one the LCM takes. Multiplying the right-hand column gives the answer.

  4. Use the listing to convince yourself

    If a method ever feels like a trick, look at the multiples listing. The first number that appears in every row is the LCM, straight from the definition.

Common LCM answers

The pairs that come up most often in homework, with the reason rather than just the result.

NumbersLCMWhy
4 and 6122² from 4, 3 from 6
12 and 18362² from 12, 3² from 18
3 and 515No shared prime, so the LCM is just 3 × 5
6 and 8242³ from 8, 3 from 6
10 and 15302 from 10, 3 from 15, 5 from both
8, 9 and 215042³, 3² and 7 - one prime from each
1 to 1025202³ · 3² · 5 · 7

Worked examples

LCM of 12 and 18

plain
12, 18

12 = 2² · 3 and 18 = 2 · 3². For each prime take the higher exponent: 2² from the 12 and 3² from the 18, giving 2² · 3² = 4 · 9 = 36. The listing confirms it - the multiples of 12 are 12, 24, 36 and the multiples of 18 are 18, 36, so 36 is the first they share. The shortcut agrees too: 12 × 18 = 216, and 216 ÷ 6 = 36.

LCM of 3 and 5 - when there is nothing shared

plain
3, 5

3 and 5 are both prime and different, so they share no factor. When that happens the LCM is simply the product: 15. This is why the LCM of two primes, or of any two coprime numbers, is never smaller than multiplying them together.

Adding 1/4 and 1/6

plain
4, 6

The LCM of 4 and 6 is 12, so 12 is the least common denominator. Rewriting gives 3/12 + 2/12 = 5/12, which needs no simplifying. Using 24 instead - also a common multiple - would have given 6/24 + 4/24 = 10/24, correct but with an extra reduction step to do.

LCM of three numbers: 8, 9 and 21

plain
8, 9, 21

8 = 2³, 9 = 3², 21 = 3 · 7. Taking the highest power of each prime across all three: 2³ from the 8, 3² from the 9, and 7 from the 21. That gives 8 · 9 · 7 = 504. Note the 3 in 21 contributes nothing, because the 9 already supplies a higher power of 3.

Common mistakes

  • Confusing LCM with GCF. The least common multiple is at least as large as your largest number; the greatest common factor is no larger than your smallest. If your answer is on the wrong side of the inputs, you solved the other problem.
  • Multiplying the numbers together and stopping. That gives a common multiple, but the least one only when the numbers share no factor. For 12 and 18 it gives 216 rather than 36.
  • Taking the lowest exponent in the prime table. That is the GCF rule. For an LCM you take the highest.
  • Dropping a prime that appears in only one number. The LCM must be a multiple of every input, so every prime present has to survive.
  • Using product ÷ GCF on three or more numbers. That identity only holds for exactly two.
  • Assuming the LCM is always the product of the two. It is only when they are coprime.

LCM FAQ

What is the LCM of two numbers?
The least common multiple is the smallest positive whole number that both of them divide into exactly. For 4 and 6 it is 12: the first number that appears in both times tables.
What is the difference between LCM and GCF?
The LCM is the smallest number they both go INTO; the GCF is the largest number that goes into BOTH of them. For 12 and 18 the LCM is 36 and the GCF is 6. A quick check: the LCM is never smaller than your biggest input and the GCF is never bigger than your smallest.
How do you find the LCM by prime factorisation?
Break each number into primes, then for every prime that appears anywhere, take the highest power of it you see, and multiply those together. For 12 = 2² · 3 and 18 = 2 · 3², you take 2² and 3², giving 36.
What is the easiest way to calculate the LCM by hand?
For two numbers, find their greatest common factor and use LCM = (a × b) ÷ GCF. For 12 and 18 that is 216 ÷ 6 = 36. It is usually faster than factorising both, especially when the GCF is obvious.
What is the LCM of 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10?
2520. It is 2³ · 3² · 5 · 7 - the highest power of each prime up to 10. This one comes up often because it is the smallest number divisible by every single digit.
Can the LCM be one of the numbers you started with?
Yes, whenever one number is a multiple of the other. The LCM of 4 and 12 is 12, because 12 is already a multiple of 4 and no smaller number could be.
Why do I need the LCM for fractions?
To add or subtract fractions you need a common denominator, and the LCM of the denominators gives you the smallest one. Any common multiple works, but the least one means the least simplifying afterwards.

More math tools

Coddy programming languages illustration

Learn math with Coddy

GET STARTED