LCM Calculator
Calculate the Least Common Multiple (LCM) of two or more numbers. Uses prime factorization to find the smallest number that is a multiple of all inputs.
About this calculator
This calculator finds the Least Common Multiple of two to four numbers using LCM(a, b) = |a × b| ÷ GCD(a, b) (lines 25-28), applied iteratively across however many numbers are entered (line 113-116). First Number and Second Number are required; Third Number and Fourth Number default to 0 and are structurally excluded from the calculation whenever they're 0 (line 61-62 only pushes them onto the working list if nonzero) — so Numbers Calculated stays fixed at 2 for any First Number or Second Number value, since those two are always included unconditionally, regardless of what they're set to.
LCM and GCD are genuinely chaotic functions of their inputs: at the defaults (12, 18), the LCM is 36, but nudging Second Number by 10% lands on 16 (floor of 16.2) on the low side and 19 (floor of 19.8) on the high side — and because 12 and 16 still share a factor of 4 while 12 and 19 share none at all, the LCM swings from 48 on the low side to 228 on the high side, a jump driven entirely by whether the two numbers happen to share factors, not by how large either number is. This calculator does not accept 0 as a meaningful input for any of the four number fields (line 65-66 treats any included 0 as invalid and returns "LCM is undefined when any number is 0"), and it does not reduce or simplify the numbers before factoring — all four are floored to integers first (line 54-57) but never validated as positive.
Inputs
Results
Least Common Multiple (LCM)
36
How to Use This Calculator
- Enter two required integers and up to two optional additional integers in the Number fields.
- The Least Common Multiple is the smallest positive integer divisible by all entered numbers, computed as LCM(a,b) = |a × b| / GCD(a,b).
- LCM is essential when adding or subtracting fractions with unlike denominators — the LCM becomes the common denominator.
- For more than two numbers the calculator applies LCM iteratively: LCM(a,b,c) = LCM(LCM(a,b),c).
- Leave optional number fields at 0 to exclude them from the calculation.
- All inputs must be positive integers; the LCM of any number and 0 is undefined.
Recommended for this calculation
We may earn a commission if you sign up through these links.
Graph, solve, and visualize every statistics problem
TI-84 Plus CE Graphing Calculator, Color Screen
See on AmazonWork through problems the way they're meant to be graphed
Mr. Pen Graph Grid Journal Notebook, A5, 160 Pages
See on Amazon417 functions for every equation you'll ever face
Casio fx-991ES Plus 2 Scientific Calculator
See on AmazonTexas Instruments: As an Amazon Associate I earn from qualifying purchases.
Mr. Pen: As an Amazon Associate I earn from qualifying purchases.
Casio: As an Amazon Associate I earn from qualifying purchases.
How the result changes with Second Number
| Second Number | Least Common Multiple (LCM) |
|---|---|
| 100,000,001 | 1,200,000,012 |
| 350,000,000 | 1,050,000,000 |
| 650,000,000 | 1,950,000,000 |
| 899,999,999 | 10,799,999,988 |
What each input means
- First Number
- First number.
- Second Number
- Second number.
- Third Number (Optional)
- Leave as 0 if not needed
How this is calculated
Formula
LCM(a, b) = |a × b| / GCD(a, b)Engine last updated . Checked against 2 independently-derived tests — how we verify calculators.
Frequently Asked Questions
Can I use this to find a common denominator for adding three or four fractions at once?
Yes -- that's a classic use for LCM beyond just two numbers. Enter each fraction's denominator into a Number field, using Third Number and Fourth Number for a three- or four-fraction sum, and the resulting Least Common Multiple is the smallest denominator every fraction converts into cleanly. That beats simply multiplying all the denominators together, which works but usually leaves you simplifying a much larger fraction afterward than the LCM-based denominator would.
Does Numbers Calculated change if I adjust First Number or Second Number?
No — First Number and Second Number are unconditionally included in the working list regardless of their value (line 60), so Numbers Calculated stays at 2 no matter what either one is set to; it only changes when you give Third Number or Fourth Number a nonzero value, adding a third or fourth entry to the list.
If I increase Second Number slightly, will the LCM always increase too?
No, and the swings can be dramatic rather than gradual. At the defaults (12, 18), nudging Second Number down to 16 drops the LCM to 48, but a slightly different nudge that lands on a number sharing no factors with 12, like 19, sends the LCM to 228. The size of the jump depends on whether the two numbers happen to share prime factors, not on whether Second Number went up or down, so there's no steady "raising the input raises the output" trend to state for LCM or GCD themselves.
Is there a quicker way to find the LCM of two numbers by hand instead of full prime factorization?
For just two numbers, listing multiples of the larger one until you hit one that's divisible by the smaller is often faster by hand, especially with small numbers or an obvious shared factor like 2 or 5. Prime factorization earns its keep once you're combining three or four numbers at once, since tracking the highest power of each prime across every number -- what this calculator's Calculation Steps output shows -- stays organized in a way that listing out multiples doesn't scale to nearly as well.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Prime Factorization Calculator
Find the prime factorization of any number. Shows all prime factors, divisors, and whether the number is prime, perfect, abundant, or deficient.
Math & StatisticsGCF/GCD Calculator
Calculate the Greatest Common Factor (GCF) or Greatest Common Divisor (GCD) of two or more numbers. Uses the Euclidean algorithm with step-by-step explanation.
Number TheoryPrime Factorization Calculator
Find the complete prime factorization of any number up to 1,000,000. Shows all prime factors, exponents, and primality.
Math & StatisticsPercentage Calculator
Calculate percentages easily — find a percentage of a number, percentage increase/decrease, and percentage change between two values.
More in Math & Statistics.