how to calculate lcm

LCM Calculator

Enter two or more integers separated by commas or spaces. Example: 12, 18, 30

Tip: Negative values are treated by absolute value. If any number is 0, the LCM is 0.

What is LCM?

The Least Common Multiple (LCM) of two or more numbers is the smallest positive number that all of them divide into evenly. For example, the LCM of 4 and 6 is 12, because 12 is the first number that appears in both multiplication tables:

  • Multiples of 4: 4, 8, 12, 16, 20, ...
  • Multiples of 6: 6, 12, 18, 24, ...

You will use LCM often when adding fractions, setting schedules, solving word problems, and simplifying ratio-based calculations.

Why learning LCM matters

Knowing how to calculate LCM helps in practical and academic situations:

  • Fractions: Find a common denominator quickly.
  • Time cycles: Determine when repeating events happen together.
  • Algebra: Simplify expressions involving denominators.
  • Number sense: Build fluency with factors and multiples.

Method 1: List multiples (best for small numbers)

Example: LCM of 8 and 12

  • Multiples of 8: 8, 16, 24, 32, 40, ...
  • Multiples of 12: 12, 24, 36, 48, ...

The first common multiple is 24, so LCM(8, 12) = 24.

This method is intuitive and easy, but it becomes slow when numbers are large.

Method 2: Prime factorization (very reliable)

Example: LCM of 18 and 30

Break each number into prime factors:

  • 18 = 2 × 3²
  • 30 = 2 × 3 × 5

For the LCM, choose each prime with its highest power that appears:

  • 2¹, 3², 5¹

Multiply them: 2 × 9 × 5 = 90. So LCM(18, 30) = 90.

Method 3: Use GCD formula (fast and efficient)

For two numbers a and b, use:

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

Example: LCM of 21 and 6

  • GCD(21, 6) = 3
  • LCM = (21 × 6) ÷ 3 = 126 ÷ 3 = 42

This is usually the best method for calculators and coding.

How to calculate LCM of more than two numbers

Compute LCM in sequence:

  1. Find LCM of first two numbers.
  2. Use that result with the next number.
  3. Repeat until done.

Example: LCM of 4, 6, and 10

  • LCM(4, 6) = 12
  • LCM(12, 10) = 60

Final answer: LCM(4, 6, 10) = 60.

Common mistakes to avoid

  • Mixing up LCM with GCD/HCF.
  • Stopping too early while listing multiples.
  • Forgetting prime exponents in factorization (like using 3 instead of 3²).
  • Using subtraction/addition when the formula needs multiplication and division.

Quick practice problems

  • LCM(9, 15) = 45
  • LCM(14, 20) = 140
  • LCM(16, 24, 30) = 240
  • LCM(7, 11) = 77

Final takeaway

If numbers are small, listing multiples works. If numbers are medium to large, use prime factorization or the GCD formula. For speed and accuracy, use the calculator above and review the generated steps to understand each stage.

🔗 Related Calculators