Home › Math & Science › LCM Calculator

LCM Calculator

Find the least common multiple of two to six numbers in seconds with this free LCM calculator. It does not just hand you the answer — it shows the prime factorisation of every number, builds the LCM step by step the way your maths teacher wants to see it, and gives you the GCD (greatest common divisor) of the same numbers as a bonus. Perfect for homework, fraction sums and lining up repeating schedules.

Enter at least two positive whole numbers, each up to 1,00,00,000 (one crore). Leave the extra boxes empty if you do not need them.

LCM of 12 and 18 is 36
GCD is 6 · 36 is the smallest number that both 12 and 18 divide into exactly
Prime factorisation steps:
  1. 12 = 2 × 2 × 3 = 2² × 3
  2. 18 = 2 × 3 × 3 = 2 × 3²
  3. Take the highest power of every prime: 2² × 3²
  4. Multiply them: 4 × 9 = 36

How to use

  1. Type your first two numbers in Number 1 and Number 2.
  2. Add up to four more numbers in the optional boxes if you need the LCM of a bigger set.
  3. Press Find LCM — the answer also updates as you type.
  4. Read the LCM in big type, check the GCD underneath, and follow the factorisation steps in the box below to see exactly how the answer was built.

Common LCM pairs

NumbersLCMNumbersLCM
4 and 61210 and 1530
6 and 82412 and 1836
8 and 12249 and 1236
5 and 73514 and 2142
15 and 206016 and 2448

How it works

A multiple of a number is what you get when you multiply it by 1, 2, 3 and so on: the multiples of 12 are 12, 24, 36, 48, 60… and the multiples of 18 are 18, 36, 54, 72, 90… The numbers that appear in both lists — 36, 72, 108 — are the common multiples, and the smallest of them is the least common multiple, the LCM. For 12 and 18, that is 36. Listing multiples works for small numbers, but it gets painfully slow for big ones, so this calculator uses prime factorisation instead.

Break each number into primes, take the HIGHEST power of every prime that appears, and multiply: 12 = 2² × 3, 18 = 2 × 3² → LCM = 2² × 3² = 36  |  Also: LCM(a, b) = (a × b) ÷ GCD(a, b)

Prime factorisation means splitting a number into the prime numbers that multiply to make it. 12 splits into 2 × 2 × 3, written with powers as 2² × 3. 18 splits into 2 × 3 × 3, or 2 × 3². To build the LCM, look at each prime in turn and take the highest power of it from any single number: the highest power of 2 is 2² (from the 12), the highest power of 3 is 3² (from the 18). Multiply those together: 4 × 9 = 36. The result is guaranteed to be a multiple of both numbers — it contains every prime factor each number needs — and because we took no more than the highest powers, it is the smallest such number.

For three or more numbers the same idea is applied step by step: find the LCM of the first two, then find the LCM of that answer with the next number, and so on. The factorisation table in the steps box handles all your numbers at once, so you can watch the highest powers being picked. The GCD shown under the result is found the opposite way — it takes the lowest power of the primes the numbers share. The two are linked by a famous shortcut: for two numbers, LCM × GCD = the product of the numbers. Check it with our pair: 36 × 6 = 216, and 12 × 18 = 216. That is also why this page shows the GCD — if you know one, the other is a single division away.

The LCM earns its keep in two everyday places. The first is fractions: to add 1/12 and 1/18 you need a common denominator, and the LCM, 36, is the smallest one — 3/36 + 2/36 = 5/36. The second is anything that repeats on different cycles: buses leaving a stand every 12 and 18 minutes, two machines serviced every few weeks, or gears with different numbers of teeth. Whenever two cycles must line up again, the LCM tells you exactly when. Indian school maths (it is called the LCM, or laghutam samapavartak in Hindi-medium books) introduces it alongside the HCF — the same number this page calls the GCD — usually through exactly the bus and fraction problems above.

Worked example

Two buses leave a depot together at 9:00 in the morning. One route runs every 12 minutes and the other every 18 minutes. After how many minutes do they next leave together?

Step 1: Factorise 12: 12 = 2 × 2 × 3 = 2² × 3.
Step 2: Factorise 18: 18 = 2 × 3 × 3 = 2 × 3².
Step 3: Take the highest powers: 2² from the 12 and 3² from the 18.
Step 4: Multiply: 4 × 9 = 36.

So the buses next leave together after 36 minutes, at 9:36. The calculator opens with 12 and 18 already entered and shows exactly this working: LCM of 12 and 18 is 36, with the GCD of 6 underneath. Listing multiples confirms it — 12, 24, 36 and 18, 36 — 36 is the first number on both lists.

FAQ

What is the LCM of 12 and 18?

The LCM of 12 and 18 is 36. The multiples of 12 are 12, 24, 36, 48 and the multiples of 18 are 18, 36, 54, 72, so 36 is the first number on both lists. By prime factorisation: 12 is 2 squared times 3, 18 is 2 times 3 squared, and taking the highest powers gives 4 times 9, which is 36.

What is the difference between LCM and GCD?

The LCM is the smallest number that all your numbers divide into; the GCD is the largest number that divides all your numbers. For 12 and 18, the LCM is 36 and the GCD is 6. They are linked: for two numbers, LCM times GCD equals the product of the two numbers, so 36 times 6 equals 12 times 18.

How do I find the LCM of three or more numbers?

Use the same prime factorisation method across all the numbers at once: factorise each one, take the highest power of every prime that appears anywhere, and multiply those powers together. Or work in pairs — LCM of the first two, then LCM of that result with the third. This calculator accepts up to six numbers and shows the combined steps.

Why do I need the LCM for fractions?

To add or subtract fractions with different denominators, the denominators must first be made equal, and the LCM is the smallest equal denominator you can use. For 1/12 + 1/18, the LCM of 12 and 18 is 36, so the sum becomes 3/36 + 2/36 = 5/36. Using the LCM keeps the numbers as small as possible.

What is the LCM of two prime numbers?

It is simply the two primes multiplied together, because they share no prime factors. For example, the LCM of 5 and 7 is 35, and the LCM of 11 and 13 is 143. The same holds whenever two numbers share no factor except 1 — their LCM is their product.

What if one number divides the other?

Then the larger number is itself the LCM. For example, 6 divides 24 exactly, so the LCM of 6 and 24 is 24. The prime factorisation shows why: every prime power inside 6 is already inside 24, so nothing extra needs to be added.