HomeCalculatorsMathNumber Theory & Discrete MathLCM Calculator
Math calculator

LCM Calculator

Find the LCM of two or more integers with exact arithmetic and independent verification. Free, no sign-up.

Instant result
Result

Enter values to calculate.

Inputs
Mode
Formula
Trust summary CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance
Input interpretation
Enter values to calculate.
Result
Assurance
Core
Declared partition coverage
PASS · 8/8 declared partitions (lcm, zero, negative, beyond-safe-integer, multi-input-fold, method-unavailable, xcal, invalid-domain) · Matrix
Known limitations
  • ≥2 integers; any zero → 0
  • Core CVP does not include live graph, viewport, or pointer interaction.
Model
LCM of two or more integers, with listing, prime-power, and GCF-identity steps and method agreement when listing is feasible.
Scope
Integer inputs; negatives treated by absolute value.
Verification
Engine tested · Source checked · v1.0.3 · CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance· View Manifest · CVP overview · Specification
Versions
Calculation 1.0.3 · CVP protocol 1.0.0-proposed · Evidence 2026-09-16.sources-no-wolfram
Verification revision
2026-09-16.sources-no-wolfram · 3/3 property · digest 243e5df78591
Legacy regression
20/20 tests · Production surface contract 3/3
Trust layers
Verification VERIFIED · Production CURRENT · overall VERIFIED
Reference
O1 model · O2 expected_values · O2 numerical_behavior
Interfaces
PASS · UI (SSR) / REST / MCP — ui-ssr is query-result HTML, not a live browser session.
Supplemental domain review
Not performed
Named expert review
Not performed
CVP suite
6/6 golden · 7/7 CVP boundary · 3/3 invalid · 3/3 property · 1/1 metamorphic · 1/1 cross-interface · 5/5 cross-calculator · 3/3 CVP contract · Manifest
Sources
Sources
Methods
  • Pairwise GCF-identity fold (canonical engine; divide before multiply)
  • Prime-factor LCM (cross-check when every |n| ≤ 1,000,000 and none is 0)
  • Listing multiples (cross-check when LCM ≤ 5,000 and every |n| ≤ 500)
Evidence
6 legacy golden · 7 legacy boundary · legacy regression suite · 6/6 oracle-backed golden · 3/3 invalid · Artifact integrity PASS
This calculator CURRENT · Public schema 1.0.3 matches · Semantic contract ✓ · Production attested · Public/cache ✓ · Origin ✓
Semantic contract
PASS
Full verification

Manifest identity, reference classes, interfaces, suite, and production records.

Formulas

Core equations used by this calculator.

Via GCFLCM(a,b) = |a / GCF(a,b) × b|
PairwiseLCM(a,b,c,…) = LCM(LCM(a,b),c,…)
With zeroIf any input is 0, LCM = 0
PrimesTake each prime to the highest power appearing in any factorization
iLCM is associative and commutative. Related identity: GCF(a,b) = |a×b| / LCM(a,b) when a and b are both nonzero. Divide by GCF before multiplying so the intermediate product stays smaller. LCM(0,0)=0 is defined by convention (the GCF identity would divide by zero). Do not put thousands separators inside a number (write 2500, not 2,500).

How to use

1

Enter two or more integers

Separate with commas or spaces (e.g. 8, 12 or 10 12 15 75). Negatives use absolute value.

2

Calculate

Read the LCM plus listing, prime-power, and GCF-identity working when the values are small enough to list.

3

Use with fractions

If the inputs are denominators, the LCM is their least common denominator (LCD).

Example calculations

Common configurations with formula and result.

ϟ

Two numbers

8 and 12

multiples meet at 24
24
ϟ

Via GCF

GCF(6,10) = 2

(6 × 10) / 2 = 30
30
ϟ

Three numbers

21, 14, 38

3×7×2×19
798
ϟ

Prime powers

12, 18, 30

2²×3²×5
180
ϟ

With zero

LCM(0, 5)

any zero → 0
0

Quick checks

Common values at a glance.

NumbersLCM
8, 1224
6, 1030
12, 3060
6, 7, 2142
21, 14, 38798
12, 18, 30180
10, 12, 15, 75300
0, 50
0, 12, 180
i Listing multiples works for small values; for larger sets prefer prime powers or the GCF identity. LCM with any 0 is 0.

