LCM Calculator

Quick answer

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.

Updated 2026-09-06Reviewed by Prof. Dr. Khalil Mudassar, PhD
Try
Math and Number Theory
Enter two or more whole numbers separated by commas, spaces or new lines.

Least common multiple

--
Greatest common divisor--
Numbers used--

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

  1. Type or paste two or more whole numbers, separated by commas, spaces or new lines.
  2. The least common multiple appears instantly, along with the greatest common divisor.
  3. Use the LCM to add fractions, sync repeating events or solve number-theory problems.

Here is what each result means:

ResultWhat it means
Least common multipleThe smallest number every input divides into evenly.
Greatest common divisorThe largest number that divides every input, shown for comparison.
Numbers usedHow 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.

Formula: lcm(a, b) = a / gcd(a, b) x b

For 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).

  1. Find the greatest common divisor of the first two numbers.
  2. Multiply them and divide by that divisor to get their LCM.
  3. 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.

IdeaWhat it findsFor 12 and 18
LCMSmallest shared multiple36
GCDLargest shared factor6

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

Method
Fold the list with lcm(a,b) = a / gcd(a,b) x b, using the Euclidean GCD.
Inputs used
A list of whole numbers separated by commas, spaces or new lines.
Also shown
The greatest common divisor and the count of numbers used.
Assumptions
Positive whole numbers; values are rounded to the nearest integer.
Rounding
None on the result; inputs are rounded to whole numbers first.
Edge cases
A single number returns itself; non-positive values are ignored.
Last reviewed
2026-09-06.

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

Related Calculators

Looking for more math and number tools?

Explore all math calculators

This 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
Chief Technology Officer (CTO) at  ~ Web ~  More Posts

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