Skip to main content
LC

LCM Calculator (Least Common Multiple)

Find the smallest number that two or more whole numbers all divide into evenly, calculated instantly.

Did you like the tool? Thanks!
Share:

How to Use LCM Calculator (Least Common Multiple)

Enter a comma-separated list of two or more positive whole numbers. The calculator finds the least common multiple (LCM) by reducing the list pairwise using the relationship between LCM and GCF, updating live as you type.

About LCM Calculator (Least Common Multiple)

The least common multiple (LCM) of a set of whole numbers is the smallest positive whole number that every number in the set divides into evenly, with nothing left over. Where the GCF answers "what is the largest number that fits evenly into all of these," the LCM answers the opposite question: "what is the smallest number that all of these fit evenly into." The two ideas are closely related mathematical siblings, and this site's GCF Calculator uses the exact same underlying algorithm. To understand LCM intuitively, imagine two buses that leave the same station: one every 4 minutes, and another every 6 minutes. If they both leave together right now, how many minutes until they leave together again at the same time? You need the smallest number that both 4 and 6 divide into evenly — the multiples of 4 are 4, 8, 12, 16, 20, 24…, and the multiples of 6 are 6, 12, 18, 24…. The smallest number appearing in both lists is 12. So the buses next leave together in 12 minutes. That is the LCM of 4 and 6. This "listing multiples" approach works for small, simple numbers but becomes impractical fast for larger ones. The efficient method used by this calculator instead relies on a neat mathematical identity connecting LCM and GCF: for any two positive integers a and b, LCM(a, b) × GCF(a, b) = a × b. Rearranging that gives LCM(a, b) = (a × b) ÷ GCF(a, b). Since the GCF can be computed very quickly using the Euclidean algorithm, this formula lets you find the LCM of even very large numbers almost instantly, without ever listing out multiples. Let's work through an example with bigger numbers: 21 and 6. First find their GCF using the Euclidean algorithm: 21 mod 6 = 3, then 6 mod 3 = 0, so GCF(21, 6) = 3. Now apply the LCM formula: LCM(21, 6) = (21 × 6) ÷ 3 = 126 ÷ 3 = 42. You can verify this: the multiples of 21 are 21, 42, 63…, and the multiples of 6 are 6, 12, 18, 24, 30, 36, 42…, and indeed 42 is the smallest number appearing in both lists. When working with more than two numbers, the same pairwise-reduction trick used for GCF applies here too: find the LCM of the first two numbers, then find the LCM of that result and the third number, and so on. For example, the LCM of 4, 6, and 10: LCM(4, 6) = 12 (as calculated using the formula: (4×6)÷GCF(4,6) = 24÷2 = 12). Then LCM(12, 10) = (12×10) ÷ GCF(12, 10) = 120 ÷ 2 = 60. So LCM(4, 6, 10) = 60. A crucial edge case is what happens if zero is included in the list. LCM is mathematically undefined when zero is involved, because every non-zero number is technically a "multiple" of zero only in the trivial sense that 0 × anything = 0, and there is no smallest positive multiple that zero and another positive number both share — the concept simply breaks down. This calculator detects a zero in the list and shows a clear message rather than an incorrect or misleading number. A common misconception is confusing LCM with GCF, since both deal with the same two numbers and are calculated using related methods. The easiest way to remember which is which: GCF is always less than or equal to the smaller of your numbers (it fits into them), while LCM is always greater than or equal to the larger of your numbers (they fit into it). Practical uses for LCM include adding fractions with different denominators (finding a common denominator is exactly an LCM problem), scheduling recurring events, and any situation involving cycles that need to synchronize.

Details & Tips

