Advertisement

LCM Calculator

Find the Least Common Multiple of 2 to 5 numbers using prime factorization with a full step-by-step breakdown.

Enter 2 to 5 positive integers.

What is the Least Common Multiple (LCM)?

The Least Common Multiple (LCM) of two or more integers is the smallest positive integer that is divisible by all of them without a remainder. For example, LCM(4, 6) = 12 because 12 is the smallest number that both 4 and 6 divide into evenly. The LCM is the arithmetic counterpart to the Greatest Common Factor (GCF): while GCF finds the largest shared factor, LCM finds the smallest shared multiple.

The most efficient method for computing LCM uses the relationship LCM(a, b) = (a × b) / GCF(a, b), where the GCF is found using the Euclidean Algorithm. An alternative method is prime factorisation: express each number as a product of prime factors, then take the highest power of each prime that appears in any of the factorisations. The product of these highest powers is the LCM. For example: LCM(12, 18) = LCM(2²×3, 2×3²) = 2²×3² = 36.

LCM calculators are used in arithmetic for adding and subtracting fractions with unlike denominators (the LCM of the denominators gives the Least Common Denominator), in scheduling problems to find when recurring events next coincide, in music theory to find the length of rhythmic cycles, in computer science for synchronising processes, and in engineering for gear ratio and timing calculations.

LCM Formula

LCM via Prime Factorization: Take each prime factor at its highest power across all numbers, then multiply.
LCM(a,b): LCM(a,b) = |a × b| / GCF(a,b)

Worked Example

LCM(12, 18, 30)

12 = 2² × 3
18 = 2 × 3²
30 = 2 × 3 × 5
Highest powers: 2², 3², 5
LCM = 4 × 9 × 5 = 180

How the LCM Calculator Works

Formula, assumptions, and calculation steps for this math tool.

Methodology

Math calculators apply the relevant arithmetic, algebraic, geometric, or numeric rule to the values entered and simplify the result where possible.

Calculation Steps

  1. Read the values and operation selected.
  2. Normalize signs, decimals, fractions, or units if needed.
  3. Apply the mathematical rule or formula.
  4. Format the answer and any intermediate values for checking.

Assumptions and Limits

  • Inputs must be within the supported domain of the operation.
  • Decimal answers may be rounded for readability.
  • Symbolic simplification is limited to the calculator scope.

Frequently Asked Questions

The LCM of two or more integers is the smallest positive integer divisible by all of them. It is used to add fractions, find common denominators, and solve problems involving repeating cycles.

The GCF (Greatest Common Factor) is the largest number that divides all given numbers. The LCM is the smallest number that all given numbers divide into. For 12 and 18: GCF = 6, LCM = 36.

Factor each number into primes. For each unique prime, take the highest exponent that appears across all numbers. Multiply those prime powers together to get the LCM.

For two numbers a and b: LCM(a,b) × GCF(a,b) = a × b. This identity lets you find one if you know the other.

LCM is used when adding fractions (finding common denominators), scheduling repeating events that align simultaneously (e.g., two buses with different intervals), and in music theory for rhythm patterns.

Real-World Applications

Adding Fractions
Find the Least Common Denominator (LCD) to add or subtract fractions with unlike denominators — LCD is the LCM of the denominators (e.g. 1/4 + 1/6 → LCD = 12).
🗓️
Event Scheduling
Find when two recurring events coincide — if task A repeats every 6 days and task B every 8 days, they next fall on the same day in LCM(6,8) = 24 days.
⚙️
Gear Ratio Design
Engineers use LCM to find the minimum number of gear teeth needed so that two meshing gears return to the same relative position after a full rotation cycle.
🎵
Music Rhythm Cycles
In music theory, the LCM of two rhythmic patterns (3-beat and 4-beat cycles) gives the bar length at which both patterns repeat simultaneously — LCM(3,4) = 12 beats.
💻
Process Synchronisation
In operating systems, the LCM of two process cycle times determines when both processes will next be in their initial state simultaneously — used in real-time scheduling.
🔢
Number Theory Problems
LCM is used to solve modular arithmetic problems, Chinese Remainder Theorem computations, and cryptography algorithms that involve periodic functions.

Common Mistakes

1
Confusing LCM with GCF
LCM (Least Common Multiple) is the smallest number both values divide into. GCF (Greatest Common Factor) is the largest number that divides both. For 4 and 6: LCM = 12, GCF = 2 — completely different results.
2
Thinking LCM is always a×b
LCM(a,b) = a×b only when a and b are coprime (GCF = 1). For LCM(4,6): 4×6 = 24 but the actual LCM is 12. Always use LCM = a×b / GCF(a,b).
3
Taking the highest prime factor instead of highest power
In the prime factorisation method, you need the highest POWER of each prime across all numbers — not just whether the prime appears. For LCM(8,12): 8 = 2³, 12 = 2²×3, so LCM = 2³×3 = 24.
4
Applying LCM to non-integer values
LCM is defined for positive integers. For fractions, apply LCM to the numerators and GCF to the denominators: LCM(a/b, c/d) = LCM(a,c) / GCF(b,d) — a separate formula applies.
5
Not reducing to the correct LCM when using listing
Listing multiples is reliable for small numbers — but stop at the FIRST common multiple, not the first large one you find. Common error: finding a common multiple that is not the least (smallest).

LCM and GCF Quick Reference

Numbers GCF LCM Check: GCF×LCM = a×b
4, 6 2 12 2 × 12 = 24 = 4 × 6 ✓
8, 12 4 24 4 × 24 = 96 = 8 × 12 ✓
7, 11 (primes) 1 77 1 × 77 = 77 = 7 × 11 ✓
15, 25 5 75 5 × 75 = 375 = 15 × 25 ✓
6, 10, 15 1 30 LCM of 3 numbers — 30 ÷ 6, 10, 15 all exact

References

  1. Hardy, G.H. and Wright, E.M. An Introduction to the Theory of Numbers. Oxford University Press, 2008.
  2. Niven, Ivan, Zuckerman, Herbert S., and Montgomery, Hugh L. An Introduction to the Theory of Numbers. Wiley, 1991.
  3. Knuth, Donald. The Art of Computer Programming, Vol. 2. Addison-Wesley, 1997.
  4. National Council of Teachers of Mathematics. Principles and Standards for School Mathematics. NCTM, 2000.
  5. NIST/SEMATECH. e-Handbook of Statistical Methods. nist.gov, 2024.