LCM Calculator – Find the Least Common Multiple

How to Calculate the Least Common Multiple (LCM)

Step-by-step method to find the LCM of multiple numbers using prime factorization or the GCD formula.

  1. 1. Enter your numbers: Input 2 to 10 whole numbers. Use the "+ Add Number" button to include more values.
  2. 2. Choose a quick example (optional): Click any of the pre-built examples to instantly see how the calculator handles different scenarios like coprime or negative numbers.
  3. 3. Review the step-by-step breakdown: See the prime factorization of each number, the highest powers selected, and the final multiplication step.
  4. 4. Check verification and common multiples: Confirm the result using the verification table (LCM ÷ Number) and view the first few positive common multiples.

What Is LCM?

The least common multiple (LCM) of two or more whole numbers is the smallest positive integer that is divisible by each of those numbers.

Example: the least common multiple of 12 and 18 is 36, because 36 is the smallest positive integer divisible by both 12 and 18.

LCM Formula

For two integers a and b:

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

In practice the calculator uses the overflow-safe form:

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

Dividing by the GCD before multiplying keeps intermediate values smaller and preserves exactness for large integers.

How to Find the LCM

One reliable method is prime factorization:

  1. Factor each number into primes.
  2. For every prime that appears, take the highest power required by any input.
  3. Multiply those highest powers together.

Example:

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

Highest powers: 2² × 3² → LCM = 36.

LCM Using the GCD

For two numbers you can also use the relationship with the greatest common divisor:

GCD(12, 18) = 6

LCM = 12 ÷ 6 × 18 = 36

You can check: LCM × GCD = |a × b| → 36 × 6 = 216 = 12 × 18.

LCM of Three or More Numbers

Extend pairwise:

LCM(a, b, c) = LCM(LCM(a, b), c)

Example: 4, 6, 8

  • LCM(4, 6) = 12
  • LCM(12, 8) = 24

Therefore LCM(4, 6, 8) = 24.

LCM vs GCD

  • LCM — the smallest positive common multiple of the numbers.
  • GCD — the greatest positive integer that divides all of the numbers.

For 12 and 18: LCM = 36, GCD = 6.

LCM and Coprime Numbers

When two positive integers have GCD = 1 they are relatively prime (coprime). Their LCM equals their product.

Example: 8 and 15 → GCD = 1 → LCM = 120.

LCM of Negative Numbers

The conventional LCM is non-negative. Signs do not change the result.

LCM(−12, 18) = 36.

LCM With One

LCM(1, n) = n for any positive integer n.

Example: LCM(1, 15) = 15.

LCM With Zero

Under the arithmetic convention used by this calculator, LCM(0, n) = 0 for nonzero n. There is no positive common multiple of 0 and a nonzero integer under the strict “smallest positive common multiple” definition; the calculator reports 0 and explains the convention.

LCM(0, 0) is treated as undefined.

Common LCM Mistakes

  • Confusing LCM with GCD — LCM finds a common multiple; GCD finds a common divisor.
  • Assuming the LCM is one of the inputs — often it is larger than every input.
  • Missing a prime power — every prime needed by any input must appear at its highest required exponent.
  • Multiplying all numbers blindly — the product is always a common multiple for positive integers, but not always the least. Example: 6 × 8 = 48 while LCM(6, 8) = 24.
  • Ignoring signs — the conventional LCM is positive regardless of input signs.

Frequently Asked Questions

Q: What is LCM?

The least common multiple (LCM) of two or more whole numbers is the smallest positive integer that is divisible by each of those numbers.

Q: What is the least common multiple of two numbers?

It is the smallest positive integer that can be divided evenly by both numbers. For example, the LCM of 12 and 18 is 36.

Q: How do you calculate LCM?

You can calculate it by finding the prime factorization of each number and multiplying the highest powers of all primes present, or by using the GCD formula: LCM(a, b) = |a × b| / GCD(a, b).

Q: What is the LCM formula?

For two integers a and b, the formula is LCM(a, b) = |a × b| / GCD(a, b). In practice, the calculator uses the overflow-safe form: |a / GCD(a, b) × b| to keep intermediate values smaller.

Q: How do you find LCM using prime factorization?

Factor each number into primes. For every prime that appears in any factorization, take the highest exponent required. Multiply those highest powers together to get the LCM.

Q: What is the difference between LCM and GCD?

LCM (Least Common Multiple) finds the smallest common multiple (a number the inputs divide into), while GCD (Greatest Common Divisor) finds the greatest positive integer that divides into all the inputs.

Q: How do you find the LCM of three numbers?

Extend the pairwise method: LCM(a, b, c) = LCM(LCM(a, b), c). For example, to find the LCM of 4, 6, and 8, first find LCM(4, 6) = 12, then find LCM(12, 8) = 24.

Q: Can LCM be calculated for negative numbers?

Yes. The conventional LCM is always non-negative. The calculator uses the absolute values of the inputs, so LCM(−12, 18) is the same as LCM(12, 18), which is 36.

Q: What is the LCM of 1 and another number?

The LCM of 1 and any positive integer n is simply n. For example, LCM(1, 15) = 15, because 15 is the smallest number divisible by both 1 and 15.

Q: What happens when one of the numbers is zero?

Under standard arithmetic convention, LCM(0, n) = 0 for any nonzero n, because 0 is the only multiple of 0. LCM(0, 0) is treated as undefined.

Q: Can LCM be larger than both numbers?

Yes, the LCM is often larger than every input number (e.g., LCM of 4 and 6 is 12). It only equals one of the inputs if one number is already a multiple of the other (e.g., LCM of 3 and 9 is 9).