The least common multiple, or LCM, is the smallest positive number that every number in your set divides into evenly. Enter two or more whole numbers and this calculator returns the LCM along with the greatest common divisor. For 4 and 6 the LCM is 12, the first multiple both numbers share.
Least common multiple
Calculations run in your browser. Inputs are not sent to our servers; anything you Save stays in this browser only.
Saved results (0)
How to Use the LCM Calculator
- Type or paste two or more whole numbers, separated by commas, spaces or new lines.
- The least common multiple appears instantly, along with the greatest common divisor.
- Use the LCM to add fractions, sync repeating events or solve number-theory problems.
Here is what each result means:
| Result | What it means |
|---|---|
| Least common multiple | The smallest number every input divides into evenly. |
| Greatest common divisor | The largest number that divides every input, shown for comparison. |
| Numbers used | How many valid whole numbers were read from your list. |
What Is the Least Common Multiple?
The least common multiple of a set of whole numbers is the smallest positive number that each of them divides into without a remainder. Every set of numbers has infinitely many common multiples, and the LCM is simply the first one you reach when counting upward.
It is the natural partner of the greatest common divisor. Where the GCD is the largest factor numbers share, the LCM is the smallest multiple they share, and the two are linked by a neat rule for any pair: a * b = gcd(a,b) * lcm(a,b).
How the LCM Calculator Works
It finds the LCM two numbers at a time, using the greatest common divisor to keep the result exact and avoid overflow.
lcm(a, b) = a / gcd(a, b) x bFor a pair, the LCM is lcm(a,b) = (a * b) / gcd(a,b). For more numbers it folds the list together, taking the LCM of the running result with each new value, so lcm(a,b,c) = lcm(lcm(a,b),c).
- Find the greatest common divisor of the first two numbers.
- Multiply them and divide by that divisor to get their LCM.
- Repeat, combining the running LCM with each remaining number.
Dividing by the GCD first keeps the numbers small, which matters for large inputs.
LCM Example
Find the LCM of 4 and 6. Their greatest common divisor is 2, so lcm(4,6) = (4 * 6) / 2 = 12. Twelve is the first number both 4 and 6 divide into evenly.
Add a third number, 8. The LCM of 12 and 8 has GCD 4, giving (12 * 8) / 4 = 24, so the LCM of 4, 6 and 8 is 24. Listing multiples confirms it: 24 is the smallest value that appears in the times tables of all three.
For coprime numbers such as 3, 5 and 7, which share no factors, the LCM is simply their product, 105.
LCM vs GCD Compared
The two ideas are opposites that work together, and telling them apart avoids a lot of confusion.
| Idea | What it finds | For 12 and 18 |
|---|---|---|
| LCM | Smallest shared multiple | 36 |
| GCD | Largest shared factor | 6 |
Notice that 12 times 18 is 216, which equals 6 times 36, the GCD times the LCM. To explore the plain factors behind these, the percentage calculator is not the tool, but a factor list is a good next step.
What Changes the LCM Result
The LCM depends entirely on the numbers and their shared factors, and a few patterns are worth knowing.
Shared Factors
The more factors numbers have in common, the smaller their LCM relative to their product, because less multiplication is needed to line them up.
Coprime Numbers
When numbers share no common factor, their LCM is simply the product of them all, the largest it can be.
One Number Dividing Another
If the largest number is a multiple of the rest, it is itself the LCM, as with 3, 6 and 12.
Adding a Number
Each new value can only keep the LCM the same or push it higher, never lower.
When to Use an LCM Calculator
Adding and Subtracting Fractions
The LCM of the denominators is the least common denominator, the smallest base that lets you combine fractions cleanly.
Syncing Repeating Events
Two events that repeat every few days next coincide after the LCM of their cycles, useful for schedules and gears.
Number-theory and Coding Problems
Many puzzles and algorithms rely on the LCM to find the first shared point of two or more cycles.
Common Mistakes
1. Confusing LCM with GCD
The LCM is the smallest shared multiple; the GCD is the largest shared factor. They are opposites.
2. Just Multiplying All the Numbers
That gives a common multiple, but not the least one unless the numbers are coprime.
3. Forgetting to Divide by the GCD
For a pair, multiply then divide by the GCD; skipping that step overshoots the true LCM.
4. Using Non-whole Numbers
The LCM is defined for positive whole numbers. Decimals and negatives are ignored here.
5. Stopping at the First Common Multiple You Spot
List carefully; the least common multiple is easy to overshoot by eye.
Accuracy and Limitations
The result is exact for the whole numbers you enter, using integer arithmetic that avoids rounding.
What it calculates accurately
- The LCM of any set of positive whole numbers
- The greatest common divisor of the same set
- The count of valid numbers read
What it does not account for
- Decimals, fractions or negative numbers
- Extremely large values beyond safe integer limits
- Zero, which has no least common multiple
- Algebraic expressions rather than plain numbers
How We Calculate the LCM
Frequently Asked Questions About the LCM
What is the least common multiple?
It is the smallest positive number that every number in your set divides into evenly. For 4 and 6 the LCM is 12, the first multiple both share.
How do you find the LCM of two numbers?
Multiply them and divide by their greatest common divisor: lcm(a, b) = a x b / gcd(a, b). For 4 and 6 that is 24 / 2 = 12.
What is the LCM of 4 and 6?
It is 12. The multiples of 4 are 4, 8, 12 and of 6 are 6, 12, so 12 is the smallest they share.
What is the difference between LCM and GCD?
The LCM is the smallest multiple numbers share, while the GCD is the largest factor they share. For any pair, a x b equals gcd times lcm.
How do I find the LCM of three or more numbers?
Take the LCM of the first two, then the LCM of that result with the next number, and so on. This calculator folds the whole list for you.
What is the LCM used for?
Most often to find a least common denominator when adding fractions, and to work out when two repeating cycles or events next line up.
What is the LCM of coprime numbers?
If numbers share no common factor, their LCM is simply the product of them all. For 3, 5 and 7 the LCM is 105.
Can the LCM be smaller than the largest number?
No. The LCM is always at least as large as the biggest number in the set, and equals it when that number is a multiple of the others.
Is anything I enter stored?
No. The calculation runs in your browser, and nothing you enter is sent anywhere unless you Save a result, which stays on this device only.
Sources
- Least common multiple (Maths Is Fun).
- Least common multiple (Wikipedia).
- Greatest common factor (Maths Is Fun).
Related Calculators
Looking for more math and number tools?
Explore all math calculatorsThis calculator is for general study and math help. It finds the least common multiple of the whole numbers you enter; always double-check against your own working when it counts for an exam. Spotted an error? Let us know.
Creator
Hamza Shakeel is the Chief Technology Officer at MultiCalculators.com, responsible for the platform's technical architecture, calculator engine performance, and infrastructure reliability. He leads engineering efforts focused on site speed, mobile responsiveness, Core Web Vitals optimization, and security. Hamza ensures every calculation runs accurately and instantly across all devices, while maintaining the platform's stability and scalability as it grows. His work directly supports the seamless, trustworthy experience users expect from MultiCalculators.com.
Areas of Expertise: Web Engineering, Core Web Vitals, Site Performance, Calculator Logic, Cloud Infrastructure, Security
