LCM Calculator

Find the least common multiple of two to six numbers at once, with prime factorizations, the step-by-step pairwise workings, the shared GCD, and the first multiples of the answer.

What you get
  • Up to six numbers at onceSolved pairwise, with every step shown.
  • Prime factorizationsEach input broken into its prime powers.
  • The GCD alongsideBoth shared measures, computed the same way.

Your numbers

Results update as you type

Whole numbers from 1 upward, up to six of them. Decimals, zero and negative values have no multiples in this sense, so they are rejected.

Runs entirely in your browser. Nothing you type is sent or saved

LCM guide

What the least common multiple is

A multiple of a number is what you get by multiplying it by a whole number: the multiples of 4 are 4, 8, 12, 16, 20, and so on forever. Two numbers' multiples overlap, and the smallest shared one is the least common multiple, written LCM. The multiples of 6 are 6, 12, 18, 24; comparing the two lists, the first number to appear in both is 12, so LCM(4, 6) = 12.

Listing multiples works, and it is worth doing once by hand to see what the LCM means, but it is slow for larger numbers: the brute-force search for LCM(18, 26) has to walk both lists out to 234 before they meet. Two systematic methods do it in a few lines, and this calculator shows both.

Two ways to find the LCM

Prime factorization

Break every number into prime factors, then build a number that carries the highest power of each prime that appears anywhere:

LCM = product of every prime, raised to its highest power seen

12 = 22 × 3 · 18 = 2 × 32 · 30 = 2 × 3 × 5 → LCM = 22 × 32 × 5 = 180

Checking by hand: 12 divides 180 (180 ÷ 12 = 15), 18 divides 180 (10), and 30 divides 180 (6), and no smaller number manages all three, so LCM(12, 18, 30) = 180.

The GCD shortcut

For two numbers there is a faster identity, built from the greatest common divisor:

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

4 × 6 = 24, and GCD(4, 6) = 2, so LCM = 24 ÷ 2 = 12

For more than two numbers, chain it: find the LCM of the first pair, then the LCM of that result with the next number, and so on. The calculator's step table shows every one of those pairings, including the GCD used at each step.

The coprime case: when two numbers share no common factor, their GCD is 1 and their LCM is simply their product. LCM(7, 13) = 91. This is the quickest sanity check the shortcut gives you.

Why the LCM matters

  • Adding fractions: to add 1/4 + 1/6, both denominators must become the same number, and the smallest workable choice is the LCM: LCM(4, 6) = 12, so the sum is 3/12 + 2/12 = 5/12. Using 24 would also work but leaves more simplifying to do.
  • Events that repeat: two bells ring every 4 and every 6 minutes. Starting together, they next ring together after LCM(4, 6) = 12 minutes. The same arithmetic schedules bus meetups, chore rotations and content publishing cycles.
  • Gears and cycles: teeth on meshing gears and repeating patterns in computing line up again after a number of steps equal to the LCM of their periods.

Using the calculator well

  • Whole numbers only: multiples are defined by whole-number multiplication, so decimals, zero and negatives are rejected. For fractions, reduce each to whole numbers first, or use the fraction calculator.
  • Two to six numbers: the list starts with two fields and grows to six with the add button. The pairwise chaining means order does not matter; any arrangement gives the same LCM.
  • Watch the size: coprime inputs multiply, so large coprime numbers produce enormous LCMs. Each input can be up to nine digits, and the calculator refuses results beyond 1015 rather than risking a rounded, wrong answer.
  • Read the GCD too: the shared GCD appears beside the LCM, and the two are linked by a tidy identity: GCD(a, b) × LCM(a, b) = a × b for two numbers. For 4 and 6, 2 × 12 = 24 = 4 × 6.
  • Check with the multiples list: the first five multiples of the answer are printed under the steps. Each input should divide every one of them; if your hand computation disagrees, one of the two is wrong.

A short history

The machinery behind this calculator is old. The Euclidean algorithm, the fast method for the GCD that powers the LCM shortcut, appears in Euclid's Elements around 300 BC, where it is used to measure commensurability of lengths; it is often called the oldest nontrivial algorithm still in daily use. Babylonian scribes some 1,500 years before that worked with lists of reciprocals that implicitly relied on shared multiples to handle fractions.

Prime factorization as a systematic tool matured much later, with Euler and Gauss putting the fundamental theorem of arithmetic (every whole number above 1 factors into primes in exactly one way) on firm ground in the 1700s and 1800s. That theorem is why the highest-power method always works: two factorizations cannot disagree about which primes divide a number, so the LCM built from the highest powers is forced to be the least shared multiple.

Common questions

The LCM is the smallest number both inputs divide into; the GCD is the largest number that divides both. For 4 and 6, the LCM is 12 and the GCD is 2. The LCM is always at least as large as the biggest input, the GCD never larger than the smallest, and for two numbers they are linked by GCD × LCM = the product of the inputs.

Their product. When two numbers share no prime factors, their GCD is 1, so the shortcut a × b ÷ GCD gives exactly a × b. LCM(7, 13) = 91 and LCM(8, 15) = 120. This is the quickest sanity check the shortcut gives you.

Fractions can only be added when they count the same-sized pieces, so the denominators must match. Any common multiple works, but the least common multiple gives the smallest rewrite: 1/4 + 1/6 becomes 3/12 + 2/12 using LCM(4, 6) = 12. That is why textbook methods say "find the least common denominator", which is the LCM of the denominators.

Never. Each input divides the LCM by definition, and a positive divisor of a positive number cannot exceed it, so the LCM is always at least the largest input. It equals the largest input exactly when that input is a multiple of all the others, as with LCM(3, 6) = 6.

It chains pairwise: LCM of the first two, then the LCM of that result with the third, and so on. This works because a number divisible by all inputs is exactly a number divisible by the running LCM and the next input. The step table lists each pairing with the GCD it used, so you can follow the whole chain.

No. Common multiples go on forever: once you have one, multiplying it by 2, 3, 4 and so on produces more, because every multiple of a common multiple is again a common multiple. That is why only the least one is named and useful.

Coprime inputs multiply, so large independent numbers can produce LCMs beyond what a standard computer number represents exactly: past about 9 quadrillion, digits start to be rounded silently. Rather than risk a wrong-looking right answer, the calculator stops at 10 to the 15th and asks for smaller inputs. For huge integers, exact tools that use arbitrary-precision arithmetic are the right instrument.

No. Every calculation runs in your browser. Nothing is stored or transmitted.

Shared ground for your numbers, found in seconds.

Browse all math calculators