More games at WuGames.ioSponsoredDiscover free browser games — play instantly, no download, no sign-up.Play

LCM Calculator

Free LCM calculator with prime-factorization steps. Get the least common multiple plus the GCF — exact BigInt math for fractions, LCD and scheduling.

=

How to Calculate LCM?

The Least Common Multiple (LCM) is the smallest positive integer that is divisible by two or more numbers. It's useful for finding common denominators in fractions and solving various mathematical problems.

Finding LCM of Multiple Numbers:

  • Find the LCM of the first two numbers
  • Use that result to find the LCM with the next number
  • Continue until all numbers are processed

LCM(12, 18, 24) = 72

Finding LCM using Prime Factorization:

  • Find the prime factors of each number
  • Take the highest power of each prime factor
  • Multiply all the prime factors together

12 = 2² × 3

18 = 2 × 3²

LCM(12, 18) = 2² × 3² = 36

Finding LCM using GCF:

  • Use the relationship: LCM(a, b) = (a × b) / GCF(a, b)
  • This method is efficient for two numbers

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

LCM(12, 18) = (12 × 18) / 6 = 216 / 6 = 36

Common LCM examples

NumbersLCM
4, 612
8, 1224
5, 735
6, 8, 1224
10, 15, 2060
3, 5, 7105
2, 4, 88

About this LCM calculator

This calculator accepts any list of two or more integers — separated by commas, spaces, or newlines — and returns both their least common multiple (LCM) and their greatest common factor (GCF) in a single pass, along with the full working. The step-by-step box prints the prime factorization of each input and shows which highest powers are kept, so the calculator doubles as a study aid for primary, middle-school and early algebra classes. There is no upper limit imposed: the arbitrary-precision BigInt arithmetic underneath handles numbers far beyond what fits in a 64-bit integer, so large or numerous inputs stay exact with no silent overflow.

Frequently Asked Questions

The LCM of two integers a and b is the smallest positive integer that both a and b divide evenly into. For example, LCM(4, 6) = 12 because 12 is the first multiple shared by 4 (4, 8, 12, ...) and 6 (6, 12, ...). The LCM is always at least as large as the larger input, and equals one of the inputs only when that input is itself a multiple of the other (LCM(3, 9) = 9).

Factor each number into primes, then for every prime that appears in any factorization, take the highest power of that prime and multiply them together. Example for LCM(12, 18): 12 = 2²·3 and 18 = 2·3². The primes are 2 and 3; the highest powers are 2² and 3². LCM = 2²·3² = 36. This method works for any number of inputs and is what the 'Calculation steps' box shows.

For two numbers, LCM(a, b) = (a × b) / GCF(a, b). The product of the LCM and GCF always equals the product of the original two numbers. For 12 and 18: GCF(12, 18) = 6, so LCM = (12 × 18) / 6 = 216 / 6 = 36. The shortcut is the fastest way to compute LCM of two numbers because computing the GCF via the Euclidean algorithm is very fast even for huge integers. For three or more numbers, apply it pairwise: LCM(a, b, c) = LCM(LCM(a, b), c).

The GCF (greatest common factor) of all your inputs is shown next to the LCM because the two are linked by LCM(a, b) × GCF(a, b) = a × b, and the GCF is what you need to reduce the resulting fraction or ratio in the same pass. Both results use arbitrary-precision BigInt arithmetic, so there is no 2^53 ceiling: the LCM of 99, 98, 97, 95, 91, 89, 83, 79, 73, 71 is exactly 3515413055750906310, not the rounded 3515413055750906400 that plain 64-bit math returns. That exactness matters for gear-ratio, polling-interval and batch-sizing work where the LCM routinely runs past a 64-bit integer.

LCM(12, 18) = 36 (= 2² × 3²). LCM(8, 12) = 24 (= 2³ × 3). LCM(6, 8) = 24 (= 2³ × 3). The reference table at the bottom of the page lists more common pairings — LCM(4, 6) = 12, LCM(5, 7) = 35, LCM(10, 15, 20) = 60 — so you can spot-check the calculator or look up textbook problems quickly.

To add fractions with different denominators, you rewrite each fraction with a common denominator first. Any common denominator works, but the LCM gives the smallest one, which keeps the numbers manageable. For 1/4 + 1/6: LCM(4, 6) = 12, so the fractions become 3/12 and 2/12, and the sum is 5/12. If you used 4 × 6 = 24 instead you would end up with 6/24 + 4/24 = 10/24 = 5/12 — same answer but with an extra simplification step.

No — the LCM is always at least as large as the largest input. Every multiple of LCM(a, b) is also a multiple of both a and b, so the LCM must contain the largest input at least once. It equals the largest input only when the largest is itself a multiple of all the others: LCM(3, 6, 12) = 12 because 12 already contains 3 and 6.

Yes — when the inputs are the denominators of fractions, the LCM is exactly the lowest common denominator (LCD). The two terms are used interchangeably in arithmetic. LCM is the broader term used outside of fraction work (e.g. for scheduling problems, gear ratios, traffic light cycles), while LCD specifically refers to the fraction-arithmetic use case.

