LCM Calculator with Steps
Find the Least Common Multiple (LCM) of 2, 3 or more numbers instantly. See the full working by prime factorization, the division method and the GCD formula — plus the HCF of your numbers.
Numbers
Enter two or more positive integers
Awaiting Inputs
Enter at least two positive integers to calculate their LCM.
What is the Least Common Multiple?
The Least Common Multiple (LCM) of two or more integers is the smallest positive integer that is divisible by each of them without leaving a remainder. For example, the LCM of 4 and 6 is 12, because 12 is the smallest number that both 4 and 6 divide into evenly (12 ÷ 4 = 3, 12 ÷ 6 = 2).
The LCM is widely used in mathematics to add or subtract fractions with different denominators, to solve problems involving cycles or repeating events, and in programming for tasks like scheduling jobs at different intervals.
How to Calculate LCM
There are three common methods to find the LCM:
- Prime Factorization: Break each number into its prime factors. Take the highest power of each prime that appears in any factorization and multiply them. For LCM(12, 18): 12 = 2² × 3, 18 = 2 × 3² → LCM = 2² × 3² = 36.
- Division (Ladder) Method: Write the numbers in a row and keep dividing by prime numbers until every number becomes 1. The LCM is the product of all the divisors (see the example below).
- Using GCD: The formula LCM(a, b) = (a × b) ÷ GCD(a, b) is the most efficient for two numbers. This calculator applies it iteratively for multiple numbers.
LCM by Division Method (Example)
Let's find the LCM of 12, 18 and 30. Divide by the smallest prime that divides at least one number; numbers that are not divisible are carried down unchanged.
| 2 | 12 | 18 | 30 |
| 2 | 6 | 9 | 15 |
| 3 | 3 | 9 | 15 |
| 3 | 1 | 3 | 5 |
| 5 | 1 | 1 | 5 |
| 1 | 1 | 1 |
LCM = 2 × 2 × 3 × 3 × 5 = 180.
LCM of Three Numbers
To find the LCM of three numbers, find the LCM of any two, then the LCM of that result with the third. For 8, 12 and 16: LCM(8, 12) = 24, and LCM(24, 16) = 48. Using prime factorization instead: 8 = 2³, 12 = 2² × 3, 16 = 2⁴ → LCM = 2⁴ × 3 = 48. You can add as many numbers as you like in the calculator above.
LCM Table of Common Numbers
Quick answers for frequently searched pairs. Tap any row to open it in the calculator with full steps.
Relationship Between LCM and HCF
For any two positive integers, the product of their LCM and HCF equals the product of the numbers: LCM(a, b) × HCF(a, b) = a × b. For 12 and 18: HCF = 6 and LCM = 36, and 6 × 36 = 216 = 12 × 18. Note that this identity holds only for two numbers, not for three or more. To find the HCF on its own with the Euclidean algorithm, use our GCD (HCF) Calculator.
LCM of Fractions
To find the LCM of fractions, use: LCM = LCM of numerators ÷ HCF of denominators. Example: LCM(2/3, 4/9) = LCM(2, 4) ÷ HCF(3, 9) = 4 ÷ 3 = 4/3. Check: 4/3 ÷ 2/3 = 2 and 4/3 ÷ 4/9 = 3, both whole numbers.
Real-World Examples
- Adding fractions: To add 1/4 + 1/6, find LCM(4, 6) = 12, then convert: 3/12 + 2/12 = 5/12.
- Scheduling: If Bus A comes every 8 minutes and Bus B every 12 minutes, LCM(8, 12) = 24 — they meet again every 24 minutes.
- Gear ratios: Engineers use LCM to find when rotating gears return to their original alignment position.
Frequently Asked Questions
LCM (Least Common Multiple) is the smallest positive number that is a multiple of two or more given numbers. For example, the LCM of 4 and 6 is 12.
Find the LCM of the first two numbers, then find the LCM of that result with the next number, and repeat for all remaining numbers. For example, LCM(12, 18, 30): LCM(12, 18) = 36, then LCM(36, 30) = 180. This calculator does that automatically for any number of inputs and shows every step.
LCM is the smallest number divisible by all the given numbers, while HCF/GCD (Highest Common Factor / Greatest Common Divisor) is the largest number that divides all of them. For two numbers they are related by LCM(a, b) × HCF(a, b) = a × b.
If two numbers are co-prime (their HCF is 1), their LCM is simply their product. For example, LCM(5, 7) = 35 and LCM(8, 9) = 72.
No. The LCM is always greater than or equal to the largest of the numbers. It equals the largest number only when that number is already divisible by all the others — for example, LCM(4, 8, 16) = 16.
LCM of fractions = LCM of the numerators ÷ HCF of the denominators. For example, LCM(2/3, 4/9) = LCM(2, 4) ÷ HCF(3, 9) = 4/3.
LCM is normally defined only for positive integers. Since 0 is a multiple of every number, the LCM involving 0 is taken as 0 by convention, and for negative numbers the LCM of their absolute values is used. This calculator accepts positive whole numbers only.
For small numbers, the division (ladder) method is fastest to do by hand. Prime factorization is best for understanding why the answer is correct, and the GCD formula LCM = (a × b) ÷ GCD is the most efficient for large numbers. The calculator shows all three.