Skip to content

LCM Calculator — Free Online Least Common Multiple Calculator

Find the least common multiple of two or more numbers instantly with prime factorization, step-by-step solutions, and verification.

Enter 2 or more positive integers

Prime Factorizations

12 = 2 x 2 x 3

18 = 2 x 3 x 3

24 = 2 x 2 x 2 x 3

Least Common Multiple

72

Step-by-Step

LCM(12, 18) = 36

LCM(36, 24) = 72

Verification

72 / 12 = 6

72 / 18 = 4

72 / 24 = 3

How to Use the LCM Calculator

  1. Enter your numbers: Type two or more positive integers into the input field, separated by commas. For example, enter "12, 18, 24" to find the LCM of three numbers. You can enter as many numbers as needed.
  2. View the prime factorizations: Below the input, the calculator displays the prime factorization of each number you entered. This helps you understand how the LCM is computed — it takes the highest power of each prime factor that appears.
  3. Read the LCM result: The right panel displays the Least Common Multiple in large text. This is the smallest positive number that all your input numbers divide into evenly.
  4. Check the step-by-step process: The calculator shows how it computed the LCM iteratively, pairing numbers and finding the LCM at each step.
  5. Verify the result: The verification section divides the LCM by each of your input numbers, showing that every division produces a whole number. This confirms the result is correct.

The calculator updates instantly as you type, letting you experiment with different number combinations and observe how the LCM changes. It handles arbitrarily many inputs and shows all intermediate work.

LCM Formulas

Using GCF

LCM(a, b) = (a x b) / GCF(a, b)

Prime Factorization Method

LCM = product of highest powers of all prime factors

Listing Method

LCM = smallest number in both multiple lists

Variables Explained

  • a, b: The positive integers whose LCM you want to find. When more than two numbers are involved, the LCM is computed iteratively: LCM(a, b, c) = LCM(LCM(a, b), c).
  • GCF(a, b): The Greatest Common Factor of a and b, used in the most efficient calculation formula. The Euclidean algorithm finds GCF in logarithmic time.
  • Prime factors: The prime numbers that multiply together to give each input number. The LCM takes the highest power of each unique prime across all inputs.

Step-by-Step Example

Find LCM(12, 18, 20) using prime factorization:

  1. Factor each number: 12 = 2^2 x 3, 18 = 2 x 3^2, 20 = 2^2 x 5
  2. List all primes that appear: 2, 3, 5
  3. Take the highest power of each: 2^2 = 4, 3^2 = 9, 5^1 = 5
  4. Multiply: 4 x 9 x 5 = 180

The LCM is 180. Verification: 180/12 = 15, 180/18 = 10, 180/20 = 9 — all whole numbers. No smaller positive number is divisible by all three inputs.

Practical Examples

Example 1: Rachel's Fraction Addition

Rachel needs to add 5/12 + 7/18 for her algebra homework. She needs a common denominator, which is the LCM of 12 and 18.

  • LCM(12, 18) = 36
  • 5/12 = 15/36, 7/18 = 14/36
  • 15/36 + 14/36 = 29/36

By finding the LCM of the denominators, Rachel converts both fractions to equivalent fractions with the same denominator, making addition straightforward. This is the most common real-world use of LCM — finding least common denominators. For more fraction work, try our fraction calculator.

Example 2: Tom's Bus Schedule

Tom lives near two bus routes. Route A arrives every 8 minutes and Route B arrives every 12 minutes. Both buses arrive together at 7:00 AM. When will they next arrive at the same time?

  • LCM(8, 12): 8 = 2^3, 12 = 2^2 x 3
  • Highest powers: 2^3 = 8, 3^1 = 3
  • LCM = 8 x 3 = 24 minutes

Both buses will arrive together again at 7:24 AM, exactly 24 minutes later. In the real world, LCM helps with scheduling trains, planetary alignments, rotating shift patterns, and any situation where periodic events need to synchronize.

Example 3: Priya's Packaging Problem

Priya sells custom gift sets. Cookies come in packs of 6, chocolates in packs of 8, and candles in packs of 10. She needs to buy the minimum number of packs so she has equal numbers of each item.

  • LCM(6, 8, 10): 6 = 2 x 3, 8 = 2^3, 10 = 2 x 5
  • Highest powers: 2^3 = 8, 3^1 = 3, 5^1 = 5
  • LCM = 8 x 3 x 5 = 120 items of each
  • Packs needed: 120/6 = 20 cookie packs, 120/8 = 15 chocolate packs, 120/10 = 12 candle packs

Priya needs 120 of each item — 20 packs of cookies, 15 packs of chocolates, and 12 packs of candles. This gives her exactly 120 gift sets with one of each item. LCM is essential for inventory management and minimizing waste in packaging scenarios.

LCM Reference Table

Numbers LCM Prime Factorizations GCF
4, 6 12 2^2, 2x3 2
12, 18 36 2^2x3, 2x3^2 6
5, 7 35 5, 7 1
8, 12 24 2^3, 2^2x3 4
6, 8, 12 24 2x3, 2^3, 2^2x3 2
15, 20 60 3x5, 2^2x5 5

Tips and Complete Guide

Three Methods to Find LCM

