Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Least Common Multiple (LCM)






The Smallest Shared Multiple

While the GCD finds the largest number that divides two given integers. The LCM works in the opposite direction — it finds the smallest number that both integers divide into. Where the GCD looks downward into shared factor structure, the LCM looks upward to the first point where two multiplication sequences meet.



What is LCM?

The least common multiple of two positive integers aa and bb, written lcm(a,b)\text{lcm}(a, b), is the smallest positive integer divisible by both.

The multiples of 44 are 4,8,12,16,20,24,4, 8, 12, 16, 20, 24, \ldots The multiples of 66 are 6,12,18,24,30,6, 12, 18, 24, 30, \ldots The numbers appearing in both lists — the common multiples — are 12,24,36,12, 24, 36, \ldots The smallest is 1212, so lcm(4,6)=12\text{lcm}(4, 6) = 12.

The LCM always exists and is always at least as large as the larger input: lcm(a,b)max(a,b)\text{lcm}(a, b) \geq \max(a, b). The result must be a multiple of both numbers, so it cannot be smaller than either one.

At the other extreme, lcm(a,b)ab\text{lcm}(a, b) \leq a \cdot b. The product aba \cdot b is always a common multiple — the LCM may equal it or may be smaller, but never exceeds it.

Basic Properties

Several properties mirror those of the GCD, with directions reversed.

lcm(a,a)=a\text{lcm}(a, a) = a. The smallest multiple of aa that is also a multiple of aa is just aa itself.

lcm(a,1)=a\text{lcm}(a, 1) = a. Every positive integer is a multiple of 11, so aa already qualifies.

lcm(a,b)=lcm(b,a)\text{lcm}(a, b) = \text{lcm}(b, a). Order is irrelevant — the common multiples of aa and bb are the same as those of bb and aa.

lcm(a,b)ab\text{lcm}(a, b) \leq a \cdot b, with equality when aa and bb are coprime. The product provides an upper bound; shared factors bring the LCM below it.

Both aa and bb divide lcm(a,b)\text{lcm}(a, b) by definition. And the LCM divides every other common multiple — it is the smallest, and all others are its multiples.

Method 1: Listing Multiples

The most direct approach lists multiples of each number and identifies the first overlap.

For lcm(6,8)\text{lcm}(6, 8):

Multiples of 66: 6,12,18,24,30,36,6, 12, 18, 24, 30, 36, \ldots

Multiples of 88: 8,16,24,32,40,8, 16, 24, 32, 40, \ldots

The first number appearing in both lists is 2424, so lcm(6,8)=24\text{lcm}(6, 8) = 24.

The method is intuitive and works well for small inputs. It becomes tedious when the LCM is much larger than the inputs — for lcm(7,13)=91\text{lcm}(7, 13) = 91, listing multiples of 77 up to 9191 requires thirteen entries. The methods that follow avoid this exhaustive search.

Method 2: Prime Factorization

The prime factorization approach mirrors the GCD method, but takes the maximum exponent for each prime instead of the minimum.

For lcm(12,18)\text{lcm}(12, 18):

12=223112 = 2^2 \cdot 3^1

18=213218 = 2^1 \cdot 3^2

Every prime appearing in either factorization must appear in the LCM — otherwise the LCM would not be divisible by both. Take the larger exponent for each: max(2,1)=2\max(2, 1) = 2 for the prime 22, and max(1,2)=2\max(1, 2) = 2 for the prime 33.

lcm(12,18)=2232=49=36\text{lcm}(12, 18) = 2^2 \cdot 3^2 = 4 \cdot 9 = 36


The contrast with the GCD is symmetric. The GCD takes the minimum exponent — the overlap. The LCM takes the maximum — the full coverage needed to accommodate both numbers.

Method 3: Using GCD

When the GCD is known or easy to compute — particularly through the Euclidean algorithm — the LCM follows from a single formula:

lcm(a,b)=abgcd(a,b)\text{lcm}(a, b) = \frac{a \cdot b}{\gcd(a, b)}


For lcm(12,18)\text{lcm}(12, 18): gcd(12,18)=6\gcd(12, 18) = 6, so lcm=12186=2166=36\text{lcm} = \frac{12 \cdot 18}{6} = \frac{216}{6} = 36.

For lcm(35,15)\text{lcm}(35, 15): gcd(35,15)=5\gcd(35, 15) = 5, so lcm=35155=5255=105\text{lcm} = \frac{35 \cdot 15}{5} = \frac{525}{5} = 105.

This is often the fastest route. The Euclidean algorithm finds the GCD efficiently even for large numbers, and a single division then delivers the LCM. No factorization or multiple-listing is needed.

A practical note: to avoid integer overflow in computation, divide before multiplying — compute agcd(a,b)b\frac{a}{\gcd(a,b)} \cdot b rather than abgcd(a,b)\frac{a \cdot b}{\gcd(a,b)}.

The GCD–LCM Relationship

For any positive integers aa and bb:

ab=gcd(a,b)lcm(a,b)a \cdot b = \gcd(a, b) \cdot \text{lcm}(a, b)


The identity holds because the GCD and LCM partition the prime structure of aba \cdot b without overlap or omission.

Consider a prime pp appearing with exponent α\alpha in aa and β\beta in bb. Its exponent in aba \cdot b is α+β\alpha + \beta. Its exponent in the GCD is min(α,β)\min(\alpha, \beta), and in the LCM is max(α,β)\max(\alpha, \beta). Since min(α,β)+max(α,β)=α+β\min(\alpha, \beta) + \max(\alpha, \beta) = \alpha + \beta, the exponents in gcdlcm\gcd \cdot \text{lcm} match those in aba \cdot b.

