LCM Calculator

Separate numbers with commas, spaces, or line breaks. Example: 4, 6, 8
Least common multiple –
Greatest common divisor (bonus) –

Step-by-step working

Prime factorization of each input

What Is an LCM?

The least common multiple (LCM) of two or more numbers is the smallest positive number that is a multiple of every number in the set. Think of it as the first number that appears in all of the multiplication tables for your inputs.

For example, the multiples of 4 are 4, 8, 12, 16, 20, 24… and the multiples of 6 are 6, 12, 18, 24, 30… The common multiples are 12, 24, 36… and the smallest of those is 12, so LCM(4, 6) = 12.

Step by step LCM calculation showing prime factorization and the GCD identity

How to Use This LCM Calculator

  1. Enter your numbers. Type two or more whole numbers, separated by commas, spaces, or line breaks. You can enter up to 10 numbers at once.
  2. Click Calculate LCM. The calculator finds the LCM instantly, and also shows the GCD of your numbers as a bonus.
  3. Read the steps. Below the answer you will see the pair-by-pair GCD identity working, plus the prime factorization of each input and a check using the highest powers of each prime.
  4. Clear and try again. Use the Clear button to reset the input and start a new calculation.

Methods for Finding the LCM

1. Listing Multiples

Write out the multiples of each number until you reach a number that appears in every list. The first such number is the LCM. This works well for small numbers but becomes slow for larger ones.

2. The GCD Identity

For two numbers, the fastest exact method is the identity:

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

For example, LCM(12, 18) = (12 × 18) ÷ GCD(12, 18) = 216 ÷ 6 = 36. For three or more numbers, apply this identity one pair at a time: find the LCM of the first two numbers, then combine that result with the next number, and so on.

3. Prime Factorization

Break each number into prime factors, take the highest power of each prime that appears in any number, and multiply those powers together. For 12 = 2² × 3 and 18 = 2 × 3², the highest powers are 2² and 3², so the LCM is 4 × 9 = 36.

Worked Examples

Example 1: LCM of 4, 6, and 8

Prime factorizations: 4 = 2², 6 = 2 × 3, 8 = 2³. The highest powers are 2³ and 3¹, giving 8 × 3 = 24. The GCD of 4, 6, and 8 is 2.

Example 2: LCM of 12 and 18

Using the GCD identity: (12 × 18) ÷ 6 = 216 ÷ 6 = 36. Check with prime factors: 12 = 2² × 3, 18 = 2 × 3², so 2² × 3² = 4 × 9 = 36.

Example 3: LCM of 7 and 11

Because 7 and 11 are both prime and share no common factor, their GCD is 1, so their LCM is simply 7 × 11 = 77. In general, the LCM of two different primes is their product.

When Is the LCM Useful?

  • Adding and subtracting fractions — the LCM of the denominators is the lowest common denominator.
  • Repeating schedules — if one bus runs every 12 minutes and another every 18, they meet every 36 minutes.
  • Gear ratios and cycles — finding when two rotating parts return to the same alignment.
  • Recipe and batch scaling — working out a common batch size that divides evenly across several recipes.

Frequently Asked Questions

What is the difference between LCM and GCD?

The LCM is the smallest number that is a multiple of all your inputs, while the GCD (greatest common divisor) is the largest number that divides all of them. For 12 and 18, the LCM is 36 and the GCD is 6.

Can the LCM be smaller than the numbers?

No. The LCM of positive whole numbers is always at least as large as the largest input. If one number divides another, the LCM is simply the larger number — for example, LCM(6, 12) = 12.

What happens if I enter only one number?

The LCM is defined for two or more numbers, so the calculator will ask you to enter at least two whole numbers. Enter a second number and calculate again.

Does this calculator work with decimals or negatives?

No. The LCM is defined for positive whole numbers, so the calculator only accepts integers from 1 up to 999,999. Decimals, zero, and negative values will show a helpful error message.

What is the LCM of 0?

The LCM is normally defined for positive integers, so 0 is not accepted here. If you need to handle zero in a mathematical context, treat it separately: any multiple of 0 is 0, which makes the usual definition unhelpful.