There are three standard approaches. The listing method writes out multiples of each number until a common one appears — simple but slow for large numbers. The prime factorization method breaks each number into primes and takes the highest power of each, which is systematic and educational. The GCF method uses the formula LCM(a, b) = |a x b| / GCF(a, b), which is the most efficient computationally since GCF can be found quickly with the Euclidean algorithm. Our calculator uses the GCF method internally but displays prime factorizations for educational value.

LCM in Fraction Arithmetic

The most common application of LCM is finding the least common denominator (LCD) when adding or subtracting fractions. The LCD is simply the LCM of all the denominators. Using the LCD rather than any common denominator minimizes the size of the numbers you work with, making arithmetic easier and reducing the need for simplification afterward. For example, 1/4 + 1/6 uses LCD = LCM(4, 6) = 12, giving 3/12 + 2/12 = 5/12, already in simplest form.

LCM in Scheduling and Cycles

Any time periodic events need to synchronize, LCM provides the answer. Traffic lights with different cycle times will all be green simultaneously at intervals equal to the LCM of their cycle lengths. Gear teeth mesh at intervals determined by the LCM of their tooth counts. In astronomy, the synodic period of planetary alignments relates to the LCM of orbital periods. Understanding these cyclic patterns through LCM helps in engineering, logistics, and scientific analysis.

Relationship Between LCM and GCF

The identity LCM(a, b) x GCF(a, b) = a x b is one of the most elegant results in number theory. It means that the LCM and GCF are dual concepts — knowing one immediately gives you the other. For prime factorizations, GCF takes the minimum power of each common prime while LCM takes the maximum power of each prime. Together they capture the complete multiplicative structure of the number pair. This duality extends to more advanced mathematics, including lattice theory and abstract algebra.

Common Mistakes to Avoid

  • Multiplying all numbers together: The LCM is not always the product of the numbers. It equals the product only when the numbers are pairwise coprime. For example, LCM(4, 6) = 12, not 24.
  • Using the wrong power of a prime: The LCM uses the highest (not lowest) power of each prime. For 12 = 2^2 x 3 and 8 = 2^3, you need 2^3 (not 2^2) in the LCM.
  • Forgetting a prime factor: Every prime that appears in any of the input numbers must be included in the LCM. Missing even one prime will give a result that is too small.
  • Confusing LCM with GCF: LCM is always greater than or equal to the largest input, while GCF is always less than or equal to the smallest input. If your LCM is smaller than one of your inputs, you have made an error.
  • Not verifying the result: Always check that the LCM is divisible by each input number. If any division leaves a remainder, the answer is wrong.

Frequently Asked Questions

The Least Common Multiple (LCM) of two or more integers is the smallest positive integer that is divisible by each of those numbers. For example, the LCM of 4 and 6 is 12, because 12 is the smallest number that both 4 and 6 divide into evenly. The LCM is essential for adding fractions with different denominators, scheduling periodic events, and solving problems in number theory.

To find the LCM using prime factorization: (1) factor each number into its prime factors, (2) for each prime factor that appears, take the highest power of that prime across all numbers, (3) multiply these highest powers together. For example, LCM(12, 18): 12 = 2^2 x 3 and 18 = 2 x 3^2. Take the highest powers: 2^2 and 3^2. LCM = 4 x 9 = 36. Our calculator shows the prime factorization of each input number to help you understand this method.

For any two positive integers a and b: LCM(a, b) x GCF(a, b) = a x b. This means if you know the GCF, you can find the LCM: LCM(a, b) = (a x b) / GCF(a, b). For example, LCM(12, 18) = (12 x 18) / GCF(12, 18) = 216 / 6 = 36. This formula is more efficient than listing multiples. Use our <a href='/math/number-theory/gcf-calculator' class='text-primary-600 hover:text-primary-800 underline'>GCF calculator</a> to find the greatest common factor.

Find the LCM iteratively: first compute LCM of the first two numbers, then compute LCM of that result with the third number, and continue. For example, LCM(4, 6, 10): LCM(4, 6) = 12, then LCM(12, 10) = 60. Our calculator handles any number of inputs — just separate them with commas. The prime factorization method also extends naturally: factor all numbers and take the highest power of each prime that appears anywhere.

LCM has many practical applications. When adding fractions like 1/4 + 1/6, you need the LCM of 4 and 6 (which is 12) as the common denominator. In scheduling, if Event A happens every 3 days and Event B every 5 days, they coincide every LCM(3, 5) = 15 days. In manufacturing, LCM determines batch sizes when products have different cycle times. In music, LCM determines when polyrhythms realign.

No. The LCM equals the product only when the two numbers are coprime (GCF = 1). For example, LCM(3, 5) = 15 = 3 x 5 because GCF(3, 5) = 1. But LCM(4, 6) = 12, not 24, because they share the factor 2. In general, LCM(a, b) = (a x b) / GCF(a, b), so the LCM is less than the product whenever the numbers share common factors.

Yes, the LCM equals the larger number when the smaller number divides evenly into the larger one. For example, LCM(5, 15) = 15, because 15 is already a multiple of 5. More generally, if a divides b, then LCM(a, b) = b. This happens because every multiple of b is automatically a multiple of a when a is a factor of b.

The LCM involving 0 is typically defined as 0. This is because 0 is a multiple of every integer, and the only non-negative multiple of 0 is 0 itself. In formal mathematics, some definitions consider LCM(0, n) to be undefined, since there is no positive common multiple. Our calculator returns 0 when any input is 0.

Related Calculators

Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and may not reflect exact values.

Last updated: February 23, 2026

Sources