Least Common Multiple

The least common multiple is the smallest positive number that all given numbers divide into evenly; use it when adding fractions with different denominators.

lcm(a,b)=abgcd(a,b)\operatorname{lcm}(a,b) = \frac{|ab|}{\gcd(a,b)}

Solve a problem with Least Common Multiple

Type the problem. The solver will use Least Common Multiple where Least Common Multiple is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Least Common Multiple takes
aa
bb
Least Common Multiple
SymbolMeaning
aaOne of the numbers you're finding the LCM of; it can be positive or negative, though the formula uses a|a| (the absolute value) to ensure the result is always positive.
bbThe second number you're finding the LCM of; order doesn't matter, so lcm(a,b)=lcm(b,a)\operatorname{lcm}(a, b) = \operatorname{lcm}(b, a).

When to use it

Use LCM to add or subtract fractions with different denominators, or to find when periodic events coincide.

Level

Usually taught in: Pre-Algebra

Worked examples

1. Find the LCM of two single-digit numbers

Problem

Find lcm(4,6)\operatorname{lcm}(4, 6).
  1. 4=224 = 2^2

    First, express 4 as a product of primes.

  2. 6=236 = 2 \cdot 3

    Express 6 as a product of primes.

  3. gcd(4,6)=2\gcd(4, 6) = 2

    The greatest common factor is the product of the smallest powers of each prime that appears in both factorizations; here that's just 21=22^1 = 2.

  4. lcm(4,6)=46gcd(4,6)=242=12\operatorname{lcm}(4, 6) = \frac{4 \cdot 6}{\gcd(4, 6)} = \frac{24}{2} = 12

    Apply the formula: multiply the two numbers and divide by their GCD.

Answer: lcm(4,6)=12\operatorname{lcm}(4, 6) = 12

The LCM is the smallest number that both 4 and 6 divide into evenly: 4×3=124 \times 3 = 12 and 6×2=126 \times 2 = 12. The formula avoids having to list multiples.

2. Find the LCM with negative numbers and larger integers

Problem

Find lcm(15,25)\operatorname{lcm}(-15, 25).
  1. 15=15,25=25|-15| = 15, \quad |25| = 25

    Since LCM deals with positive multiples, take the absolute value of each number.

  2. 15=3515 = 3 \cdot 5

    Express 15 as a product of primes.

  3. 25=5225 = 5^2

    Express 25 as a product of primes.

  4. gcd(15,25)=5\gcd(15, 25) = 5

    The GCD is the product of the smallest powers of each shared prime; both have 515^1, and only 15 has 3.

  5. lcm(15,25)=1525gcd(15,25)=15255=3755=75\operatorname{lcm}(-15, 25) = \frac{|-15| \cdot |25|}{\gcd(15, 25)} = \frac{15 \cdot 25}{5} = \frac{375}{5} = 75

    Apply the formula using absolute values. This is the smallest positive number that both 15 and 25 divide into.

Answer: lcm(15,25)=75\operatorname{lcm}(-15, 25) = 75

Negative numbers don't change the LCM—we take absolute values first. The LCM is the smallest positive multiple shared by both numbers: 15×5=7515 \times 5 = 75 and 25×3=7525 \times 3 = 75.

3. Use LCM to find when game events coincide

Problem

In a video game, a bonus chest appears every 6 levels, and a rare shield appears every 8 levels. At which level will both appear together for the first time after level 1?
  1. 6=236 = 2 \cdot 3

    The bonus chest appears at level 6, 12, 18, 24, 30, 36, 42, 48, and so on—these are multiples of 6, which factors as 232 \cdot 3.

  2. 8=238 = 2^3

    The rare shield appears at level 8, 16, 24, 32, 40, 48, and so on—these are multiples of 8, which factors as 232^3.

  3. gcd(6,8)=2\gcd(6, 8) = 2

    Both numbers share the factor 2, but 8 has 232^3 while 6 has only 212^1, so the GCD is 21=22^1 = 2.

  4. lcm(6,8)=68gcd(6,8)=482=24\operatorname{lcm}(6, 8) = \frac{6 \cdot 8}{\gcd(6, 8)} = \frac{48}{2} = 24

    The LCM is the smallest level where both rewards appear together.

Answer: They both appear at level 24\text{They both appear at level } 24

Both rewards spawn at level 24 for the first time (after level 1), because 24 is the LCM of 6 and 8. Every LCM after that—levels 48, 72, 96—they'll both appear again.

Common mistakes

