LCM Calculator
Type in two or more whole numbers and get their least common multiple right away. You also see the steps, so you can learn how the answer was found.
What is an LCM Calculator?
An LCM calculator finds the least common multiple of a group of numbers. The least common multiple, or LCM, is the smallest number that every number in the group divides into with nothing left over.
Take 4 and 6. The multiples of 4 are 4, 8, 12, 16, 20, 24. The multiples of 6 are 6, 12, 18, 24. Both lists include 12 and 24, and the smallest of those is 12. So the LCM of 4 and 6 is 12.
You will use LCM when you add or subtract fractions with different bottom numbers, and when you work out when two repeating things line up. If one bus comes every 12 minutes and another every 18 minutes, they arrive together again after 36 minutes. That is the LCM of 12 and 18.
How to Calculate LCM?
There are three common ways to find the LCM. All of them give the same answer, so pick the one that feels easiest.
Method 1: List the multiples
Write out the multiples of each number, then find the smallest one that appears in every list.
For 6 and 8: the multiples of 6 are 6, 12, 18, 24, 30. The multiples of 8 are 8, 16, 24, 32. The first match is 24, so LCM(6, 8) = 24.
This works well for small numbers. It gets slow when the numbers are big.
Method 2: Prime factorization
- Break each number into prime factors.
- For each prime, pick the highest power that shows up in any of the numbers.
- Multiply those powers together.
For 12 and 18:
12 = 2² × 3
18 = 2 × 3²
LCM = 2² × 3² = 4 × 9 = 36
Method 3: Use the GCD
If you know the greatest common divisor (GCD), you can use a short formula. For 12 and 18 the GCD is 6, so the LCM is (12 × 18) ÷ 6 = 216 ÷ 6 = 36.
LCM Formula Explained
For two numbers, the formula is:
LCM(a, b) = (a × b) ÷ GCD(a, b)
Why does it work? When you multiply a and b, any factors the two numbers share get counted twice. Dividing by the GCD removes that extra copy, and what is left is the smallest number both can divide into.
For three or more numbers, find the LCM of the first two, then find the LCM of that answer and the next number. Keep going until you run out of numbers. For example, LCM(4, 6, 8) = LCM(LCM(4, 6), 8) = LCM(12, 8) = 24.
Two shortcuts are worth remembering:
- If the numbers share no factors (like 5 and 7), the LCM is just their product, 35.
- If one number divides into the other (like 4 and 12), the LCM is the bigger number, 12.
How Does This Calculator Work?
- It reads your numbers and checks that they are whole numbers from 1 to 1,000,000,000,000.
- It breaks each number into prime factors by trial division.
- It keeps the highest power of each prime and multiplies them to get the LCM.
- It also builds the multiples lists and the GCD steps so you can check the answer a second way.
Big-number math is used for the final answer, so a result with 20 or 30 digits is still exact. Everything runs in your browser. Your numbers are never sent to a server. Your recent calculations are saved only on your device, and you can clear them any time.
Examples of LCM Calculations
Example 1: LCM of 12 and 18
12 = 2² × 3
18 = 2 × 3²
LCM = 2² × 3² = 36
Example 2: LCM of 4, 6 and 8
4 = 2²
6 = 2 × 3
8 = 2³
LCM = 2³ × 3 = 8 × 3 = 24
Example 3: LCM of 15 and 20
GCD(15, 20) = 5, so LCM = (15 × 20) ÷ 5 = 300 ÷ 5 = 60.
Example 4: LCM of 5 and 7
Both are prime, so they share nothing. LCM = 5 × 7 = 35.
Quick reference
| Numbers | LCM | Numbers | LCM |
|---|---|---|---|
| 2, 3 | 6 | 9, 12 | 36 |
| 4, 6 | 12 | 10, 15 | 30 |
| 6, 8 | 24 | 12, 15 | 60 |
| 8, 12 | 24 | 14, 21 | 42 |
Want a page built for a certain case? Try the LCM of two numbers, the LCM of three numbers, or the LCM of multiple numbers.
LCM Calculator FAQs
What is LCM?
LCM stands for least common multiple. It is the smallest positive number that two or more numbers all divide into evenly. For example, the LCM of 4 and 6 is 12, because 12 is the first number that appears in both the 4 times table and the 6 times table.
How do you calculate LCM?
There are three common ways. You can list the multiples of each number until you find the first one they share. You can break each number into prime factors and multiply the highest power of every prime. Or you can use the formula LCM(a, b) = (a × b) ÷ GCD(a, b). This calculator shows the first two methods and the formula for your numbers.
What is the difference between LCM and GCF?
The LCM is the smallest number that all your numbers divide into. The GCF (greatest common factor, also called GCD) is the largest number that divides into all of them. For 12 and 18, the LCM is 36 and the GCF is 6. The LCM is always as big as or bigger than your numbers, and the GCF is always as small as or smaller than them.
Can this calculator find LCM of 3 numbers?
Yes. Pick the "Three numbers" tab, or use the "Multiple numbers" tab to enter up to 10 numbers at once. The steps are shown for every number you enter.
Is this LCM calculator free?
Yes. It is free to use, you do not need to sign up, and there is no limit on how many times you can use it.
What is the LCM of two prime numbers?
It is just the two numbers multiplied together. Primes share no factors other than 1, so the LCM of 5 and 7 is 35.
How big can the numbers be?
You can enter whole numbers from 1 up to 1,000,000,000,000. The calculator uses big-number math, so the answer stays exact even when it has many digits.