Least Common Multiple (LCM) Calculator
Enter two or more whole numbers to find the smallest number that every one of them divides into evenly. The prime factorisation of each number is shown so you can check the working.
What the least common multiple is
A multiple of a number is what you get by multiplying it by a whole number. The common multiples of 4 and 6 include 12, 24 and 36, and the smallest of them, 12, is the least common multiple. It is the first moment two repeating cycles line up again.
The prime factor method
Write each number as a product of primes. For each prime that appears anywhere, keep its highest power, then multiply those together. For 12 = 2² × 3 and 18 = 2 × 3², the highest powers are 2² and 3², so the LCM is 4 × 9 = 36. With three numbers such as 4, 6 and 10 the same rule gives 2² × 3 × 5 = 60.
The faster route for two numbers is LCM(a, b) = a × b ÷ GCF(a, b). Dividing first, as in a ÷ GCF × b, keeps the intermediate numbers small and avoids overflow in other software. This calculator uses exact integer arithmetic, so large results stay exact.
Where the LCM helps
- Common denominators. To add 1/4 and 1/6, use the LCM 12 as the denominator, giving 3/12 + 2/12. The fraction calculator does the whole process.
- Schedules. Events repeating every 4, 6 and 10 days coincide every 60 days, counted from the day they start together.
- Gears and patterns. The LCM of two tooth counts shows how many teeth pass before the starting pair meets again.
Checking an LCM by hand
Every input must divide the result exactly, and no smaller positive number should do so. The table row showing how many times each number goes into the LCM helps: for 4, 6 and 10 and the LCM 60 it reads 15, 10 and 6 times. A useful sanity test is that the LCM is never smaller than the largest input and never larger than the product of all inputs. When the numbers are coprime in pairs the product is exactly the LCM; otherwise shared primes make it smaller, and that saving is what the prime factor method captures.
Notes and limits
Inputs must be positive whole numbers up to one trillion. The LCM of several numbers can be far larger than any one of them, and values beyond about nine quadrillion are shown exactly in the result text but lose precision in other fields. If the numbers share no factor other than 1, the LCM is simply their product. See the GCF calculator for the greatest common factor and the steps behind it.
Worked example
Three buses leave a stop every 4, 6 and 10 minutes. The LCM tells you after how many minutes they all leave together again.
Inputs
| Whole numbers | 4, 6, 10 |
|---|
Result
Least common multiple of 4, 6, 10.
| LCM | 60 |
|---|---|
| Built from the highest power of each prime | 2^2 × 3 × 5 = 60 |
| Matching GCF | 2 |
| Each number goes into the LCM | 15, 10, 6 times |
Prime factorisation of each number
| Number | Prime factors |
|---|---|
| 4 | 2^2 |
| 6 | 2 × 3 |
| 10 | 2 × 5 |
Accuracy note: Results use standard double-precision arithmetic, so very large or very small values may be rounded. Check important results by another method.
Frequently asked questions
What is the LCM of 12 and 18?
The multiples of 12 are 12, 24, 36 and those of 18 are 18, 36, so the first shared one is 36. By primes: 2² × 3² = 36.
How do I find the LCM of three numbers?
Factor each number into primes and multiply the highest power of every prime that appears. Alternatively, find the LCM of two numbers and then the LCM of that result with the third.
Is LCM the same as lowest common denominator?
For fractions, the lowest common denominator is the LCM of the denominators. The two ideas are the same calculation applied to different problems.
What is the LCM of two numbers with no common factor?
It is their product. For 8 and 15 there is no shared prime, so the LCM is 120.
Can I include 1?
Yes. Since 1 divides every number, including it never changes the LCM.
Related calculators
References and sources
- Euclid, Elements Book VII, for the relationship between the greatest common divisor and the least common multiple.
- Hardy, G. H. and Wright, E. M., An Introduction to the Theory of Numbers, on prime factorisation and multiples.