Least Common Multiple Calculator
What is the smallest number that both integers divide into evenly?
Enter two integers and find their least common multiple (LCM) — the smallest positive number that both numbers divide into evenly. Perfect for fraction arithmetic, scheduling problems, and mathematical operations.
—
Send feedback
💡 Share your idea or report a problem
✓ Thanks! We'll take a look.
Learn more
How It Works
The formula, explained simply
The Least Common Multiple Calculator finds the smallest positive integer that both input numbers divide into evenly. This tool uses the mathematical relationship between LCM and GCD (Greatest Common Divisor): LCM(a,b) = |a × b| ÷ GCD(a,b).
The calculator first finds the GCD using Euclid's algorithm, which repeatedly applies the division algorithm until the remainder is zero. For example, with numbers 12 and 18, the GCD is 6, so the LCM becomes (12 × 18) ÷ 6 = 36. This method is much more efficient than listing multiples of each number until finding a common one.
The result shows not just the LCM value, but contextual information about why that particular number emerged. If the LCM equals one of the input numbers, it means one divides the other evenly. If the LCM equals both numbers multiplied together, they share no common factors (are coprime). Otherwise, the LCM is smaller than their product because the numbers share common factors that reduce the final result.
When To Use This
Right tool, right situation
Use the LCM calculator whenever you need to find common denominators for fraction arithmetic. Adding 1/12 + 1/18 requires finding LCM(12,18) = 36, then converting to 3/36 + 2/36 = 5/36. This is essential for any fraction-heavy calculations in cooking, construction, or engineering measurements.
Scheduling problems are another prime application. If one task repeats every 6 days and another every 9 days, they'll coincide again after LCM(6,9) = 18 days. This applies to shift schedules, maintenance cycles, delivery routes, or any situation where multiple periodic events need coordination.
In programming and computer science, LCM helps with cycle detection, memory allocation, and timing synchronization. Musical applications use LCM to find when different rhythmic patterns align — if one instrument plays every 4 beats and another every 6 beats, they'll sync again after LCM(4,6) = 12 beats. The tool becomes indispensable whenever multiple periodic systems need to find their next common occurrence point.
Common Mistakes
Why results sometimes look wrong
The most common error is confusing LCM with GCD, especially when the numbers have obvious common factors. Remember that LCM finds the smallest number both inputs go into, while GCD finds the largest number that goes into both inputs. They're mathematical inverses in many ways.
Another frequent mistake is manually listing multiples for large numbers instead of using the LCM formula. For numbers like 84 and 90, listing multiples could take dozens of steps, while the formula gives you 1,260 immediately. Always use the relationship LCM(a,b) = (a × b) ÷ GCD(a,b) for efficiency.
When working with negative numbers, remember that LCM is defined for positive integers. The calculator automatically uses absolute values, but this can surprise users who expect the result to somehow reflect the negative inputs. Similarly, many people incorrectly assume that LCM of two numbers is always larger than both numbers, but when one number divides the other, the LCM equals the larger number.
The Math
Worked examples and deeper derivation
The mathematical foundation of LCM calculation rests on the fundamental theorem of arithmetic and the relationship with greatest common divisors. Every integer greater than 1 can be expressed as a unique product of prime factors, and the LCM contains the highest power of each prime that appears in either number's factorization.
For computational efficiency, the calculator uses the identity LCM(a,b) × GCD(a,b) = |a × b|. This relationship exists because when you multiply two numbers, you're combining all their prime factors. The GCD accounts for the overlapping factors that get counted twice, so dividing by the GCD gives you exactly the factors needed for the least common multiple.
The algorithm handles edge cases mathematically: LCM with zero always equals zero (since zero has no positive multiples), and negative numbers are converted to their absolute values since LCM is defined for positive integers. Large number calculations are bounded by JavaScript's maximum safe integer to prevent overflow errors.
Common questions
Need something this doesn't cover?
Suggest a tool — we'll build it →