Least Common Multiple (LCM) Calculator
Enter positive integer numbers separated by spaces (for example 8 12) and press Calculate to get the least common multiple — the smallest positive integer every entered number divides evenly into. The greatest common factor (GCF) is shown alongside, and every result is computed exactly, in your browser.
Enter positive integers
Type at least two positive whole numbers separated by spaces or commas — e.g. 8 12, or 54 24 36. Up to 20 numbers are accepted, each up to 1,000,000,000.
Press Calculate or Enter
Press the Calculate button (or the Enter key in the input) to compute both the least common multiple (LCM) and the greatest common factor (GCF) of all the numbers at once.
Read exact results
For 8 and 12 the LCM field shows 24 — the smallest number both 8 and 12 divide into — and the GCF field shows 4. Large answers print as full exact digits, never rounded or in exponent form.
How the LCM works here
- What is the least common multiple?
- The LCM of a set of numbers is the smallest positive integer that is a multiple of every one of them. The multiples of 8 are 8, 16, 24, 32, ... and the multiples of 12 are 12, 24, 36, ... so lcm(8, 12) = 24. Three or more numbers work the same way: lcm(12, 18, 30) = 180.
- How is it calculated?
- LCM and GCF are computed pair by pair with the Euclidean algorithm: gcd(a, b) by repeated remainders, then lcm(a, b) = a ÷ gcd(a, b) × b, folded over the whole list. Division before multiplication keeps every intermediate value an exact whole number.
- Why are big results exact here?
- This tool computes with arbitrary-precision integers, so answers beyond JavaScript's 2^53 safe-integer limit — e.g. lcm(1000000000, 999999999) = 999999999000000000 — print as full exact digits instead of being rounded or switched to exponent notation.
- Which inputs are accepted?
- Two to twenty positive integers, each at most 1,000,000,000, separated by spaces, commas or new lines. Decimals, zero, negatives and other text are rejected with a clear in-app message naming the offending value — this calculator keeps to the whole-number LCM definition.
- What is the GCF shown next to the LCM?
- The greatest common factor (also called GCD, greatest common divisor) is the largest positive integer that divides every entered number: gcf(8, 12) = 4. LCM and GCF satisfy lcm × gcf = a × b for two numbers, e.g. 24 × 4 = 8 × 12 = 96.
Privacy: every calculation runs in your browser tab — no number you type is sent anywhere. LCM and GCF are exact arbitrary-precision integer results.