LCM Calculator
Find the least common multiple (LCM) of 2 to 10 whole numbers, with the prime factors, the HCF and every step of the working.
By Basit MuradReviewed
Two to 10 whole numbers, separated by commas or spaces.
Enter values above to see results
LCM = product of every prime at its highest powerVariables
LCMLeast common multiple: the smallest number every input divides intop^kA prime p raised to the largest power k found in any of the numbersa × bFor two numbers, LCM = a × b ÷ HCF(a, b)Explanation
Each number is broken into prime factors. The LCM must contain every number's factors, so it takes each prime at the highest power that appears in any number, and multiplies them. For two numbers there is a shortcut: divide their product by their highest common factor.
What is the LCM Calculator?
The least common multiple (LCM) of two or more whole numbers is the smallest number that all of them divide into exactly. The LCM of 4 and 6 is 12: it is the first number in both the 4 times table and the 6 times table. You use it to add fractions with different denominators, to find when two repeating events line up again, and in many school maths problems. This calculator finds the LCM of up to 10 numbers at once. It breaks each number into prime factors, builds the LCM from them, and shows the highest common factor (HCF) alongside, so you can see how the two are linked.
For the highest common factor, with Euclid's algorithm step by step, use the HCF Calculator. To learn all five ways to find the LCM by hand, including the ladder and Venn diagram methods, read our guide on how to find the LCM.
How to Use This Calculator
Type your numbers into the box, separated by commas or spaces, for example 12, 18, 30. You can enter from 2 to 10 whole numbers, each up to one trillion. The answer appears as you type: the LCM first, then the HCF, the factors the numbers have in common, and whether they are coprime (share no factor except 1). Under the answer, How we got it lists each number's prime factors and how they combine into the LCM. With exactly two numbers it also checks the result with LCM × HCF = the product of the two numbers.
- Common multiples
- 12, 24
- Check: 4 × 6 ÷ HCF (2)
- 12
- LCM: the smallest common multiple
- 12
LCM of Common Number Pairs
| Numbers | LCM | HCF |
|---|---|---|
| 2 and 3 | 6 | 1 |
| 3 and 4 | 12 | 1 |
| 4 and 6 | 12 | 2 |
| 6 and 8 | 24 | 2 |
| 8 and 12 | 24 | 4 |
| 9 and 12 | 36 | 3 |
| 10 and 15 | 30 | 5 |
| 12 and 15 | 60 | 3 |
| 12 and 18 | 36 | 6 |
| 15 and 20 | 60 | 5 |
| 18 and 24 | 72 | 6 |
| 20 and 30 | 60 | 10 |
LCM of All the Numbers from 1 to n
| Numbers | LCM |
|---|---|
| 1 to 4 | 12 |
| 1 to 5 | 60 |
| 1 to 6 | 60 |
| 1 to 7 | 420 |
| 1 to 8 | 840 |
| 1 to 9 | 2,520 |
| 1 to 10 | 2,520 |
| 1 to 12 | 27,720 |
| 1 to 15 | 360,360 |
| 1 to 20 | 232,792,560 |
Worked Examples
Three numbers by prime factors
Find the LCM of 12, 18 and 30.
- 12
- 2² × 3
- 18
- 2 × 3²
- 30
- 2 × 3 × 5
- Highest powers
- 2², 3² and 5
- LCM
- 4 × 9 × 5 = 180
LCM = 180
The HCF uses the lowest powers of the shared primes instead: 2 × 3 = 6.
Numbers with no common factor
Find the LCM of 15 and 28.
- 15
- 3 × 5
- 28
- 2² × 7
- Shared primes
- none, so the HCF is 1
- LCM
- 15 × 28 ÷ 1 = 420
LCM = 420
When two numbers are coprime, their LCM is simply their product.
When do two buses line up?
Bus A leaves every 12 minutes and bus B every 20 minutes. Both leave at 8:00. When do they next leave together?
- 12
- 2² × 3
- 20
- 2² × 5
- LCM
- 2² × 3 × 5 = 60 minutes
Together again at 9:00
Adding fractions
Work out 5/6 + 3/8.
- Lowest common denominator
- LCM of 6 and 8 = 24
- 5/6
- 20/24
- 3/8
- 9/24
- Sum
- 20/24 + 9/24 = 29/24
29/24, or 1 5/24
The lowest common denominator of two fractions is the LCM of their denominators.
Why Use MyCalculatorsHub's LCM Calculator?
Listing multiples by hand works for small numbers but quickly gets long: the LCM of 1 to 10 is already 2,520. This calculator uses prime factorization, which stays fast for numbers up to a trillion and for up to 10 numbers at once, and it keeps the answer exact even when the LCM is far larger than a phone calculator can show. Every step is written out, so it works as a checker for homework as well as a quick answer. It runs in your browser and needs no sign up.
Common Mistakes to Avoid
The most common mistake is multiplying the numbers together. That gives a common multiple, but not always the least one: 12 × 18 is 216, while the LCM is 36. Multiplying only gives the LCM when the numbers share no factor, like 15 and 28. Another mistake is taking each prime at its lowest power instead of its highest, which gives the HCF instead. With three or more numbers, people often find the LCM of the first two and forget to include the third. Finally, the LCM is never smaller than the largest number: if your answer is, something has gone wrong.
Frequently Asked Questions
What is the LCM?
The least common multiple, or lowest common multiple, is the smallest positive number that every one of your numbers divides into exactly. For 4 and 6 the multiples are 4, 8, 12, 16… and 6, 12, 18…, and the first one they share is 12, so the LCM is 12.
Is the lowest common factor the same as the LCM?
Usually that is what people mean, but the words say something different. A factor divides into a number, and 1 divides into every whole number, so the lowest common factor of any set of numbers is always 1. The useful ideas are the lowest (least) common multiple, the LCM, and the highest common factor, the HCF. This calculator shows both.
How do you find the LCM of two numbers?
There are three common ways. List the multiples of each number until one appears in both lists. Or break both numbers into prime factors and multiply each prime at its highest power. Or divide the product of the two numbers by their HCF: for 12 and 18, 12 × 18 ÷ 6 = 36.
What is the difference between the LCM and the HCF?
The LCM is the smallest number that all your numbers divide into, so it is at least as large as the biggest number. The HCF is the largest number that divides into all of them, so it is at most as large as the smallest number. For 12 and 18, the LCM is 36 and the HCF is 6. For two numbers, LCM × HCF always equals the two numbers multiplied together.
How many numbers can I enter, and how big can they be?
From 2 to 10 whole numbers, each up to 1,000,000,000,000. The LCM itself can be much larger than that, and it is still shown exactly. Leave out 0 and negative signs: the LCM is defined for positive whole numbers.
How We Calculate
Each number is split into prime factors by trial division. The LCM is the product of every prime that appears, each raised to the highest power it has in any of the numbers, and the HCF is the product of the primes found in every number, each at its lowest power. Large results are calculated with exact whole-number arithmetic, so nothing is rounded. With two numbers, the calculator also checks that LCM × HCF equals their product. The HCF is also worked out by Euclid's algorithm on the HCF calculator page, and both methods always agree.
Last reviewed: