Skip to the content

LCM Calculator (Least Common Multiple)

Enter two or more whole numbers to find their least common multiple, the smallest number that every one of them divides into.

Two or more whole numbers, separated by commas, spaces or new lines.

Least common multiple (LCM)

36

Greatest common divisor (GCD)

6

Euclidean algorithm

  1. 18 = 1 × 12 + 6
  2. 12 = 2 × 6 + 0

The remainder has reached 0, so the last divisor is the GCD: 6. The LCM follows from it: 12 × 18 ÷ 6 = 36.

Prime factorizations

12= 22 × 3
18= 2 × 32
GCD= 2 × 3 = 6
LCM= 22 × 32 = 36

The GCD takes each prime that all the numbers share, with the lowest exponent it has anywhere. The LCM takes every prime that occurs, with its highest exponent.

Share this tool:TwitterFacebookLinkedInWhatsAppEmail

Three ways to the least common multiple

The least common multiple (LCM) is the smallest positive number that every number in the list divides into. It is also called the lowest common multiple and, when the numbers are the denominators of fractions, the lowest common denominator.

By listing multiples

For small numbers, write out the multiples of each until the same number turns up in every row.

NumberIts multiples
1212, 24, 36, 48, 60, 72
1818, 36, 54, 72

36 is the first number that appears in both rows, so the LCM of 12 and 18 is 36. 72 is a common multiple as well, but not the least.

Through the GCD

For larger numbers the lists get long. The calculator first finds the greatest common divisor with Euclid's algorithm and then uses

LCM = a × b ÷ GCD

The GCD of 12 and 18 is 6, so the LCM is 12 × 18 ÷ 6 = 36. A longer list is taken a pair at a time. For 12, 18 and 20 that is first 36, and then the LCM of 36 and 20, which is 180.

Through the prime factors

12 = 22 × 3 and 18 = 2 × 32. Take every prime that occurs, with the highest power it reaches in any of the numbers: 22 × 32 = 36. The calculator shows this working under the answer.

Where you need it

  • Adding fractions. 5/12 + 7/18 needs the denominator 36: 15/36 + 14/36 = 29/36.
  • Things that repeat. Two buses leave together and then run every 12 and every 18 minutes. They next leave together after 36 minutes.

Multiplying the numbers always gives a common multiple, here 216. It is the least one only when the numbers have no factor in common.

The GCD & LCM calculator page explains why Euclid's algorithm works and what happens with zero and with negative numbers.

See all 9