HomeMath › LCM

LCM Calculator

LCM (Least Common Multiple)
Show the math
Enter values to see the worked formula.

What Your Result Means

How This Calculator Works

The calculator uses the gcd-based formula: lcm(a, b) = |a × b| ÷ gcd(a, b). For multiple numbers, it computes the LCM sequentially—first finding lcm(first two numbers), then lcm(that result and the third number), and so on. It also shows the prime factorization of each input using trial division, which reveals the structure of each number and helps you understand why the LCM is what it is. All intermediate calculations are performed using standard algorithms optimized for speed and accuracy.

Quick Questions

Why do I need LCM when working with fractions?

To add or subtract fractions with different denominators, you need a common denominator—a number that both denominators divide into. The LCM is the smallest such number, making arithmetic simpler and results cleaner.

How does LCM relate to GCF?

The greatest common factor (GCF) is the largest number that divides all inputs evenly. The LCM and GCF are connected by the formula: lcm(a, b) × gcd(a, b) = a × b. They are complementary concepts in number theory.

What happens with zero or negative numbers?

This calculator accepts only positive integers. Zero and negative numbers are filtered out before calculation. If all inputs are invalid, the result shows "—" and no calculation is performed.

Sources

Method & review

MethodologyHow we calculate this Reviewed & Updated2026-04 Next review2027-04

Estimate only. Results reflect your inputs and standard formulas. Double-check important decisions independently.