Least Common Multiple (LCM) Calculator

Calculate LCM for 2–5 numbers using prime factorization. Step-by-step pairing, prime factor comparison table, power-contribution bars, and highlighted multiples grid.

LCM
36
LCM(12, 18)
GCD
6
GCD(12, 18)
LCM Factorization
2^2 × 3^2
Product of highest prime powers
GCD Factorization
2 × 3
Product of lowest prime powers
Product of Inputs
216
12 × 18
LCM × GCD
216
= 12 × 18 (for 2 numbers)

Step-by-Step LCM via Pairing

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

Prime Factor Comparison

Prime1218LCM (max)GCD (min)
22121
31221

Prime Power Contributions to LCM

2
2^2
3
3^2

First 10 Multiples

×12345678910
121224364860728496108120
181836547290108126144162180

Green highlight = LCM (36).

Planning notes, formulas, and examples

About the Least Common Multiple (LCM) Calculator

The **Least Common Multiple (LCM) Calculator** finds the smallest positive integer divisible by every number in your set, whether you enter two, three, four, or five values. It uses prime factorization as the main method, then checks the answer with the GCD identity to keep the result honest.

You see each input's prime factors, the highest exponent chosen for each prime, and the resulting product. The comparison table and multiples grid make it easy to verify why the shared multiple works and why smaller candidates fail.

This is the right tool when you need the first common multiple for fraction denominators, repeating schedules, or any problem where several cycles must line up at once. The prime-factor view is especially helpful when you want to explain why the answer is correct instead of only reading the final multiple. It also makes it easier to check whether a result is the least common multiple rather than just any shared multiple, which matters when you want the smallest valid alignment.

When This Page Helps

Listing multiples by hand gets tedious quickly, especially once the input set grows. This calculator keeps the work visible while automating the repetitive part, so you can see which prime powers drive the final answer without doing the entire factor comparison yourself.

The comparison table is useful because it shows exactly where each prime power comes from, which makes the max-power rule easier to explain and verify.

How to Use the Inputs

  1. Select how many numbers you want to compare.
  2. Enter each positive integer in the matching field.
  3. Use a preset if you want a quick example such as 12 and 18 or a three-number set.
  4. Read the LCM result first, then check the factor table to see which prime powers were chosen.
  5. Use the multiples grid when you want to confirm the first common multiple visually.
  6. Compare the GCD output if you want the shared-factor view alongside the shared-multiple view.
Formula used
LCM(a, b) = |a × b| / GCD(a, b). Equivalently, LCM = product of each prime raised to its highest power across all input factorizations. For n > 2 numbers, apply pairwise: LCM(a, b, c) = LCM(LCM(a, b), c).

Example Calculation

Result: LCM(12, 18) = 36

12 = 2² × 3, 18 = 2 × 3². Take max powers: 2² × 3² = 4 × 9 = 36. Alternatively: 12 × 18 / GCD(12,18) = 216 / 6 = 36.

Tips & Best Practices

  • For two coprime numbers, LCM = their product — check GCD first.
  • Use the multiples grid to visually confirm the first common multiple.
  • The prime factor table's green cells show which input "drives" each prime power.
  • Add more numbers to see how the LCM grows as inputs are added.
  • Compare LCM × GCD to the product of two inputs to verify the identity.
  • Presets cover 2-, 3-, and 4-number sets for quick exploration.

The Prime Factorization Method

To find LCM by prime factorization: (1) factor each number into primes, (2) for each prime, take the highest exponent that appears in any factorization, and (3) multiply those prime powers together. This method generalizes cleanly to any number of inputs and clearly shows *why* the LCM has the value it does — every prime must be present at least as often as it appears in any single input.

LCM and Fraction Addition

When adding fractions with different denominators, you need a common denominator — and the LCM of the denominators is the *least* common denominator. Using the LCM keeps numerators small and avoids unnecessary simplification afterward.

Scheduling and Cyclic Events

If event A repeats every 12 days and event B every 18 days, both occur on the same day every LCM(12, 18) = 36 days. The same principle applies to flashing lights, planetary alignments, gear meshing, and CPU clock domains — anywhere independent cycles must synchronize.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • The Least Common Multiple is the smallest positive integer divisible by all given numbers. It is the first shared multiple where all of the input sequences meet.