LCM Calculator

Find the least common multiple of two or more whole numbers, with verification, GCD steps, and the prime factorization method.

Two to 20 whole numbers, separated by commas or spaces. Results update as you type.

Try
LCM = 180

The least common multiple of 12, 18, and 30 is 180.

Why is 180 the LCM?

180 is divisible by 12, 18, and 30, and no smaller positive number is divisible by all three.

Verification

  • 180 ÷ 12 = 15
  • 180 ÷ 18 = 10
  • 180 ÷ 30 = 6

Every division is a whole number, so 180 is a common multiple of all three numbers.

The greatest common factor of these numbers is 6. When you need the largest number that divides every input evenly, use the GCF Calculator. Adding fractions with different denominators? Use the LCM of the denominators as the common denominator, or work the sum in the Fraction Calculator.

How was this calculated?

Method 1 — GCD formula

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

Multiplying two numbers gives a common multiple, and dividing by their greatest common divisor removes the factors they share, leaving the smallest one.

With more than two numbers, apply the formula one pair at a time: LCM(a, b, c) = LCM(LCM(a, b), c).

Step 1 — LCM(12, 18)

  • GCD(12, 18) = 6
  • LCM = (12 × 18) ÷ 6
  • LCM = 216 ÷ 6
  • LCM = 36

Carry 36 forward to the next step.

Step 2 — LCM(36, 30)

  • GCD(36, 30) = 6
  • LCM = (36 × 30) ÷ 6
  • LCM = 1,080 ÷ 6
  • LCM = 180

Result

LCM(12, 18, 30) = 180

Method 2 — Prime factorization

Write each number as a product of primes:

  • 12 = 2 to the power of 2 times 3
  • 18 = 2 times 3 to the power of 2
  • 30 = 2 times 3 times 5

Take the highest power of every prime that appears:

  • 2 to the power of 2
  • 3 to the power of 2
  • 5

LCM = 2 to the power of 2 times 3 to the power of 2 times 5 = 180

This LCM calculator finds the least common multiple of two or more whole numbers: the smallest positive number that every number in the list divides into evenly. It checks the answer by dividing the LCM by each input, then shows two ways to reach it, the GCD formula and prime factorization.

Enter your numbers separated by commas or spaces, such as 12, 18, 30, and the LCM appears instantly.

Worked Calculation Examples

ScenarioResultCalculation Step
LCM of 4 and 612GCD(4, 6) = 2. LCM = (4 × 6) ÷ 2 = 24 ÷ 2 = 12.
LCM of 8 and 1224GCD(8, 12) = 4. LCM = (8 × 12) ÷ 4 = 96 ÷ 4 = 24.
LCM of 12, 18, and 30180LCM(12, 18) = 216 ÷ 6 = 36. Then LCM(36, 30) = 1,080 ÷ 6 = 180. Check: 180 ÷ 12 = 15, 180 ÷ 18 = 10, 180 ÷ 30 = 6.
LCM of 12 and 18 by prime factorization3612 = 2² × 3 and 18 = 2 × 3². Take the highest power of each prime: 2² × 3² = 4 × 9 = 36.
LCM of 1 and 881 divides every whole number, so it never changes the LCM. The smallest multiple of 8 that 1 also divides is 8 itself.

The LCM Formula and the GCD

For two positive integers, LCM(a, b) = |a × b| ÷ GCD(a, b). Multiplying the two numbers always gives a common multiple, but not always the smallest one: 12 × 18 = 216 is a multiple of both, yet so is 36. The greatest common divisor, 6 in this case, counts the factors the two numbers share, and dividing by it removes that overlap: 216 ÷ 6 = 36.

For three or more numbers, apply the formula one pair at a time: LCM(a, b, c) = LCM(LCM(a, b), c). The calculator shows each of these pairwise steps for the numbers you enter.

Finding the LCM with Prime Factorization

Write each number as a product of primes, then multiply the highest power of every prime that appears. For 12, 18, and 30: 12 = 2² × 3, 18 = 2 × 3², and 30 = 2 × 3 × 5. The highest powers are 2², 3², and 5, so the LCM is 4 × 9 × 5 = 180.

