LCM Calculator

Calculate the Least Common Multiple (LCM) of any list of positive integers with prime factorisation, repeated-division ladder, and step-by-step solutions.

Enter numbers (comma, space, or new line separated)

Accepts comma, space, semicolon, or newline-separated positive whole numbers up to 1,000,000,000,000.

What is the LCM Calculator?

The Least Common Multiple (LCM) of a list of positive integers is the smallest positive integer that every member of the list divides cleanly. It is the natural answer to questions like 'When do two recurring events coincide?' or 'What is the smallest common denominator that lets me add these fractions?'

This LCM calculator accepts any list of whole numbers (separated by commas, spaces, or new lines), runs trial-division factorisation on each, and combines the results using the highest power of every prime. It pairs every result with the GCD, the full prime factorisation table, the LCM × GCD identity verification, a repeated-division ladder, and an interactive prime-exponent chart so you can see the structure of the answer as well as the answer itself.

How the LCM Calculator works

1. Parse the inputs

Comma, space, or newline-separated values are split, validated as positive whole numbers ≤ 10¹², and de-duplicated.

2. Factor each input

Trial division by 2 then odd primes finds the full prime factorisation in O(√n) time per input — fast enough for ten or more 12-digit inputs in a single tap.

3. Combine prime exponents

For every prime that appears in any input, take the highest exponent across the list. Multiply the chosen prime powers to get the LCM.

4. Show your work

The result panel renders the per-input factorisation, the chosen prime powers, the multiplication, the GCD, the LCM × GCD identity, an exponent chart, and a repeated-division ladder — every intermediate value is visible.

LCM formula library

LCM × GCD identity

LCM(a, b) × GCD(a, b) = a × b

True for any pair of positive integers. Use it to read one off the other in constant time.

Prime-factor LCM

LCM = p₁^max(e) × p₂^max(e) × …

Take the HIGHEST exponent of each prime that appears in any input.

Prime-factor GCD

GCD = p₁^min(e) × p₂^min(e) × …

Take the LOWEST exponent of each prime that appears in EVERY input.

Euclidean algorithm

gcd(a, b) = gcd(b, a mod b)

Replace the larger by the remainder. Terminates in O(log min(a, b)) steps.

Divisor count τ(n)

τ(n) = (e₁+1)(e₂+1)…(eₖ+1)

Total positive divisors of n from its prime exponents.

When to use the LCM calculator

Adding or subtracting fractions

Use the LCM of the denominators as the common denominator. The result is already in lowest terms because the LCM uses the smallest possible denominator.

Lining up recurring schedules

Two events occur every a and b days respectively. They next coincide LCM(a, b) days from now — and again every LCM(a, b) days thereafter.

Engineering gear ratios

When two gears with N and M teeth mesh, every tooth of each gear contacts the same tooth of the other gear once every LCM(N, M) teeth — useful for predicting wear patterns.

Distributing items into equal groups

When you need a group size compatible with multiple constraints (divisible by 3 AND by 4), the smallest valid size is the LCM of the constraints (12 here).

Why LCM matters

LCM is one of the most-used operations in elementary number theory. It shows up in fraction arithmetic from primary school onwards, in scheduling problems through high-school competitions, in computer-algebra systems, in cryptographic key generation, and in the design of cyclic data structures.

The reason LCM feels simple but powerful is the Fundamental Theorem of Arithmetic — unique factorisation into primes — which turns 'find the smallest common multiple' into a clean multiplicative operation on exponents. Take the max instead of the sum, and you get the LCM. Take the min, and you get the GCD. Two of the most important integer functions, side by side.

Frequently Asked Questions

The Least Common Multiple (LCM) of two or more positive integers is the smallest positive integer that is divisible by every one of them. For example, LCM(4, 6) = 12, because 12 is the smallest number both 4 and 6 divide cleanly.

Two reliable methods: (1) Prime factorisation — write each number as a product of primes, then take the HIGHEST power of every prime that appears anywhere and multiply. (2) The LCM × GCD identity — for two numbers, LCM(a, b) = (a × b) / GCD(a, b). For three or more, fold the identity: LCM(a, b, c) = LCM(LCM(a, b), c).

LCM is the smallest number ALL inputs divide — it sits above your inputs. GCD (also HCF) is the largest number that divides ALL inputs — it sits below them. Use LCM when you need a common multiple (matching schedules, adding fractions); use GCD when you need a common factor (simplifying fractions, splitting evenly).

When you need the smallest quantity that contains each of your inputs as a factor: finding a common denominator to add or subtract fractions, lining up recurring events (every 4 days, every 6 days — when do they coincide?), distributing items into equal groups while satisfying multiple group-size constraints, and gear-ratio cycle problems in engineering.

LCM(12, 18) = 36. Prime form: 12 = 2² × 3 and 18 = 2 × 3²; the highest power of 2 is 2² and of 3 is 3², so LCM = 2² × 3² = 36. Verify: 36 ÷ 12 = 3 and 36 ÷ 18 = 2 — both clean.

No. The LCM is always at least as large as the largest input — every input must divide it. The only time it equals an input is when one input is a multiple of all the others; e.g. LCM(3, 6, 12) = 12.

Yes: LCM(a, b) = (a × b) / GCD(a, b). If GCD is fast (Euclidean algorithm runs in microseconds), so is LCM. The same identity does NOT hold for three or more numbers directly — you have to fold pairwise.

If GCD(a, b) = 1 (the numbers share no common prime factor), then LCM(a, b) = a × b. For example, LCM(8, 9) = 72 because 8 = 2³ and 9 = 3² share no prime, so the LCM picks up both.

Common denominators for adding fractions, scheduling problems (buses arriving every 12 vs 15 minutes), gear-ratio engineering, music theory (rhythmic patterns and time signatures), encryption key generation, and CPU scheduling in operating systems.

Yes. The prime-factorisation method scales naturally — take the highest power of each prime across all the inputs and multiply. The pairwise LCM identity also extends: LCM(a, b, c) = LCM(LCM(a, b), c), and so on for any number of values.