LCM Calculator
Calculate the Least Common Multiple of two numbers.
Calculator Inputs
Your Result
Enter your details and press Calculate to see your result.
Formula
How it works
- Enter two whole numbers.
- View their Least Common Multiple (LCM).
Share on Social Media:
The least common multiple (LCM) of two whole numbers is the smallest positive number that both divide into exactly. For example, the LCM of 4 and 6 is 12. Enter two whole numbers from 1 to 1,000,000 and the calculator returns their LCM.
How it's calculated
LCM(a, b) = (a × b) ÷ GCD(a, b)
The greatest common divisor (GCD) is found first with the Euclidean algorithm. This is far faster than listing multiples, especially for large numbers.
Worked examples
- 4 and 6: GCD = 2, so LCM = 24 ÷ 2 = 12.
- 12 and 18: GCD = 6, so LCM = 216 ÷ 6 = 36.
- 7 and 9 (no common factor): LCM = 7 × 9 = 63.
Other methods
Listing multiples: multiples of 4 are 4, 8, 12, 16…; multiples of 6 are 6, 12, 18… The first shared one is 12. Fine for small numbers, slow for big ones.
Prime factors: 12 = 2² × 3 and 18 = 2 × 3². Take each prime at its highest power: 2² × 3² = 36.
Everyday uses
- Adding fractions: the lowest common denominator is the LCM of the denominators. 1/4 + 1/6 = 3/12 + 2/12 = 5/12.
- Repeating schedules: one bus every 12 minutes, another every 18. They leave together again after 36 minutes.
- Packs and quantities: hot dogs come in packs of 10 and buns in packs of 8. Buy 40 of each (LCM) to have none left over.
More than two numbers
Work in pairs: LCM(a, b, c) = LCM(LCM(a, b), c). For 4, 6 and 10: LCM(4, 6) = 12, then LCM(12, 10) = 60.
Related: GCD Calculator, Ratio Simplifier.