Least Common Multiple Calculator

Least Common Multiple (LCM) Calculator
Math

Least Common Multiple Calculator

Enter two or more positive whole numbers.
Please enter at least two positive whole numbers, separated by commas or spaces.
Least Common Multiple (LCM)
Greatest Common Divisor (GCD)
Numbers Entered
Disclaimer: This calculator computes the least common multiple and greatest common divisor using standard number theory algorithms (prime factorization and the Euclidean algorithm). It is provided for general educational use.

Least Common Multiple Calculator: Fast Methods and Worked Examples

Quick answer: A least common multiple calculator finds the smallest positive number that two or more numbers divide into evenly, most efficiently using the formula LCM(a, b) = (a × b) / GCD(a, b), where GCD is the greatest common divisor. It’s the same math behind adding fractions with different denominators and scheduling problems where events repeat on different cycles.

Anyone who’s tried to add two fractions with different denominators has needed the least common multiple without necessarily calling it that. A least common multiple calculator finds that smallest shared multiple instantly, but understanding the two or three ways to calculate it by hand — listing multiples, prime factorization, or the GCD shortcut — makes the calculator’s output much easier to trust and double-check. Below we cover every method with worked examples, plus the real-world situations where LCM shows up outside the classroom.

What Least Common Multiple Means

The least common multiple (LCM) of two or more numbers is the smallest positive number that all of them divide into without leaving a remainder. For example, the LCM of 4 and 6 is 12, since 12 is the smallest number that both 4 and 6 divide into evenly (4 × 3 = 12, and 6 × 2 = 12).

Method 1: Listing Multiples

The most intuitive approach for small numbers is simply listing out multiples of each number until you find one they share.

Example: LCM of 4 and 6

  • Multiples of 4: 4, 8, 12, 16, 20…
  • Multiples of 6: 6, 12, 18, 24…
  • First shared multiple: 12

This method works fine for small numbers but becomes impractical quickly as the numbers get larger or as you add a third or fourth number to the mix.

Method 2: Prime Factorization

A more scalable approach breaks each number into its prime factors, then builds the LCM by taking the highest power of each prime that appears in any of the numbers.

Example: LCM of 12 and 18

  • 12 = 2² × 3
  • 18 = 2 × 3²
  • LCM = 2² × 3² = 4 × 9 = 36

Method 3: The GCD Formula (Fastest for a Calculator)

This is the formula most digital calculators actually use internally, since it only requires finding one greatest common divisor rather than a full factor tree:

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

Where GCD is the greatest common divisor — the largest number that divides evenly into both a and b.

Example: LCM of 8 and 12

  • GCD(8, 12) = 4 (the largest number dividing both evenly)
  • LCM = (8 × 12) / 4 = 96 / 4 = 24

Worked Example #1: Two Small Numbers

Find the LCM of 5 and 8.

  • These numbers share no common factors other than 1, so GCD(5, 8) = 1.
  • LCM = (5 × 8) / 1 = 40

When two numbers have a GCD of 1 (meaning they’re “coprime”), their LCM is always simply their product.

Worked Example #2: Three Numbers

Find the LCM of 4, 6, and 10.

Using prime factorization:

  • 4 = 2²
  • 6 = 2 × 3
  • 10 = 2 × 5

Taking the highest power of each prime present: 2² × 3 × 5 = 4 × 3 × 5 = 60

For three or more numbers, the GCD-pair method requires chaining: first find LCM(4, 6) = 12, then find LCM(12, 10) = 60, confirming the same result.

Worked Example #3: Adding Fractions (A Real-World Use Case)

This is the single most common reason people actually search for LCM: adding fractions with unlike denominators. Add 1/6 + 1/8.

  1. Find LCM(6, 8): GCD(6, 8) = 2, so LCM = (6 × 8) / 2 = 24
  2. Convert both fractions to have a denominator of 24: 1/6 = 4/24, and 1/8 = 3/24
  3. Add: 4/24 + 3/24 = 7/24

Worked Example #4: Scheduling (Another Real-World Use Case)

Two buses leave a station — one every 15 minutes, the other every 20 minutes. If they both leave together at 8:00 AM, when will they next leave at the same time?

  • LCM(15, 20): GCD(15, 20) = 5, so LCM = (15 × 20) / 5 = 60
  • The buses will next depart together after 60 minutes, at 9:00 AM.

This kind of “when do two repeating cycles line up again” question is one of the most common real-world applications of LCM outside pure math homework, showing up in everything from traffic light timing to shift scheduling.

Step-by-Step: How to Use a Least Common Multiple Calculator

  1. Enter two or more whole numbers you want to find the LCM of.
  2. Review the result, which the calculator typically computes using the GCD-based formula for speed.
  3. Check the work if needed using prime factorization, especially useful for understanding why the answer is what it is rather than just accepting the output.

LCM vs. GCD: Don’t Mix Them Up

It’s easy to confuse least common multiple with greatest common divisor (also called greatest common factor), since both involve comparing two numbers, but they answer opposite questions:

  • GCD finds the largest number that divides evenly into both numbers (always ≤ the smaller number).
  • LCM finds the smallest number that both numbers divide evenly into (always ≥ the larger number).

They’re mathematically linked through the formula LCM(a, b) × GCD(a, b) = a × b, which is exactly why the GCD shortcut for LCM works.

Common Mistakes People Make

  • Confusing LCM with GCD and reporting the wrong direction of the answer — remember LCM is always at least as large as the biggest input number.
  • Forgetting to take the highest power of each prime when using the prime factorization method, and instead multiplying every prime factor found rather than just the highest power of each.
  • Assuming the LCM of two numbers is always their product — this is only true when the numbers share no common factors (GCD = 1); otherwise the LCM will be smaller than the product.
  • Trying to list multiples for large numbers, which is technically correct but extremely slow compared to the GCD or prime factorization methods.
  • Applying the two-number GCD formula directly to three or more numbers without chaining pairwise calculations, which can produce an incorrect result.

Frequently Asked Questions

What is the LCM of 3 and 5?

Since 3 and 5 share no common factors other than 1, their LCM is simply their product: 3 × 5 = 15.

How do you find the LCM of three numbers?

Find the LCM of the first two numbers, then find the LCM of that result and the third number — this pairwise chaining method works for any number of inputs.

What’s the difference between LCM and GCD?

LCM finds the smallest number that all the given numbers divide into evenly, while GCD finds the largest number that divides evenly into all of them — they’re opposite operations linked by the formula LCM(a,b) × GCD(a,b) = a × b.

Why do I need LCM to add fractions?

Fractions can only be added or subtracted directly when they share a common denominator, and the least common multiple of the original denominators gives you the smallest such denominator to convert both fractions to.

Can the LCM of two numbers be one of the numbers itself?

Yes — if one number is a multiple of the other (for example, 4 and 12), the LCM will simply be the larger number, since 12 already divides evenly into itself and 4 divides evenly into 12.

Related Calculators

Conclusion

Whether you’re adding fractions, syncing up two repeating schedules, or just double-checking a math homework answer, a least common multiple calculator saves you from manually listing multiples or building prime factor trees by hand. The GCD-based formula — LCM(a, b) = (a × b) / GCD(a, b) — is what makes the calculation nearly instant even for large numbers, and understanding it means you can sanity-check the result yourself rather than treating the calculator as a black box. Try the worked examples above with your own numbers to see how quickly the shortcut method scales compared to listing multiples by hand.