LCM Calculator

Least common multiple of two numbers.

Inputs

Loading calculator…
Calculating…
Was this helpful?

Formula

LCM(a, b) = |a × b| ÷ GCD(a, b)

The least common multiple is the smallest positive integer divisible by both a and b. It's computed by multiplying the two numbers and dividing by their greatest common divisor.

Worked example

The LCM of 12 and 18 is 36 — the smallest number that both 12 and 18 divide into evenly. GCD(12, 18) is 6, and (12 × 18) ÷ 6 = 36.

Where this can give the wrong answer

  • Both inputs must be at least 1 — zero or negative values aren't meaningful for LCM in this calculator's integer model.
  • When a and b are coprime (GCD = 1), the LCM is simply their product — LCM(7, 11) = 77.
  • If one number divides the other, the LCM equals the larger number — LCM(6, 18) = 18.

FAQ

Finding a common denominator when adding fractions (e.g. 1/12 + 1/18 needs denominator 36), synchronising repeating events (buses every 12 and 18 minutes meet every 36 minutes), and other 'smallest shared multiple' problems.