LCM Calculator
Find the LCM of two or more integers with exact arithmetic and independent verification. Free, no sign-up.
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
- 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
- Encyclopedia of Mathematics — Least common multiple
- Python math.lcm — zero convention
- CalculatorX integer convention
- 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
- Semantic contract
- PASS
Full verification
Formulas
Core equations used by this calculator.
How to use
Enter two or more integers
Separate with commas or spaces (e.g. 8, 12 or 10 12 15 75). Negatives use absolute value.
Calculate
Read the LCM plus listing, prime-power, and GCF-identity working when the values are small enough to list.
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
Via GCF
GCF(6,10) = 2
Three numbers
21, 14, 38
Prime powers
12, 18, 30
With zero
LCM(0, 5)
Quick checks
Common values at a glance.
| Numbers | LCM |
|---|---|
| 8, 12 | 24 |
| 6, 10 | 30 |
| 12, 30 | 60 |
| 6, 7, 21 | 42 |
| 21, 14, 38 | 798 |
| 12, 18, 30 | 180 |
| 10, 12, 15, 75 | 300 |
| 0, 5 | 0 |
| 0, 12, 18 | 0 |
LCM calculator specification
Version 1.0.3 · Engine tested
- Engine tested 20/20 tests · Production surface contract 3/3
- Named expert review Not performed
- Calculation version 1.0.3
- 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 GCDSupports: 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 = 0Supports: 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 identitySupports: Negatives by |n|; exact BigInt with a product digit cap; LCM(a,b)=|a/GCF(a,b)×b|
- Encyclopedia of Mathematics — Least common multiple — Definition; pairwise fold; relation to GCD
- 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.
Related tools
Other calculators in this family: Factorial Calculator, GCF Calculator, Modulo Calculator, Permutation Combination Calculator, Prime Factorization Calculator . Explore all Number Theory & Discrete Math.
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.