GGfor Tools

LCM Calculator

Find the least common multiple of two or more integers. Calculate exactly with large numbers, inspect GCD-based steps and copy the LCM result.

Enter 2โ€“100 integers, each with at most 100 digits. Separate values with spaces, commas, semicolons or line breaks. Commas always separate numbers; write one thousand as 1000, not 1,000.

Enter integers, then calculate the LCM.

LCM calculation steps

            

Least common multiple guide

What is the least common multiple?

For nonzero integers, the LCM is the smallest positive integer divisible by every input. Multiples of 4 are 4, 8, 12 and so on; multiples of 6 are 6, 12, 18 and so on. Their first positive common multiple is 12. The LCM of 4, 6 and 8 is 24.

How is LCM calculated using GCD?

For positive a and b, lcm(a, b) = (a / gcd(a, b)) ร— b. The tool computes the GCD with the Euclidean algorithm, divides first and then multiplies. For 12 and 18, the GCD is 6, so the LCM is (12 / 6) ร— 18 = 36. For a list it combines the running LCM with each next value.

Negative numbers, zero, one and repeated values

Negative signs do not affect the LCM: lcm(-4, 6) = 12. Including 1 or repeating a value does not increase the running LCM. If any input is zero, no positive common multiple exists; this calculator returns 0 by convention, including lcm(0, 0). Every input is validated before applying the zero rule.

Common denominators and repeating intervals

The LCM of positive fraction denominators gives the least common denominator: 6 and 8 give 24. For events starting together and repeating every 4 and 6 units, the next shared interval is 12 units. This assumes a common start and fixed intervals; it does not calculate calendar dates or adjust fraction numerators.

Exact results, limits and the GCD product rule

BigInt arithmetic keeps integer results exact, even beyond ordinary JavaScript number precision. Up to 100 integers of 100 digits each are accepted, with a 12000-character input limit. For two integers, gcd(a, b) ร— lcm(a, b) = |a ร— b|. Do not apply that product rule unchanged to longer lists. Calculation stays in your browser; shared website resources may still load.

Example calculations

lcm(4, 6) = 12
lcm(4, 6, 8) = 24
lcm(12, 18) = 36
lcm(-4, 6) = 12
lcm(1, 7) = 7
lcm(0, 24) = 0
lcm(0, 0) = 0

Related tools