OwnCalculate

Everyday arithmetic

LCM Calculator

Find the least common multiple of a list of whole integers, with an exact result and a clear explanation of what the number means.

Calculation mode

Both modes use the same calculation. Learn mode adds an explanation after a valid result; it does not change your inputs or answer.

Enter 2–100 signed whole integers. Separate entries with commas or whitespace. Each integer may contain 1–100 digits, and the full input may contain up to 12,000 characters. Commas separate entries: 1,000 is interpreted as entries 1 and 000, whose numerical values are 1 and 0.

Exact calculation requires JavaScript with BigInt support.

What the least common multiple tells you

When all inputs are nonzero, the least common multiple (LCM) is the smallest positive integer divisible by every input’s magnitude. It is useful when comparing repeating counts—for example, finding when two whole-number cycles line up. This tool accepts signed integers and handles zero separately using the convention explained below.

How to use this calculator

  1. Enter between 2 and 100 whole integers, separated by commas, spaces, or line breaks.
  2. Use an optional plus or minus sign if needed. Negative values are treated by magnitude.
  3. Choose Calculate LCM to see the full exact result. Decimals, fractions, and scientific notation are not accepted.

Each entry is limited to 100 digits and the raw list to 12,000 characters. These are input limits for this tool, not mathematical limits.

Use Quick Calculate for the result, or Learn Step by Step to see the pairwise GCD reductions and how they produce the same LCM. Switching modes does not change the answer.

Method

For nonzero integers a and b, the pairwise relationship is:

lcm(a,b) = abs(a) / gcd(abs(a),abs(b)) * abs(b)

Here, gcd is the greatest common divisor. Dividing by the GCD before multiplying keeps the intermediate value smaller while preserving the exact result. The calculator applies this relationship across the list using integer arithmetic, so large results are not rounded to fit a decimal approximation.

If any entry is zero, this tool uses the conventional extension that the list LCM is 0. For nonzero entries, the result is the smallest positive common multiple; zero is handled separately by that convention.

Precision and limitations

All accepted integers and the LCM use exact integer arithmetic; no decimal rounding is performed. This is not a decimal, fraction, measurement-conversion or scheduling tool. A long exact answer does not imply that a real-world repeating process follows the integer model.

Worked example: 12 and 30

The greatest common divisor of 12 and 30 is 6. Divide 12 by 6 first, then multiply by 30:

12 / gcd(12, 30) * 30 = 12 / 6 * 30 = 2 * 30 = 60

So 60 is the least common multiple: 60 is divisible by both 12 and 30, and no smaller positive integer is divisible by both.

The GCD step can itself be checked: 30=2×12+6 and 12=2×6, giving gcd(12,30)=6. The final answer checks as 60/12=5 and 60/30=2. Entering −12 instead of 12 leaves that answer unchanged; adding a zero makes the result 0 under the stated convention.

Understanding the result

A nonzero result is the first positive whole-number point shared by all the input multiples. Signs do not make the answer negative, repeated entries do not change it, and changing the order does not change it. If a zero is included, the displayed 0 follows the stated convention rather than describing a smallest positive multiple.

Common mistakes to avoid

  • Do not enter a grouping comma inside one number. Commas separate entries: 1,000 is interpreted as entries 1 and 000, whose numerical values are 1 and 0.
  • Do not confuse LCM with GCD: the LCM is a shared multiple, while the GCD is a shared divisor.
  • Do not enter decimal or fractional notation such as 6.0 or 1/2. This calculator is for integers only.
  • Remember that a minus sign affects neither the magnitude used nor the nonnegative result.

Frequently asked questions

Can I enter negative integers?

Yes. The calculation uses the absolute value of each integer, so a negative input has the same LCM contribution as its positive magnitude.

What happens if one or more entries are zero?

The result is 0 whenever the list contains a zero. This is the convention used by this calculator; it is not a claim that zero is the smallest positive common multiple.

Are decimals or fractions allowed?

No. Enter whole integers only. Decimal notation such as 6.0, fractions such as 1/2, and scientific notation are invalid.

Can it calculate large integers exactly?

The calculator is designed to return an exact integer rather than a rounded decimal. Each entry can have up to 100 digits, with at most 100 entries and 12,000 raw characters overall; results can be very long.

Can I use commas as thousands separators?

No. Commas separate entries: 1,000 is interpreted as entries 1 and 000, whose numerical values are 1 and 0. Enter 1000 without a comma for a single entry.

How many entries can I calculate at once?

Enter 2 to 100 integers. You may separate them with commas, whitespace, or a mixture of both. Empty comma-separated entries are not valid.

References

For further reading on the least common multiple and the integer LCM function: