Sumivo · Mathematics

LCM Calculator

Find the least common multiple of two or more integers — the smallest positive number they all divide into.

01 / inputs

integers

02 / result

LEAST COMMON MULTIPLE

24

LCM
24
GCD
2
Count
3

Calculation trace

  1. lcm(4, 6) = 4 × 6 ÷ gcd(2) = 12
    12
    LCM step 1
  2. lcm(12, 8) = 12 × 8 ÷ gcd(4) = 24
    24
    LCM step 2

Maintained by Jack Shi

§

How it works

The least common multiple (LCM) is the smallest positive integer that every input divides into with no remainder. The tool folds the list two at a time using lcm(a, b) = |a × b| ÷ gcd(a, b), where the greatest common divisor gcd(a, b) is found with the Euclidean algorithm; for three or more numbers, lcm(a, b, c) = lcm(lcm(a, b), c).

Assumptions & limits

  • Inputs must be non-zero integers; decimals and zero are rejected.
  • A negative sign is ignored — a number and its negation have the same LCM.
  • Results above 2^53 may lose exact integer precision, and a warning is shown.

Verified runs

Synthetic examples executed at build revision 24533ff on . Cards round decimal results to 6 significant figures; matching uses full precision and the tolerance below. Matches cover the displayed fields, not every possible input or clinical or engineering validation.

  • Inputs: Values: [4,6,8] integers

    Result: Least common multiple: 24 integer (expected Least common multiple: 24 integer) ✓

  • Inputs: Values: [7,7] integers

    Result: Least common multiple: 7 integer (expected Least common multiple: 7 integer) ✓

  • Inputs: Values: [-4,6] integers

    Result: Least common multiple: 12 integer (expected Least common multiple: 12 integer) ✓

How these runs were checked

Method: lcm@1.0.0. Expectations come from the listed test fixtures or hand arithmetic; they are not copied from these executions. Omitted optional inputs use the method defaults. Run dates record execution, not expert review or fresh measurements.

Download all verified runs (JSON) — full inputs, returned values, expectations, timestamps and buildRevision.

  • normal: . Absolute tolerance: 1e-10. Text and booleans match exactly. Full-precision result: Least common multiple: 24 integer. Expected: Least common multiple: 24 integer. Expectation: packages/calculator-core/tests/lcm.test.ts
  • boundary: . Absolute tolerance: 1e-10. Text and booleans match exactly. Full-precision result: Least common multiple: 7 integer. Expected: Least common multiple: 7 integer. Expectation: packages/calculator-core/tests/lcm.test.ts
  • sensitivity: . Absolute tolerance: 1e-10. Text and booleans match exactly. Full-precision result: Least common multiple: 12 integer. Expected: Least common multiple: 12 integer. Expectation: packages/calculator-core/tests/lcm.test.ts

Reproduce from the source checkout with pnpm --filter @sumivo/web gen:verified-runs. A rebuild changes execution times; the revision identifies its Git starting point, including any uncommitted changes made for that build.

§

FAQ

What is the least common multiple?
The smallest positive integer that each of your numbers divides into evenly. For 4 and 6 the LCM is 12.
How is the LCM related to the GCD?
They satisfy lcm(a, b) × gcd(a, b) = |a × b|, so the LCM equals the product of two numbers divided by their greatest common divisor.
Why can’t the LCM include zero?
Zero has no positive multiples in common with other numbers, so the least common multiple involving 0 is undefined.
What is the LCM used for?
Adding or comparing fractions with different denominators, finding when repeating events line up again, and gear or timing problems all rely on the LCM.
§

Related calculators

§

SOURCES

  • OpenStax, Rice University
    Prealgebra 2e ↗

    Least common multiple: listing multiples and prime factorization

    Accessed 2026-09-02