Integer math calculator

LCM Calculator

Enter two or more integers to calculate their least common multiple. The calculator shows the result and explains how the LCM is derived.

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

What is the LCM?

The least common multiple is the smallest positive integer divisible by every entered nonzero integer. If any input is zero, this calculator returns an LCM of zero.

How to find the LCM

For two nonzero integers, LCM(a,b) = |a × b| ÷ GCF(a,b). For a longer list, apply that relationship successively.

LCM using prime factorization

For 12 and 18, 12 = 2² × 3 and 18 = 2 × 3². Taking the highest exponent of each prime gives 2² × 3² = 36.

LCM vs GCF

LCM finds the smallest shared multiple; GCF finds the largest shared factor. Use the GCF Calculator for greatest-common-factor work.

Methodology sources

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