LCM Calculator
Enter any list of whole numbers and the calculator returns the lowest common multiple — the smallest positive integer that every input divides into exactly — along with the greatest common divisor and the reduction steps.
Lowest common multiple
24
- Greatest common divisor
- 2
- Numbers used
- 3
- Inputs (absolute values)
- 4, 6, 8
Reduced pairwise using lcm(a, b) = |a × b| ÷ gcd(a, b). Steps: lcm(4, 6) = 12; lcm(12, 8) = 24.
How to use this calculator
Type or paste a list of two or more whole numbers, separated by commas, spaces, tabs, or new lines. The calculator updates as you type and shows the lowest common multiple as the headline result, with the greatest common divisor, the count of inputs, and the absolute values used below. Negative numbers are accepted but treated as their absolute value (the LCM is, by convention, a positive integer). Non-integer or unrecognised tokens are skipped and reported in the explanation.
How the calculation works
The lowest common multiple of two integers a and b is the smallest positive integer that both divide into without a remainder. It is computed from the greatest common divisor via the identity lcm(a, b) = |a × b| ÷ gcd(a, b). The GCD itself is found using the Euclidean algorithm, which repeatedly replaces the larger number by the remainder of dividing it by the smaller — a process that always terminates in a finite number of steps. For three or more numbers, the calculator reduces pairwise: lcm(a, b, c) = lcm(lcm(a, b), c), and so on. By standard convention, the LCM of any list containing zero is zero, because zero is a multiple of every integer.
Worked example
For 4, 6 and 8: first lcm(4, 6) = (4 × 6) ÷ gcd(4, 6) = 24 ÷ 2 = 12. Then lcm(12, 8) = (12 × 8) ÷ gcd(12, 8) = 96 ÷ 4 = 24. So lcm(4, 6, 8) = 24 — the smallest positive integer that 4, 6 and 8 all divide into exactly. As a quick check: 24 ÷ 4 = 6, 24 ÷ 6 = 4, 24 ÷ 8 = 3. For two coprime numbers like 7 and 5, the GCD is 1, so the LCM is simply their product: 7 × 5 = 35.
Frequently asked questions
What is the lowest common multiple?
The lowest common multiple (LCM, sometimes called the least common multiple) of a set of integers is the smallest positive integer that every number in the set divides into without a remainder. For 4 and 6 it is 12 — both 4 and 6 divide 12 exactly, and no smaller positive integer has that property. The LCM is most often used when adding or subtracting fractions with different denominators (the LCM of the denominators is the smallest common denominator) and in problems involving repeating cycles or schedules.
How is the LCM related to the GCD?
They are tied by the identity lcm(a, b) × gcd(a, b) = |a × b|. So once you know the greatest common divisor, the LCM follows from a single multiplication and division. The calculator uses this identity rather than listing multiples: it finds the GCD by the Euclidean algorithm (fast even for very large numbers), then divides the product by the GCD. For three or more numbers it reduces pairwise — lcm(a, b, c) = lcm(lcm(a, b), c) — which is associative, so the order does not matter.
What is the LCM if one of the numbers is zero?
By standard mathematical convention the LCM of any list containing zero is zero, because zero is a multiple of every integer (0 = 0 × n for any n). Some textbooks instead leave the LCM "undefined" when zero is present, but the convention used here is the one adopted by most number-theory references and by the lcm functions in mainstream maths libraries. If zero is not what you intended, remove it from the list.
Does the calculator work for negative numbers?
Yes — but the LCM is, by convention, a non-negative integer. The calculator takes the absolute value of each input before computing, so lcm(−4, 6) is the same as lcm(4, 6) = 12. This matches the definition used by every standard reference and by the lcm functions in Python, JavaScript BigInt extensions, and most maths libraries.
Can I enter more than two numbers?
Yes — enter as many whole numbers as you like, separated by commas, spaces, or new lines. The calculator reduces them pairwise: it computes the LCM of the first two, then the LCM of that result with the third, and so on. The order does not affect the answer, because the LCM operation is associative and commutative. Performance is linear in the size of the list and the Euclidean algorithm is logarithmic in the size of the numbers, so even very long lists or very large integers are handled instantly.
Why does the calculator only accept whole numbers?
The lowest common multiple is defined for integers only — there is no agreed definition for arbitrary real numbers. If you have fractions, multiply each one by a common factor to clear the denominators first, then compute the LCM of the resulting integers. Decimals and non-numeric tokens entered into the input are flagged in the explanation rather than silently coerced, so you can spot a typo immediately.