Scheduling: if one bus comes every 12 minutes and another every 18 minutes, they will meet again at LCM(12, 18) = 36 minutes. Music: a 4/4 phrase and a 6/8 phrase realign every 12 beats. Cron jobs and game-tick loops use LCM-style reasoning to figure out when several periodic events coincide. Manufacturing gearboxes use LCM to compute how many revolutions before each gear returns to its starting orientation.

Frequently Asked Questions

The Least Common Multiple (LCM) of two or more integers is the smallest positive integer that every input divides evenly. It is the workhorse behind adding fractions with unlike denominators, scheduling repeating events that align, and gear/pulley calculations where teeth meshes must repeat. For example, LCM(4, 6) = 12, so 1/4 and 1/6 share the common denominator 12 and become 3/12 + 2/12 = 5/12. In project planning, if Task A repeats every 4 days and Task B every 6 days, both fall on the same day every 12 days. The LCM is always at least as large as the biggest input and is closely tied to the GCF through the identity LCM(a,b) x GCF(a,b) = a x b.

GCF (Greatest Common Factor, also called GCD) finds the largest divisor shared by all inputs, while LCM finds the smallest multiple shared by all inputs. They are duals: GCF works downward toward 1, LCM works upward toward infinity. The classic identity LCM(a,b) = (a x b) / GCF(a,b) ties them together, which is why our tool computes GCF first via the Euclidean algorithm and then divides. Use GCF when you need to simplify fractions or cut equal-sized pieces from materials; use LCM when you need a common denominator, a repeating event alignment, or smallest container size that holds whole batches of two amounts.

The fastest by-hand method is prime factorisation. List the prime factors of each number with their highest exponents, then multiply. For 12 = 2^2 x 3 and 18 = 2 x 3^2, the LCM takes the largest power of each prime: 2^2 x 3^2 = 36. For very small numbers, you can simply list multiples until they coincide: 12, 24, 36... and 18, 36... -> 36. For two numbers only, the identity method is fastest if you already know the GCF: LCM(12, 18) = (12 x 18) / GCF(12, 18) = 216 / 6 = 36. Our tool shows the step-by-step factorisation so you can verify the work.

LCM is associative, so you can fold it pairwise: LCM(a, b, c) = LCM(LCM(a, b), c). For example, LCM(4, 6, 8) = LCM(LCM(4, 6), 8) = LCM(12, 8) = 24. The prime factorisation approach generalises naturally: take every prime that appears in any number and raise it to the highest exponent seen anywhere, then multiply. For 4 = 2^2, 6 = 2 x 3, 8 = 2^3, the primes are 2 (max exponent 3) and 3 (max exponent 1), giving 2^3 x 3 = 24. This calculator accepts any list of positive integers separated by commas or spaces and applies the pairwise reduction for you.

Prime factorisation is intuitive but slow for large numbers because factoring is a hard problem (the security of RSA depends on it). The Euclidean algorithm, attributed to Euclid around 300 BCE, computes GCF(a, b) by repeatedly replacing the larger number with the remainder of dividing it by the smaller: GCF(252, 105) -> GCF(105, 42) -> GCF(42, 21) -> GCF(21, 0) = 21. It runs in O(log(min(a,b))) steps and avoids factoring entirely. Our tool uses Euclidean GCF and then derives LCM via LCM = a x b / GCF, which is faster and numerically stable even for numbers with hundreds of digits using JavaScript BigInt.

Anywhere periodic events must synchronise. In mechanical engineering, two meshing gears with 12 and 18 teeth return to their starting alignment every LCM(12, 18) = 36 tooth-engagements, which sets wear patterns and harmonic frequencies. In manufacturing, if machine A produces 4 units/cycle and machine B produces 6, batches of LCM(4, 6) = 12 keep both machines busy with no leftovers. In computer networking, two protocols polling at 50 ms and 80 ms collide every LCM(50, 80) = 400 ms. In music, rhythms with periods 3 and 4 produce a repeating pattern every 12 beats — the basis of polyrhythms.

Each new input can multiply the LCM by a new prime factor or raise an existing one, so the LCM grows at least as fast as the product of distinct primes. The LCM of the first n integers is closely related to e^n by the Prime Number Theorem: LCM(1..10) = 2520, LCM(1..20) ~ 232 million, LCM(1..30) ~ 2.3 quadrillion. For combinatorics, ten coprime numbers around 100 give an LCM near 10^20, which exceeds standard 64-bit integer range. Our calculator uses arbitrary-precision BigInt to handle these cases without overflow, so you can confidently compute LCMs of large or many inputs without silent truncation.

Mathematically, LCM is defined for positive integers. Including 0 collapses the LCM to 0 because 0 is a multiple of every integer (every integer divides 0), making 0 the smallest non-negative common multiple — but this is rarely the answer you want, so our tool warns when 0 is detected. For negative numbers, the convention is LCM(|a|, |b|) since multiples come in plus/minus pairs and the "least" non-zero one is positive. Our calculator takes absolute values automatically, treats 0 as a user error, and ignores duplicate entries since LCM(a, a) = a contributes nothing new. Fractions are not supported here — use the fraction calculator for those.
LCM Calculator — Free LCM calculator with prime-factorization steps. Get the least common multiple plus the GCF — exact BigInt math for f
LCM Calculator