LCM Calculator

Least common multiple of any list of positive whole numbers — with step-by-step prime factorization and the GCD shown as a bonus.

What is the least common multiple?

The least common multiple (LCM) of a set of positive integers is the smallest positive number that every input divides into with no remainder. It is what you need whenever repeating things must line up: common denominators for fractions, syncing schedules, or packing quantities into several bundle sizes.

LCM calculator, piece by piece

Each card explains one part of what this calculator does with your input — how it factors each number, how it builds the LCM from those factors, and the shortcut that keeps it fast for large values.

List multiples — the visual method

Write out multiples of each number and look for the smallest one that appears in every list. This is what happens on paper, and the calculator's first result box mirrors it: the smallest number every input divides into.

smallest m
m mod aᵢ = 0 for every input aᵢ
6: 6 12 18 24 30 368: 8 16 24 32 40 48LCM = 24
Example
Given
a = 6
b = 8
Substitute
first common multiple
Answer
24

Prime factorization — how the calculator builds the LCM

Every result on this page uses the prime-factorization method: factor each input, then for each prime that appears, take the highestpower seen across the inputs. Multiplying those together gives the LCM. The bar chart above shows exactly which exponent won for each prime.

LCM = ∏ pmax(eᵢ)
peach prime that appears in any input·eᵢthe exponent of p in input i
12 = 2² × 318 = 2 × 3²30 = 2 × 3 × 5max: 2², 3², 5= 4 × 9 × 5 = 180
Example
Given
12, 18, 30
Substitute
2², 3², 5¹
Answer
180

GCD shortcut — why the answer stays exact for huge numbers

The calculator also reports the GCD, and the two are linked by a × b = GCD(a,b) × LCM(a,b). Folding this identity pairwise across the list avoids ever multiplying enormous numbers together — that is how the tool stays instant even when the inputs get big.

LCM(a
b) = a × b / GCD(a
b)
GCDgreatest common divisor of the two numbers
a × bGCD(a,b)= LCM(a,b)12·18 / 6 = 36
Example
Given
12
18
GCD = 6
Substitute
12 × 18 / 6
Answer
36

Features of this calculator

  • Accepts a comma- or space-separated list of two or more positive integers
  • Shows the prime factorization of every input
  • Explains how the LCM is built by taking the highest power of each prime
  • Also reports the GCD of the same set of numbers
  • Handles large numbers without overflow using the GCD identity

Frequently asked questions

+What is the difference between LCM and GCF?

GCF is the largest number that divides every input; LCM is the smallest number every input divides into. For two positive integers they satisfy a × b = GCF(a, b) × LCM(a, b).

+How do I find the LCM of more than two numbers?

Work pairwise: LCM of the first two, then the LCM of that with the next number, and so on until every input has been folded in.

+Can the LCM be smaller than the largest input?

No — the LCM must be a multiple of every input, so it is always at least as large as the biggest number in the list.

Related calculators