Where Least Common Multiple usually goes wrong
Answer came out wrong
Finding lcm(12,18)=121818=12\operatorname{lcm}(12, 18) = \frac{12 \cdot 18}{18} = 12
gcd(12,18)=6\gcd(12, 18) = 6, so lcm(12,18)=12186=2166=36\operatorname{lcm}(12, 18) = \frac{12 \cdot 18}{6} = \frac{216}{6} = 36.
The LCM of 5 and 7 is 12.
Since gcd(5,7)=1\gcd(5, 7) = 1, we have lcm(5,7)=571=35\operatorname{lcm}(5, 7) = \frac{5 \cdot 7}{1} = 35.
For lcm(6,9)\operatorname{lcm}(-6, 9), I computed 69gcd(6,9)=543=18\frac{-6 \cdot 9}{\gcd(-6, 9)} = \frac{-54}{3} = -18
lcm(6,9)=69gcd(6,9)=543=18\operatorname{lcm}(-6, 9) = \frac{|-6| \cdot |9|}{\gcd(6, 9)} = \frac{54}{3} = 18.
The mistakeWhy it is wrongThe fix
Finding lcm(12,18)=121818=12\operatorname{lcm}(12, 18) = \frac{12 \cdot 18}{18} = 12This incorrectly uses 18 as the GCD when it should be 6; the GCD must be found separately by prime factorization or the Euclidean algorithm, not by assuming it's one of the numbers.gcd(12,18)=6\gcd(12, 18) = 6, so lcm(12,18)=12186=2166=36\operatorname{lcm}(12, 18) = \frac{12 \cdot 18}{6} = \frac{216}{6} = 36.
The LCM of 5 and 7 is 12.Likely from confusing LCM with adding the numbers or misremembering the formula; 5 and 7 are coprime (they share no common factors), so their LCM is their product, not their sum.Since gcd(5,7)=1\gcd(5, 7) = 1, we have lcm(5,7)=571=35\operatorname{lcm}(5, 7) = \frac{5 \cdot 7}{1} = 35.
For lcm(6,9)\operatorname{lcm}(-6, 9), I computed 69gcd(6,9)=543=18\frac{-6 \cdot 9}{\gcd(-6, 9)} = \frac{-54}{3} = -18The formula requires absolute values because LCM is always positive; forgetting the absolute value bars in the numerator produces a negative result, which is never correct.lcm(6,9)=69gcd(6,9)=543=18\operatorname{lcm}(-6, 9) = \frac{|-6| \cdot |9|}{\gcd(6, 9)} = \frac{54}{3} = 18.

Tips and when to use something else

  • When numbers are coprime (GCD = 1), the LCM is just their product: lcm(a,b)=ab\operatorname{lcm}(a, b) = a \cdot b—no need to divide by anything.
  • For adding or subtracting fractions, use the LCM of the denominators as the common denominator—it's the smallest one that works.
  • Alternatively, find the LCM by listing multiples: write out the first several multiples of each number and find the smallest one they both have in common—this works well for small numbers.
  • For three or more numbers, apply the formula pairwise: first find lcm(a,b)\operatorname{lcm}(a, b), then find lcm(lcm(a,b),c)\operatorname{lcm}(\operatorname{lcm}(a, b), c).

Frequently asked questions

Why do I need the GCD to find the LCM?
The GCD helps avoid counting shared factors twice. If you just multiply a×ba \times b without dividing by the GCD, you'd get a common multiple, but not the *least* one. The formula lcm(a,b)=abgcd(a,b)\operatorname{lcm}(a,b) = \frac{ab}{\gcd(a,b)} 'removes' the duplication caused by shared prime factors.
What's the difference between LCM and GCD?
The GCD (greatest common factor) is the largest number that divides both numbers evenly. The LCM (least common multiple) is the smallest number that both numbers divide into evenly. They're opposites: GCD is about factors (what goes into the numbers), while LCM is about multiples (what the numbers go into). There's actually a connection between them: lcm(a,b)gcd(a,b)=ab\operatorname{lcm}(a, b) \cdot \gcd(a, b) = |a \cdot b|.
Can the LCM ever be smaller than both numbers?
No. The LCM is always at least as large as the larger of the two numbers, because a common multiple must be divisible by both numbers. If one number is 12 and the other is 18, the LCM is 36, which is larger than both.
What if one number is negative?
Negative numbers don't change the LCM. The formula uses absolute values, so lcm(8,12)=lcm(8,12)\operatorname{lcm}(-8, 12) = \operatorname{lcm}(8, 12). LCM only makes sense for positive results, since we're finding shared multiples.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18