**Formula:** lcm(a, b) = |a × b| ÷ gcd(a, b), where gcd is found via the Euclidean algorithm. For more than two numbers, reduce pairwise: lcm(lcm(lcm(n1, n2), n3), n4), and so on. **Worked example 1:** Find the LCM of 8 and 12. First, gcd(8, 12): 12 mod 8 = 4, then 8 mod 4 = 0, so gcd(8, 12) = 4. LCM = (8 × 12) ÷ 4 = 96 ÷ 4 = 24. Check: multiples of 8 are 8, 16, 24…; multiples of 12 are 12, 24…; the smallest shared value is indeed 24. **Worked example 2 (three numbers):** Find the LCM of 4, 5, and 6. LCM(4, 5): gcd(4,5) = 1 (they share no common factor), so LCM(4,5) = (4×5)÷1 = 20. Now fold in 6: LCM(20, 6). gcd(20, 6): 20 mod 6 = 2, then 6 mod 2 = 0, so gcd(20,6) = 2. LCM(20, 6) = (20×6)÷2 = 120÷2 = 60. So LCM(4, 5, 6) = 60. **How this calculator parses input:** Numbers are entered as a comma or space-separated list. Each token must be a whole number (integers only, since LCM is not conventionally defined for fractional inputs); non-integer or negative tokens are ignored, and a hint explains this if any were dropped. **Edge cases handled:** - A zero anywhere in the list → the result shows a dash (—) with a hint explaining that LCM is undefined when 0 is included, rather than returning 0 or an incorrect value. - Fewer than 2 valid whole numbers → no result is calculated, since LCM requires at least two numbers to compare. - Identical numbers in the list (e.g. 9 and 9) correctly return that same number as the LCM. - Coprime numbers (sharing no common factor besides 1, like 8 and 9) correctly return their straightforward product as the LCM (72 in this case), since GCF = 1 leaves the formula unchanged. - Large inputs are handled using standard JavaScript number precision; extremely large products are flagged rather than silently producing rounding errors. **Practical tip:** LCM is exactly the tool you need whenever you must add or subtract fractions with different denominators — the smallest common denominator you were taught to find in school is simply the LCM of the two denominators. It is equally useful for real-world scheduling: if one task repeats every 15 days and another every 40 days, the LCM (120 days) tells you exactly when both tasks will next coincide on the same day. For the related but opposite question — the largest number that divides evenly into a group of numbers, useful for splitting quantities into equal groups — use the companion GCF Calculator on this site.

Frequently Asked Questions

What is the least common multiple (LCM)?
It is the smallest positive whole number that every number in a given list divides into evenly, with no remainder.
How is LCM calculated from GCF?
Using the formula LCM(a, b) = (a × b) ÷ GCF(a, b), which is much faster than listing out multiples, especially for large numbers.
Why is LCM undefined when 0 is in the list?
Because there is no smallest positive multiple that zero and another positive number both share, so the calculation is mathematically undefined.
Can I find the LCM of more than two numbers?
Yes, this calculator reduces the whole list pairwise, combining the LCM of the first two numbers with each subsequent number in turn.
What is the LCM of two coprime numbers?
It is simply their product, since coprime numbers share no common factor besides 1, so GCF = 1 leaves the LCM formula unchanged.
How is LCM used when adding fractions?
The lowest common denominator used to add or subtract fractions with different denominators is exactly the LCM of those denominators.
Does the calculator accept decimal numbers?
No, LCM is only meaningful for whole numbers, so decimal entries are ignored automatically.
What is the LCM of a number and itself?
It is that number itself, since a number is trivially a multiple of itself.
Is LCM always bigger than the numbers in my list?
It is always greater than or equal to the largest number in the list, since every number in the list must divide into it evenly.
How is LCM different from GCF?
GCF is the largest number that divides evenly into your numbers, while LCM is the smallest number that your numbers divide evenly into — opposite relationships.
Does this tool store or send my data?
No, all calculation happens locally in your browser using plain JavaScript, with nothing transmitted to a server.

Also Available As

LCM calculator, least common multiple, LCM finder, lowest common multiple calculator, common denominator calculator, multiple finder

Found a Problem?

Let us know if something with LCM Calculator (Least Common Multiple) isn't working as expected.

Thanks — we'll take a look.