CalcPro

LCM Calculator

Least common multiple of two or more numbers.

How it works

The least common multiple (LCM) is the smallest positive number that is divisible by all the numbers you input. It's useful whenever you need to find a common denominator, schedule repeating events, or solve problems involving cycles and patterns.

For example, if one task repeats every 12 days and another every 18 days, the LCM tells you when both will align on the same day.

The formula

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

Where GCD is the greatest common divisor. For three or more numbers, you find the LCM of the first two, then find the LCM of that result with the third number, and so on.

Alternatively, you can use prime factorization: break each number into its prime factors, then take the highest power of each prime that appears.

Worked example

Let's find the LCM of 12, 18, and 20.

Step 1: Prime factorization

  • 12 = 2² × 3
  • 18 = 2 × 3²
  • 20 = 2² × 5

Step 2: Identify the highest power of each prime

  • Highest power of 2: 2²
  • Highest power of 3: 3²
  • Highest power of 5: 5¹

Step 3: Multiply them together LCM = 2² × 3² × 5 = 4 × 9 × 5 = 180

Verification:

  • 180 ÷ 12 = 15 ✓
  • 180 ÷ 18 = 10 ✓
  • 180 ÷ 20 = 9 ✓

All divisions are whole numbers, confirming 180 is the smallest common multiple.

Another example with two numbers: Find LCM of 8 and 12.

  • 8 = 2³
  • 12 = 2² × 3
  • LCM = 2³ × 3 = 8 × 3 = 24

Using the formula method: GCD(8, 12) = 4, so LCM = (8 × 12) ÷ 4 = 96 ÷ 4 = 24. Same result.

Common mistakes

Confusing LCM with GCD: The GCD is the largest number that divides into all your inputs (e.g., GCD of 12 and 18 is 6). The LCM is the smallest number that all inputs divide into (e.g., LCM of 12 and 18 is 36). They're opposites.

Forgetting to use the highest power: When multiplying prime factors, you must use the highest exponent that appears across all numbers. If you use lower powers, you'll get a common multiple—but not the least one.

Assuming LCM of two numbers is their product: This only works if the numbers share no common factors (coprime numbers). For 3 and 5, LCM = 15 = 3 × 5. But for 4 and 6, LCM = 12, not 24, because they share the factor 2.

Practical tip: LCM is essential in real-world scheduling. If buses leave a station every 15 minutes and trains every 20 minutes, both depart together every LCM(15, 20) = 60 minutes. It's also crucial in fraction addition—to add 5/12 and 7/18, you convert to a common denominator of 36 (the LCM of 12 and 18), giving you 15/36 + 14/36 = 29/36.

Frequently asked questions

What's the difference between LCM and GCD?

GCD (greatest common divisor) is the largest number that divides evenly into all inputs. LCM (least common multiple) is the smallest number that all inputs divide evenly into. For 12 and 18: GCD = 6, LCM = 36.

Can I find the LCM of more than two numbers?

Yes. Find the LCM of the first two numbers, then find the LCM of that result with the third number. Repeat for any additional numbers. The calculator handles this automatically.

What if one of my numbers is 1?

The LCM of any number and 1 is always that number itself. For example, LCM(1, 5) = 5, and LCM(1, 100) = 100.

Why is LCM useful for fractions?

To add or subtract fractions with different denominators, you need a common denominator. The LCM of the denominators is the smallest denominator you can use, making calculations simpler.

What if I input the same number twice?

The LCM of a number with itself is that number. For example, LCM(7, 7) = 7.

Can I use this calculator for negative numbers?

LCM is typically defined for positive integers. If you input negative numbers, the calculator will work with their absolute values (the positive equivalents).