Find the least common multiple of two or more integers and see clear steps, prime factors, GCF, and special-case notes.
How to use our Least Common Multiple Calculator
- Enter 2 or more values in Integers using commas, spaces, or new lines, such as 12, 18, 30.
- Use whole numbers only in Integers. Negative numbers are allowed, but decimals and fractions are not.
- Choose a style in Show method: GCD method, Prime factorization, or Both methods.
- Pick an extra result in Also show related result if you want the Greatest common factor, an Least common denominator note, or no extra related result.
- Click Calculate to get the Least common multiple, Normalized inputs used, and the worked explanation.
- Read Warnings or special cases carefully if your list includes 0, repeated numbers, or negative values.
- Sanity-check the answer by making sure the Least common multiple is a multiple of every number in Normalized inputs used and is not smaller than any nonzero input.
Definitions
Least common multiple: The smallest positive whole number that is a multiple of every nonzero input.
Greatest common factor: The largest positive whole number that divides every input evenly.
Normalized inputs used: Your cleaned list after spaces are trimmed and negative integers are changed to absolute values for LCM work.
Prime factorizations: Each number written as a product of prime numbers, such as 12 = 2 x 2 x 3.
Worked steps: The short explanation showing how the calculator built the LCM using the method you chose.
Least common denominator note: A reminder that the LCD for fractions is the LCM of the denominators.
Warning: A message that explains special cases such as zeros, invalid entries, or safe-integer limits.
Common mistakes and quick fixes
Mistake: Typing decimals or fractions in Integers , like 2.5 or 3/4.
Fix: Enter whole numbers only in Integers . If you need fraction work, first use the denominators as integers and then read the Least common denominator note .
Mistake: Entering only one value in Integers .
Fix: Add at least 2 valid integers so the calculator can compare them and find the Least common multiple .
Mistake: Thinking negative signs change the Least common multiple .
Fix: The calculator uses absolute values for LCM work, so check Normalized inputs used to see the cleaned list it actually used.
Mistake: Expecting a normal positive Least common multiple when 0 is mixed with nonzero numbers in Integers .
Fix: Read Warnings or special cases . With 0 and nonzero integers together, the calculator explains that there is no positive LCM under this page's policy.
Mistake: Mixing up Least common multiple and Greatest common factor .
Fix: Use Also show related result set to GCF so you can compare both answers side by side.
Mistake: Choosing a method in Show method and expecting a different final answer.
Fix: The choice in Show method changes only the explanation in Worked steps ; the final Least common multiple stays the same.
Limitations & Key Assumptions / Boundary Conditions
- This calculator is for integers only. Decimals, fractions, words, and empty entries are rejected as errors.
- At least 2 valid integers are required after parsing and cleaning the input.
- Negative integers are allowed, but LCM is reported using absolute values, so the result is nonnegative.
- If 0 appears with any nonzero integer, the page does not report a misleading positive LCM. It explains that no positive LCM is used under this policy.
- If all inputs are 0, the zero-only case is handled separately so the GCD-based formula does not divide by 0.
- Repeated values are allowed and usually do not change the final LCM beyond the normal calculation.
- Very large integers can exceed JavaScript's safe integer limit, so the calculator stops and shows an error instead of risking a wrong answer.
Methodology
How the calculator finds the LCM
The calculator first cleans the list from Integers. It accepts commas, spaces, and new lines as separators. Then it checks that every kept entry is a whole number. Negative inputs are converted to absolute values for the LCM, and the cleaned list is shown in Normalized inputs used.
lcm(a,b) = |a x b| / gcd(a,b)
This two-number rule is used again and again across the list [2][3].
LCM(a1,a2,...,an) = lcm(...lcm(lcm(a1,a2),a3)...,an)
That means the calculator combines the first two numbers, then combines that result with the next number, and keeps going until the list is finished.
Prime-factor method shown in steps
If you choose Prime factorization or Both methods, the calculator also writes each number as a product of primes.
If ai = product of p^(e_i,p), then LCM = product of p^(max e_i,p)
In plain words, look at every prime that appears, keep the highest power of that prime from any one input, and multiply those highest powers together.
Worked mini-example
Example: for 12 and 18, the gcd is 6, so the LCM is found this way.
lcm(12,18) = |12 x 18| / gcd(12,18)
lcm(12,18) = 216 / 6 = 36
The prime-factor view matches it: 12 = 2 x 2 x 3 and 18 = 2 x 3 x 3, so keep 2 x 2 and 3 x 3.
LCM = 2^2 x 3^2 = 4 x 9 = 36
If you also show GCF, you can compare the pair:
GCF = 6 and LCM = 36.
How GCF is found
The Greatest common factor is the largest positive integer that divides every cleaned input evenly. For two numbers, it is the gcd. For longer lists, the calculator applies gcd across the list one step at a time in the same iterative way.
Zero and special-case policy
The page uses an explicit rule for zero so the result is not misleading. If one or more zeros are mixed with nonzero integers, the calculator does not give a normal positive LCM. Instead, it explains the case in Warnings or special cases. If all inputs are 0, that zero-only case is handled separately.
The Least common denominator note is only an interpretation aid: when working with fractions, the LCD is the LCM of the denominators [1]. It does not change the LCM calculation itself.
Assumptions used
The method assumes integer inputs, exact arithmetic within JavaScript safe-integer limits, and an LCM reported as the least positive common multiple when defined. If intermediate products would exceed the safe limit, the calculator shows an error instead of estimating.