Skip to content
SmartDailyCalculator

LCM Calculator

Enter two or more integers to find their least common multiple, with the pairwise GCF work and prime-factor method shown when practical.

Separate values with commas, spaces or semicolons. Do not use thousands separators; enter 1000, not 1,000.

Least common multiple

180

GCF-based calculation
lcm(12, 18) = (12 ÷ 6) × 18 = 36; lcm(36, 30) = (36 ÷ 6) × 30 = 180
Prime factorizations
12 = 2^2 × 3; 18 = 2 × 3^2; 30 = 2 × 3 × 5
LCM from highest prime powers
2^2 × 3^2 × 5 = 180

How to use the LCM Calculator

  1. Enter at least two whole numbers, separated by commas, spaces or semicolons.
  2. Include negative values or zero if needed; the calculator uses exact integer arithmetic.
  3. Read the least common multiple and compare the GCF-based working with prime factorization when the inputs are small enough to factor efficiently.

Least common multiple formulas

lcm(a,b)=|a×b|gcd(a,b)
lcm(a,b,c)=lcm(lcm(a,b),c)
Prime-factor method: use the greatest exponent of each prime

Where:

a,b,c
= integers
gcd
= greatest common divisor (GCF)
Show as plain text

lcm(a, b) = |a × b| ÷ gcd(a, b) lcm(a, b, c) = lcm(lcm(a, b), c)

The least common multiple is the smallest positive integer divisible by every nonzero input. For two inputs, divide their product by their greatest common divisor; dividing before multiplying keeps the calculation exact.

With prime factorization, keep the highest power of every prime that appears in any input. A zero input makes the LCM zero; negative signs do not change the positive LCM.

Assumptions and limitations

  • Enter 2 to 15 integers, each with at most 100 digits. Results use BigInt arithmetic and are not restricted to JavaScript's safe-number range.
  • Prime-factorization detail is shown only when every input is nonzero and no larger than 1,000,000,000 in absolute value; the GCF-based LCM remains exact for larger inputs.
  • The LCM of a set containing zero is defined as zero here; when all inputs are zero, the GCF-based formula is not used to divide by zero.

Example: Find the LCM of 12, 18 and 30

  1. First find gcd(12, 18) = 6, so lcm(12, 18) = (12 ÷ 6) × 18 = 36.
  2. Next find gcd(36, 30) = 6, so lcm(36, 30) = (36 ÷ 6) × 30 = 180.
  3. Prime factors are 12 = 2² × 3, 18 = 2 × 3² and 30 = 2 × 3 × 5. The highest powers give 2² × 3² × 5 = 180.

When to use the LCM Calculator

  • Finding a common denominator before adding fractions with different denominators; then use the fraction calculator to finish the arithmetic.
  • Finding when repeating schedules with different intervals line up again.
  • Checking the relationship between the LCM and the GCF calculator for two or more integers.

LCM Calculator FAQs

Can the LCM include negative numbers?

Yes. The LCM is conventionally reported as nonnegative, so a negative input is treated by its absolute value. For example, the LCM of −4 and 6 is 12.

What happens if one of the numbers is zero?

The calculator returns zero because zero is divisible by every nonzero integer. It avoids applying the product-over-GCF formula when that would require division by zero.

How is the LCM related to the GCF?

For two nonzero integers, their absolute product equals the LCM multiplied by the GCF. The GCF calculator shows the Euclidean algorithm used to find that shared factor.

How this calculator was built and tested is explained in our methodology. Spotted a problem? Let us know.