LCM calculator specification

Version 1.0.3 · Engine tested

Calculation status

Review policy · Evidence

Definition
For nonzero integer inputs, the least common multiple (LCM), also called lowest common multiple, is the smallest positive integer divisible by every input. Under CalculatorX's zero convention, if any input is 0, the LCM is 0. When the integers are denominators, the LCM is the least common denominator (LCD). Enter two or more integers separated by commas or spaces. Negative values are treated by absolute value.
What it calculates
LCM of two or more integers, with listing, prime-power, and GCF-identity steps and method agreement when listing is feasible.
Inputs
  • Two or more integers (comma- or space-separated). Share-URL field: numsInput. REST aliases: values, numbers.
Outputs
  • LCM: positive when every input is nonzero; 0 if any input is 0 (JSON number when it fits IEEE-754 safe integers; otherwise the exact decimal string)
  • Sample multiples lists (when LCM ≤ 5,000 and every |n| ≤ 500)
  • Prime factorization / highest powers (when every |n| ≤ 1,000,000 and none is 0)
  • GCF identity steps
  • Method agreement (listing / prime / GCF)
Formula
LCM(a,b,c,…) = LCM(LCM(a,b),c,…); LCM(a,b)=|a/GCF(a,b)×b|
Assumptions
  • Integer inputs; negatives treated by absolute value.
  • If any input is 0, LCM = 0. LCM(0,0)=0 is a CalculatorX/Python convention, not a GCF-identity derivation.
  • For nonzero inputs the result is a positive integer.
Units
  • Dimensionless (integers)
Boundary conditions
  • Need at least two numbers → NEED_TWO_NUMBERS
  • Missing list → MISSING_REQUIRED_INPUT
  • Non-integers rejected → INVALID_NUMBER
  • More than 48 digits → VALUE_ABOVE_MAX
  • Any zero → LCM = 0
Numerical precision
  • Interactive calculation uses exact BigInt locally: pairwise LCM fold LCM(a,b)=|a/GCF(a,b)×b| (divide first).
  • Shareable URLs (?numsInput=8,12) are server-rendered with the same deterministic engine so crawlers and no-JS clients see the same result.
  • REST and SSR return { values, value, exact, count, formula, binary_formula, methods, work, max_digits }. value is a JSON number when it fits in IEEE-754 safe integers, otherwise the exact decimal string.
  • Integers beyond MAX_SAFE_INTEGER must be sent as decimal strings so JSON number rounding cannot change them.
  • The 48-digit cap is a CalculatorX product bound, not a mathematical bound.
Example
LCM(8,12)=24; LCM(0,5)=0; LCM(9007199254740993, 3)=9007199254740993
Validation cases

7 published on this page · 20/20 tests · Production surface contract 3/3 · View evidence

  • 8, 12 → 24
  • 6, 10 → 30
  • 21, 14, 38 → 798
  • 12, 18, 30 → 180
  • 10, 12, 15, 75 → 300
  • 0, 5 → 0
  • 9007199254740993, 3 → 9007199254740993
Methods
  • Pairwise GCF-identity fold (canonical engine; divide before multiply)
  • Prime-factor LCM (cross-check when every |n| ≤ 1,000,000 and none is 0)
  • Listing multiples (cross-check when LCM ≤ 5,000 and every |n| ≤ 500)
Sources
  • Encyclopedia of Mathematics — Least common multiple — Definition; pairwise fold; relation to GCD
    Supports: LCM of n integers via pairwise fold; lcm(a,b)·gcd(a,b)=|ab| for nonzero a,b
  • Python math.lcm — zero convention — If any argument is zero, LCM = 0
    Supports: Any zero argument → 0; LCM(0,0)=0 is that convention, not |a/GCF(a,b)×b| (GCF(0,0)=0)
  • CalculatorX integer convention — Absolute value; 48-digit BigInt domain; divide-first identity
    Supports: Negatives by |n|; exact BigInt with a product digit cap; LCM(a,b)=|a/GCF(a,b)×b|
Calculation version
1.0.3

Background

Interpretation and common distinctions.

What is the LCM?

For nonzero integers, the least common multiple (also lowest common multiple) is the smallest positive integer divisible by each of them.

