HomeMath › LCM Calculator

LCM Calculator

Type any list of whole numbers — separated by commas or spaces — and get their least common multiple with the prime-factorization working shown, plus the greatest common factor of the same list as a bonus.

Least common multiple
As prime powers
GCF of the same numbers
Steps

Why highest powers win

A common multiple must contain every number in the list, so for each prime it needs at least as many copies as the greediest input demands. 12 needs two 2s, 18 needs two 3s, 30 needs a 5 — so the smallest number satisfying everyone is 2² × 3² × 5 = 180. Taking anything less than the highest power of any prime would leave one of the inputs unable to divide the result.

How it’s calculated

Each input is factored into primes by trial division; the LCM is the product of every prime raised to its highest exponent across the list. Cross-check: for two numbers, LCM(a,b) = a × b ÷ GCF(a,b), folded pairwise for longer lists. All products use arbitrary-precision integers.

Accepts up to 20 positive whole numbers, each up to 10¹². Zeros are skipped (every number divides 0, so LCM with 0 is degenerate).

Worked example

LCM of 12, 18, 30: factor each — 12 = 2²×3, 18 = 2×3², 30 = 2×3×5. Take the highest power of each prime: 2², 3², and 5. Multiply: 4 × 9 × 5 = 180. The GCF of the same list is 2 × 3 = 6.

Common mistakes

  • Multiplying all the numbers together — 12 × 18 × 30 = 6,480 is a common multiple but far from the least.
  • Taking the highest number in the list and assuming it works (30 is not divisible by 12).
  • Using the sum of exponents instead of the maximum per prime.
  • Confusing LCM with GCF — LCM is always ≥ the largest input, GCF always ≤ the smallest.

Where it is used

  • Adding fractions: the least common denominator is the LCM of the denominators.
  • Scheduling: when do repeating events (every 12 and 18 minutes) next coincide?
  • Gear ratios and rotations returning to their starting alignment.
  • Number-theory homework and competition math.

Frequently asked questions

What is the least common multiple?

The LCM of a set of whole numbers is the smallest positive number divisible by all of them. For 12, 18, and 30 it is 180 — no smaller number appears in all three multiplication tables.

How do I find the LCM with prime factorization?

Factor each number into primes, then multiply the highest power of every prime that appears. 12 = 2²×3, 18 = 2×3², 30 = 2×3×5, so the LCM is 2²×3²×5 = 180. The calculator prints exactly this working.

How are LCM and GCF related?

For two numbers, LCM(a,b) × GCF(a,b) = a × b. That identity gives a fast route: LCM = a×b ÷ GCF, where the GCF comes from Euclid’s algorithm. With more than two numbers, fold the pairwise LCM through the list.

Where is the LCM used in real life?

Anywhere cycles need to line up: buses leaving every 12 and 18 minutes coincide every 36 minutes; adding fractions needs a least common denominator, which is the LCM of the denominators; and gear or shift schedules repeat on LCM boundaries.

How large can the input numbers be?

Up to 20 whole numbers of up to a trillion (10¹²) each. The LCM itself is computed with arbitrary-precision arithmetic, so it stays exact even when it grows enormous.