Skip to content
TheCalcUniverse

LCM Calculator

Find the Least Common Multiple of two or more numbers using both the efficient GCD-based formula and the prime factorization method side by side.

✓ Tested formula & cited sources Formula verified 2026-05-18 Runs in your browser — inputs never sent anywhere

See it worked out

Example — Numbers (comma-separated) 12, 18, 24:

LCM of 12, 18, 24

72

LCM Formula

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

GCD of 12 and 18

6

The formula

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

a, b
Input Numbers
LCM
Least Common Multiple
GCD
Greatest Common Divisor

Worked example — Numbers (comma-separated) 12, 18, 24

LCM of 12, 18, 24 = 72

Full explanation ↓

How LCM Calculator Works

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

The Least Common Multiple of two numbers is the smallest positive integer that is divisible by both numbers. It can be found using the GCD relationship (LCM = a × b / GCD) or by comparing lists of multiples. The LCM is also called the Lowest Common Denominator when working with fractions.

a, b
Input NumbersThe positive integers to find the LCM of. Two or more numbers can be entered, separated by commas.
LCM
Least Common MultipleThe smallest positive integer that is a multiple of all input numbers.
GCD
Greatest Common DivisorThe largest positive integer that divides all input numbers evenly. Related to LCM by the formula: LCM × GCD = a × b.
The LCM is the smallest positive integer that is a multiple of all input numbers.

How to Use

  1. Enter two or more positive integers separated by commas.
  2. View the LCM calculated via the efficient GCD-based method.
  3. Compare the "List of Multiples" and "Prime Factorization" solution methods side by side to understand different approaches.
  4. Check the GCD of the first two numbers, which is used as an intermediate step in the calculation.
  5. Use the LCM as the common denominator when adding or subtracting fractions.

Quick Reference

LCM via GCDLCM(a,b) = a × b ÷ GCD(a,b)
LCM via prime factorsHighest exponent of each distinct prime
GCD relationshipLCM(a,b) × GCD(a,b) = a × b
Co-prime numbersLCM(a,b) = a × b (e.g. 7 and 8 → 56)
Multiple relationshipLCM(a,b) = a if b divides a evenly
Common denominatorLCM of denominators for fraction addition

Understanding the Result

The Least Common Multiple (LCM) is the smallest positive integer that all input numbers divide into evenly. It is essential for adding and subtracting fractions with different denominators (finding a common denominator), solving problems with repeating cycles and synchronizing schedules, and working with gear ratios in mechanical engineering. The LCM is related to the GCD by the fundamental formula: LCM(a, b) × GCD(a, b) = a × b. This means if you know the GCD, you can instantly compute the LCM without listing multiples.

The prime factorization method provides deeper insight: write each number as a product of primes, then for each distinct prime factor, take the highest exponent that appears in any factorization. For example, 12 = 2 × 2 × 3 and 18 = 2 × 3 × 3, so the LCM takes 2 twice and 3 twice: LCM = 2 × 2 × 3 × 3 = 36. This calculator demonstrates both the formula approach and the conceptual approach side by side.

Worked Examples

Add the fractions 1/6 + 1/8 by finding a common denominator.

numbers = 6, 8

LCM(6, 8) = 24

The least common denominator is 24. Convert: 1/6 = 4/24 and 1/8 = 3/24. Sum = 7/24. Using GCD: GCD(6,8)=2, so LCM = (6×8)/2 = 24.

Two traffic lights cycle every 45 seconds and 60 seconds. When will they blink together again?

numbers = 45, 60

LCM(45, 60) = 180

The lights synchronize every 180 seconds (3 minutes). 45 = 3²×5, 60 = 2²×3×5. Taking highest exponents: 2²×3²×5 = 4×9×5 = 180 seconds.

Three planets orbit in 88, 225, and 365 days. When will they align again?

numbers = 88, 225, 365

LCM(88, 225, 365) = 1,445,400

The planets align approximately every 3,960 years at this exact configuration. In practice, orbital mechanics has perturbations, but the LCM gives the theoretical recurrence period.

Frequently Asked Questions

What is the difference between LCM and GCD?
LCM (Least Common Multiple) is the smallest number that both numbers divide into evenly. GCD (Greatest Common Divisor) is the largest number that divides both numbers evenly. They are related by the identity: LCM(a,b) × GCD(a,b) = a × b. If you know one, you can compute the other instantly.
Can I find LCM of more than two numbers?
Yes. Find the LCM of the first two numbers, then use that result with the third number: LCM(a, b, c) = LCM(LCM(a, b), c). This calculator supports multiple comma-separated inputs and handles the chained computation automatically. The same prime factorization principle extends: take the highest exponent of each prime across all numbers.
How is LCM used in real life?
LCM is used to find common denominators when adding fractions (e.g., 1/6 + 1/8 needs denominator 24), synchronizing repeating events (e.g., two machines that run on 6-day and 8-day cycles will align every 24 days), scheduling recurring tasks, and in music theory for finding common time signatures and rhythmic patterns.
Why does LCM(a,b) × GCD(a,b) = a × b always hold?
This identity follows from prime factorization. GCD takes the minimum exponent of each shared prime, while LCM takes the maximum exponent. The product of min and max for each prime equals the sum of the original exponents: min(e₁,e₂) + max(e₁,e₂) = e₁ + e₂. Multiplying across all primes gives GCD × LCM = a × b.
What is the least common denominator (LCD)?
The LCD is simply the LCM of two or more fraction denominators. It is the smallest number into which all denominators divide evenly, making it the optimal choice for adding or subtracting fractions. Using the LCD instead of just multiplying denominators together keeps numbers smaller and results already simplified.
How does the prime factorization method work for LCM?
Write each number as a product of primes with exponents. Then, for each distinct prime factor, take the LARGEST exponent that appears in any factorization — this is the key difference from GCF, which takes the smallest exponent. For 12 = 2²×3 and 18 = 2×3², we take 2² and 3², giving LCM = 4×9 = 36.

Pro Tips

  • When one number is a multiple of another, the LCM is simply the larger number. For example, LCM(6, 18) = 18. Save yourself the calculation.
  • For co-prime numbers (GCF = 1), the LCM is just their product. Example: LCM(7, 8) = 56. No computation needed.
  • When adding fractions, always use the LCM of the denominators (the LCD) rather than just multiplying them together — this gives the simplest common denominator and avoids unnecessary large numbers.
  • For three or more numbers, chain the calculation: LCM(a, b, c) = LCM(LCM(a, b), c). Never try to multiply all numbers and divide by their GCD — that only works for two numbers.

Limitations to Know

  • This calculator limits results to 10¹⁵. For numbers with LCM exceeding this (e.g., very large co-prime pairs), the result will show an overflow message.
  • The LCM formula LCM = (a×b)/GCD only works for exactly two numbers. For three or more, you must chain calculations pairwise. The result is independent of pairing order due to associativity.
  • The "list of multiples" method is only practical for small numbers. It explores multiples up to the LCM or 100, whichever is smaller, so for very large LCMs the list is truncated.
Was this calculator helpful?
Cite this calculator

TheCalcUniverse. "LCM Calculator — Least Common Multiple (GCD Method)." TheCalcUniverse, 2026, https://thecalcuniverse.com/math/lcm-calculator/. Accessed July 27, 2026.

Embed this calculator on your site

Free to embed. Paste this into any HTML page — it stays up to date automatically.

Open embed ↗

You may also like