This method makes it easy to see why the answer is the smallest common multiple: it contains exactly enough of each prime to be divisible by every number, and nothing extra.

LCM vs. GCF

The least common multiple (LCM) is the smallest positive number that all the given numbers divide into evenly. The greatest common factor (GCF, also called the greatest common divisor) is the largest number that divides all of them evenly. For 12 and 18, the GCF is 6 and the LCM is 36.

For two positive numbers, the two are linked: GCF × LCM = a × b, so 6 × 36 = 12 × 18 = 216. Use the LCM when you need a shared multiple, such as a common denominator or when two repeating schedules line up. Use the GCF when you need to split or simplify, such as reducing a fraction.

Using the LCM to Add Fractions

Fractions with different denominators need a common denominator before they can be added or subtracted, and the LCM of the denominators is the smallest one that works. For 1/4 + 1/6, the LCM of 4 and 6 is 12. Convert each fraction: 1/4 = 3/12 and 1/6 = 2/12. Then 3/12 + 2/12 = 5/12.

Multiplying the denominators (4 × 6 = 24) also works, but gives 6/24 + 4/24 = 10/24, which still has to be simplified to 5/12.

How to Use the LCM Calculator

  1. Enter two or more whole numbers, separated by commas or spaces (for example 12, 18, 30). The result updates as you type.
  2. Read the least common multiple in the result card.
  3. Check the verification lines, which divide the LCM by each number to show it is a multiple of all of them.
  4. Follow "How was this calculated?" to see the GCD formula applied step by step, and the prime factorization method.
  5. Use Reset or one of the examples to start a new calculation.

Frequently Asked Questions

What is the least common multiple?

The least common multiple (LCM) of two or more whole numbers is the smallest positive number that each of them divides into evenly. For example, the LCM of 4 and 6 is 12.

How do you calculate the LCM of two numbers?

Multiply the two numbers and divide by their greatest common divisor: LCM(a, b) = |a × b| ÷ GCD(a, b). For 8 and 12, GCD = 4, so LCM = 96 ÷ 4 = 24.

How do you find the LCM of three or more numbers?

Find the LCM of the first two numbers, then find the LCM of that result and the next number, and continue through the list. For 12, 18, and 30: LCM(12, 18) = 36, then LCM(36, 30) = 180.

What is the LCM of 4 and 6?

The LCM of 4 and 6 is 12. It is the smallest number that both 4 and 6 divide into evenly: 12 ÷ 4 = 3 and 12 ÷ 6 = 2.

What is the difference between LCM and GCF?

The LCM is the smallest number that all the given numbers divide into, while the GCF is the largest number that divides all of them. For 12 and 18, the LCM is 36 and the GCF is 6.

Why is LCM useful when adding fractions?

The LCM of the denominators is the least common denominator, the smallest denominator both fractions can be rewritten with. For 1/4 + 1/6, the LCM of 4 and 6 is 12, so the sum is 3/12 + 2/12 = 5/12.

Can the LCM of two numbers be smaller than either number?

No. For positive whole numbers, the LCM is always at least as large as the largest number, because it must be a multiple of it. It equals the largest number when that number is already a multiple of the others, as in LCM(4, 8) = 8.

How does prime factorization find the LCM?

Break each number into prime factors, then multiply the highest power of every prime that appears. For 12 = 2² × 3 and 18 = 2 × 3², the LCM is 2² × 3² = 36.

What is the relationship between LCM and GCD?

For two positive integers, LCM(a, b) × GCD(a, b) = a × b. That is why the LCM can be found by dividing the product of the numbers by their GCD.

What happens when one of the numbers is 1 or 0?

1 divides every whole number, so it never changes the LCM: LCM(1, 8) = 8. 0 is different: its only multiple is 0, so by the standard convention the LCM of any list containing 0 is 0. Some textbooks define the LCM only for nonzero numbers.

Last updated: September 27, 2026.