LCM(a,b,c,…)=LCM(LCM(a,b),c,…)

Negative inputs use absolute value. Under CalculatorX’s zero convention, if any input is 0 the LCM is 0. If those integers are denominators, the LCM is the least common denominator (LCD) used to add or subtract fractions.

Methods

Listing multiples

List positive multiples until a common value appears.

LCM(6, 7, 21): multiples of 6 include 42; of 7 include 42; of 21 include 42 → 42.

Prime factorization

Take each prime to the highest power that appears in any number, then multiply.

LCM(12, 30): 12=2²×3, 30=2×3×5 → 2²×3×5=60.

LCM(12, 18, 30): 2²×3²×5=180.

GCF identity

Divide by the GCF first so the intermediate product stays smaller:

LCM(a,b)=|a/(GCF(a,b))× b|

LCM(6, 10): GCF(6,10)=2 → (6/2)×10=30. This identity requires a nonzero GCF, so it applies when at least one argument is nonzero.

For three or more numbers, compute pairwise (order does not matter if done consistently). When the values are small enough to list, the page shows listing, prime powers, and the GCF identity and reports whether they agree.

LCM and zero

  • If any input is 0, LCM=0.
  • For a zero/nonzero pair, the GCF identity yields 0: GCF(0,5)=5, so |(0/5)×5|=0.
  • For (0,0), GCF(0,0)=0, so |a/GCF(a,b)× b| would divide by zero. CalculatorX explicitly defines LCM(0,0)=0, matching Python math.lcm. Some textbooks leave LCM(0,0) undefined.

Integer range

Calculation uses exact BigInt, so integers larger than Number.MAX_SAFE_INTEGER stay exact. Each input may have at most 48 decimal digits (a product bound, not a mathematical bound). Values beyond the IEEE-754 safe integer range must be sent to the API as decimal strings.

Example: LCM(9007199254740993, 3)=9007199254740993.

Agent / API notes

Capability id: math.lcm · tool id: lcm · pin calculation_version: 1.0.3.

POST /api/v1/calc/lcm
{ "inputs": { "values": [8, 12] } }

Share URL: /calc/math/lcm?numsInput=8,12. Aliases: numbers, numsInput.

Stable error codes: MISSING_REQUIRED_INPUT, NEED_TWO_NUMBERS, INVALID_NUMBER, VALUE_ABOVE_MAX.

}

Frequently asked questions

Key distinctions behind the calculation.

What is the least common multiple?

For nonzero integers it is the smallest positive integer evenly divisible by each input. Also called lowest common multiple. If any input is 0, CalculatorX returns 0. If the inputs are denominators, that value is the LCD.

How do I find LCM by listing multiples?

List positive multiples of each number until a shared value appears; the smallest positive shared multiple is the LCM.

How does prime factorization give the LCM?

Factor each nonzero number into primes. For every prime, take the highest exponent that appears in any factorization, then multiply those prime powers.

How is LCM related to GCF?

For two integers, LCM(a,b)=|a/GCF(a,b)×b|. The engine divides by GCF first so the intermediate product stays smaller. For more numbers, fold pairwise: LCM(a,b,c)=LCM(LCM(a,b),c).

Is LCD the same as LCM?

LCD means least common denominator — the LCM of the denominators when adding or subtracting fractions. LCM of 8 and 12 is 24; 24 is the LCD only if 8 and 12 are used as denominators.

What about LCM with 0?

If any input is 0, LCM = 0. For a zero/nonzero pair such as LCM(0,5), the GCF identity yields 0 because GCF(0,5)=5 and |(0/5)×5|=0. For (0,0), GCF(0,0)=0 so that identity would divide by zero; CalculatorX explicitly defines LCM(0,0)=0, matching Python math.lcm. Some textbooks leave LCM(0,0) undefined.

Do you accept negative integers?

Yes. Negatives are treated by absolute value, so LCM(−8, 12) = 24.

How large can the integers be?

Each integer may have at most 48 decimal digits. Arithmetic uses exact BigInt, so values larger than JavaScript’s MAX_SAFE_INTEGER (9,007,199,254,740,991) stay exact — for example LCM(9007199254740993, 3) = 9007199254740993.

Can I enter decimals?

This tool expects integers. To handle decimals, scale them to integers (same number of decimal places), find the integer LCM, then scale back.