This holds for every prime simultaneously, so the products are equal.

The relationship is useful in both directions. Knowing the GCD gives the LCM, and knowing the LCM gives the GCD — each determines the other when aa and bb are fixed.

When aa and bb Are Coprime

If gcd(a,b)=1\gcd(a, b) = 1, the GCD–LCM formula simplifies to:

lcm(a,b)=ab\text{lcm}(a, b) = a \cdot b


With no shared prime factors, nothing overlaps. Every prime in aa is absent from bb, and every prime in bb is absent from aa. The LCM must include all of them at full strength, which is exactly what the product provides.

lcm(7,9)=63\text{lcm}(7, 9) = 63. The numbers share no common factor (gcd=1\gcd = 1), so the LCM equals their product.

lcm(8,15)=120\text{lcm}(8, 15) = 120. Again coprime, so 8×15=1208 \times 15 = 120.

This also works in reverse: if lcm(a,b)=ab\text{lcm}(a, b) = a \cdot b, then aa and bb must be coprime. Any shared factor would pull the LCM below the product.

When One Divides the Other

If aba \mid b, then lcm(a,b)=b\text{lcm}(a, b) = b.

The larger number is already a multiple of the smaller. No number bigger than bb is needed — bb itself is divisible by both aa and bb.

lcm(4,12)=12\text{lcm}(4, 12) = 12, because 4124 \mid 12.

lcm(5,30)=30\text{lcm}(5, 30) = 30, because 5305 \mid 30.

lcm(a,a)=a\text{lcm}(a, a) = a, because every number divides itself.

This is the minimal case — the LCM equals the larger input. At the other extreme (coprime numbers), the LCM equals the full product. Every other case falls between these bounds: max(a,b)lcm(a,b)ab\max(a, b) \leq \text{lcm}(a, b) \leq a \cdot b.

LCM of More Than Two Numbers

Like the GCD, the LCM extends to more than two numbers by applying it pairwise:

lcm(a,b,c)=lcm(lcm(a,b),  c)\text{lcm}(a, b, c) = \text{lcm}(\text{lcm}(a, b), \; c)


For lcm(4,6,9)\text{lcm}(4, 6, 9):

lcm(4,6)=12\text{lcm}(4, 6) = 12.

lcm(12,9)\text{lcm}(12, 9): factoring gives 12=22312 = 2^2 \cdot 3 and 9=329 = 3^2. Maximum exponents: 2232=362^2 \cdot 3^2 = 36.

So lcm(4,6,9)=36\text{lcm}(4, 6, 9) = 36.

Alternatively, factor all three numbers at once and take the maximum exponent for each prime across all factorizations. Here 4=224 = 2^2, 6=236 = 2 \cdot 3, 9=329 = 3^2. The primes present are 22 and 33, with maximums 222^2 and 323^2. The result is 3636 — the same answer by a more direct route.

The order of pairing does not matter. The LCM is associative and commutative.

Applications of LCM

Adding fractions with different denominators requires a common denominator, and the LCM of the denominators is the smallest one that works. To add 14+16\frac{1}{4} + \frac{1}{6}: lcm(4,6)=12\text{lcm}(4, 6) = 12, so 14=312\frac{1}{4} = \frac{3}{12} and 16=212\frac{1}{6} = \frac{2}{12}, giving 512\frac{5}{12}.

Scheduling problems are natural LCM applications. If Bus A arrives every 1212 minutes and Bus B every 1818 minutes, and both just arrived simultaneously, they next coincide in lcm(12,18)=36\text{lcm}(12, 18) = 36 minutes.

Cycle synchronization follows the same pattern. Two gears with 1212 and 1818 teeth respectively realign after 3636 teeth have passed the contact point. Two blinking lights with periods of 44 and 66 seconds flash together every 1212 seconds.

In each case, the question is the same: when does the first simultaneous recurrence occur? The answer is always the LCM of the individual periods.

Worked Examples

Find lcm(8,14)\text{lcm}(8, 14) by listing multiples. Multiples of 88: 8,16,24,32,40,48,568, 16, 24, 32, 40, 48, 56. Multiples of 1414: 14,28,42,5614, 28, 42, 56. First common multiple: 5656. So lcm(8,14)=56\text{lcm}(8, 14) = 56.

Find lcm(24,90)\text{lcm}(24, 90) by prime factorization. 24=23324 = 2^3 \cdot 3 and 90=232590 = 2 \cdot 3^2 \cdot 5. Maximum exponents: 23325=895=3602^3 \cdot 3^2 \cdot 5 = 8 \cdot 9 \cdot 5 = 360.

Find lcm(35,15)\text{lcm}(35, 15) using the GCD. gcd(35,15)=5\gcd(35, 15) = 5. So lcm=35155=105\text{lcm} = \frac{35 \cdot 15}{5} = 105.

Find the common denominator for 512+718\frac{5}{12} + \frac{7}{18}. lcm(12,18)=36\text{lcm}(12, 18) = 36. Convert: 512=1536\frac{5}{12} = \frac{15}{36} and 718=1436\frac{7}{18} = \frac{14}{36}. Sum: 2936\frac{29}{36}.

Verify: gcd(8,14)lcm(8,14)=256=112=814\gcd(8, 14) \cdot \text{lcm}(8, 14) = 2 \cdot 56 = 112 = 8 \cdot 14. The identity holds.

Find lcm(6,10,15)\text{lcm}(6, 10, 15). lcm(6,10)=30\text{lcm}(6, 10) = 30. lcm(30,15)=30\text{lcm}(30, 15) = 30 (since 153015 \mid 30). So lcm(6,10,15)=30\text{lcm}(6, 10, 15) = 30.