Integer math calculator

LCM calculator

Find the least common multiple of two or more whole numbers. The result uses greatest-common-divisor reduction for accuracy and shows prime factorizations so the shared factors behind the answer remain visible.

Two or more integersPrime-factor stepsZero and signs handled

Interactive LCM calculator

Enter known values

Enter the known values and select Calculate.

How to use this calculator

  1. Enter at least two integers separated by commas, spaces, or line breaks.
  2. Use negative integers only when their absolute values are intended.
  3. Select Calculate to find the smallest nonnegative common multiple.
  4. Review the prime factors and reduction sequence.

Formula and method

For two nonzero integers, LCM(a,b) = |a × b| ÷ GCD(a,b). For several integers, apply the same operation successively. If any entered value is zero, the LCM is zero.

Worked example

For 12 and 18, GCD is 6, so LCM = |12 × 18| ÷ 6 = 36. Prime factors confirm 12 = 2² × 3 and 18 = 2 × 3², requiring 2² × 3² = 36.

Assumptions and result interpretation

  • Inputs must be safe whole numbers.
  • Signs do not change the nonnegative least common multiple.
  • Duplicate values are valid but do not change the answer.
  • By the convention used here, a set containing zero has LCM zero.

Understanding the result

The LCM contains each prime factor at the highest exponent needed by any entered integer. That makes it the smallest value divisible by every input.

Common mistakes

  • Multiplying all values without removing shared factors
  • Entering fractions or decimals
  • Confusing LCM with greatest common divisor
  • Ignoring that zero changes the result

Methodology sources

This deterministic utility is a calculation aid. Confirm definitions, required precision, and any course, laboratory, professional, or policy requirements separately.