Least Common Multiple Calculator
Calculate the least common multiple of two positive integers and inspect the greatest common divisor used in the computation.
Calculate the least common multiple
How this tool works
The least common multiple is the smallest positive whole number divisible by each selected integer. This calculator pairs the result with the greatest common divisor so the product relationship can be checked rather than treated as a black-box answer.
For positive integers a and b, LCM(a,b) equals the absolute product a×b divided by GCD(a,b). The greatest common divisor is obtained with the Euclidean remainder algorithm.
How to use it
- Enter the first positive whole number.
- Enter the second positive whole number.
- Read the least common multiple and compare the reported greatest common divisor.
Worked examples
Twelve and eighteen
- Input
- 12 and 18
- Output
- LCM 36
The greatest common divisor is six. Dividing the product 216 by six gives 36, the smallest positive multiple shared by both inputs.
Coprime inputs
- Input
- 8 and 15
- Output
- LCM 120
Eight and fifteen share no divisor above one, so their least common multiple is their full product, which equals 120.
Limitations
- Inputs must be positive safe integers.
- Very large products can exceed JavaScript safe-integer precision.