LCM Calculator
Find the least common multiple (LCM) of two or more positive integers. Add as many numbers as needed and get a clear step-by-step calculation.
Calculate the least common multiple
Enter a positive integer in each box. Use Add Number when you need to calculate the LCM of more than two numbers.
Your result
—
| Numbers | — |
| LCM | — |
| Number of values | — |
Step-by-step calculation
What is the LCM?
The least common multiple, or LCM, of two or more positive integers is the smallest positive integer that is divisible by every number in the set.
The LCM is useful when working with fractions, repeating schedules, divisibility problems, and situations where different cycles need to line up.
How is the LCM calculated?
One common method is prime factorization. Each number is broken into its prime factors. For every prime that appears, the highest exponent occurring in any of the factorizations is selected.
Multiplying those selected prime powers gives the LCM.
How to use this LCM calculator
Use the calculator when you need the smallest positive number that is divisible by every input value. The tool accepts two or more positive whole numbers and can handle additional values when required.
- Enter your numbers: Type a positive integer in each input box.
- Add more values if needed: Select Add Number for an LCM involving three or more numbers.
- Calculate: Select Calculate LCM to generate the result.
- Review the steps: Check the prime factorization and highest prime powers shown with the answer.
For a quick check, divide the final LCM by each original number. Every division should produce a whole number with no remainder.
When should you use an LCM?
LCM is especially useful when different repeating intervals need to line up. It can also help when finding common denominators for fractions or solving divisibility problems.
For example, if two events repeat every 4 and 6 days and begin together, they will coincide again after 12 days because LCM(4, 6) = 12.
LCM calculator example
Find the LCM of 12, 18, and 30.
18 = 2 × 3²
30 = 2 × 3 × 5
Take the highest power of each prime:
2² × 3² × 5
LCM = 4 × 9 × 5
LCM = 180
Therefore, the least common multiple of 12, 18, and 30 is 180.
Formula used
LCM(a, b) = |a × b| ÷ GCD(a, b)
For multiple numbers, the calculator combines the values one at a time using the same relationship.
Prime factorization can also be used by taking the highest exponent of every prime appearing in the input numbers.
LCM and GCD: What is the difference?
The least common multiple (LCM) and greatest common divisor (GCD) solve different types of number problems. The GCD identifies the largest positive integer that divides each input number exactly, while the LCM identifies the smallest positive integer that is divisible by every input number.
They are closely related. For two positive integers, multiplying the GCD and LCM gives the product of the two numbers. This relationship is useful for checking an LCM calculation and for solving problems involving common factors and multiples.
LCM using the listing method
For small numbers, you can find the LCM by listing multiples. For example, the positive multiples of 4 are 4, 8, 12, 16, 20, 24, and so on. The positive multiples of 6 are 6, 12, 18, 24, and so on. The first value appearing in both lists is 12, so LCM(4, 6) = 12.
Listing multiples is easy for small inputs, but it becomes inefficient when numbers are large or when several numbers are involved. Prime factorization or the GCD-based formula is usually more practical for larger calculations.
LCM using prime factorization
Prime factorization expresses a positive integer as a product of prime numbers. To calculate an LCM, write the prime factorization of each input and select the greatest exponent for every prime that appears.
8 = 2³
12 = 2² × 3
Highest powers: 2³ and 3
LCM = 2³ × 3 = 24
This method makes it clear why the resulting number is divisible by every input: it contains enough copies of every prime factor required by each number.
LCM in fractions
The LCM is commonly used when adding or subtracting fractions with different denominators. Finding a common denominator allows the fractions to be rewritten using the same denominator before the arithmetic is performed.
For example, the LCM of 6 and 8 is 24. Therefore, 24 can be used as a common denominator when combining fractions whose denominators are 6 and 8.
LCM in real-world problems
LCM problems often appear when repeating events need to occur at the same time. If one event repeats every 4 days and another repeats every 6 days, their schedules line up again after LCM(4, 6) = 12 days, assuming both events start together.
Similar reasoning can be used for rotating schedules, maintenance cycles, production intervals, traffic signals, and other periodic systems.
How to verify an LCM result
A valid LCM must be divisible by every input number. After finding a result, divide it by each original input. Every division should produce an integer remainder of zero.
For two positive integers, you can also use the identity GCD(a, b) × LCM(a, b) = a × b as an additional check. For multiple inputs, the calculator’s prime-factorization steps provide a direct way to inspect the result.
Common LCM calculation mistakes
A common mistake is choosing the smallest number that is merely larger than all the inputs. The LCM must be divisible by every input, not simply greater than them. Another mistake is selecting the lowest exponent of a prime during factorization; the LCM requires the highest exponent for each prime.
When using a calculator, make sure every input box contains a positive whole number. Check the displayed factorization and verify that the final result divides evenly by all inputs.
Frequently Asked Questions
What does LCM stand for?
LCM stands for least common multiple. It is the smallest positive integer that is divisible by every number in the given set.
How do I find the LCM of two numbers?
You can list multiples, use prime factorization, or use the relationship LCM(a,b) = |a × b| ÷ GCD(a,b) for positive integers.
Can I calculate the LCM of more than two numbers?
Yes. This calculator allows additional number boxes so you can calculate the LCM of several positive integers in one calculation.
Is LCM always larger than the input numbers?
The LCM is at least as large as every positive input number. If one number is already a multiple of all the others, that number itself can be the LCM.
What is the LCM of two equal numbers?
The LCM of two identical positive integers is that same integer. For example, LCM(9, 9) = 9.
What is the relationship between LCM and GCD?
For two positive integers a and b, their GCD multiplied by their LCM equals a multiplied by b. This provides a useful mathematical check for a two-number calculation.
Can the LCM be found using prime factors?
Yes. Factor each input into primes and select the highest exponent of every prime that appears. Multiplying those prime powers gives the LCM.
Why is LCM useful with fractions?
The LCM of denominators can provide a common denominator, making it easier to add or subtract fractions with different denominators.
What happens if the numbers are very large?
Very large results can exceed the range that ordinary JavaScript number calculations can represent safely. This calculator checks for unsafe integer results and asks you to use smaller inputs when necessary.
Related calculators
Important: This calculator is provided for general informational and educational purposes only. The results are based on the positive integers entered and standard mathematical methods. Calculations should be independently verified when high precision or formal mathematical proof is required.
