The least common multiple (LCM) of positive integers is the smallest positive integer divisible by every one of them. For 12 and 18, the LCM is 36: both divide 36 exactly, and no smaller positive number has that property.

LCMs help with repeating intervals and common denominators. They should be distinguished from greatest common divisors, which divide the original numbers rather than being divisible by them.

Prime factorizations of 12 and 18 show that their least common multiple is 36.
Twelve and eighteen require the largest power of each prime: two squared times three squared.Credit: MathBlog

Method 1: list multiples

Multiples of 12 begin 12, 24, 36, 48, 60, 72. Multiples of 18 begin 18, 36, 54, 72. The shared values include 36 and 72, but only 36 is the least positive one.

Listing is useful for small inputs and for understanding the definition. It becomes inefficient when the first shared value is large. Finding one shared multiple is not enough to prove it is the smallest.

Method 2: use prime factors

Write each number as a product of primes: \(12=2^{2}\times3\) and \(18=2\times3^{2}\). For each prime that appears, retain the largest exponent present in any input. The result is \(2^{2}\times3^{2}=36\).

Keeping the largest exponent ensures divisibility by every input. Keeping any smaller exponent would leave at least one input without enough copies of that prime. This establishes the least value, not just a common value.

Method 3: use the GCD

For positive integers a and b, \(\operatorname{LCM}(a,b)=\frac{a}{\operatorname{GCD}(a,b)}\times b\). The GCD of 12 and 18 is 6, so the LCM is \(\frac{12}{6}\times18=36\).

The Euclidean algorithm finds a GCD using repeated remainders. For example, \(18=1\times12+6\) and \(12=2\times6+0\). The last nonzero remainder is 6.

For more than two inputs, combine them successively. First \(\operatorname{LCM}(12,18)=36\), then \(\operatorname{LCM}(36,30)=180\). The resulting number is divisible by 12, 18, and 30.

Apply it to fractions

The least common denominator of \(\frac{1}{12}\) and \(\frac{1}{18}\) is 36. Rewrite them as \(\frac{3}{36}\) and \(\frac{2}{36}\) to obtain a sum of \(\frac{5}{36}\). Any shared denominator could work, but using the least one often keeps the arithmetic smaller.

See MathBlog’s fractions guide for equivalent fractions. A common denominator does not mean that the numerators should be multiplied together.

Conventions at zero

This definition uses positive inputs. Some programming libraries extend LCM to zero by defining \(\operatorname{LCM}(0,n)=0\). That is a software convention; zero is not a positive common multiple. State the input domain and convention when comparing tools.

Further reading