How this calculator works
A common multiple of two numbers is any number both divide into exactly; the least common multiple is the smallest positive one. It is computed from the greatest common factor: dividing the product by the GCF cancels the shared factors counted twice. Dividing first keeps the arithmetic exact for large inputs. When either number is zero, the LCM is reported as zero by convention, since zero is the only common multiple.
Formula
lcm(a, b) = |a × b| / gcf(a, b), evaluated as |a / gcf(a, b) × b| to stay exact.
Worked example
For 4 and 6: the GCF is 2, so lcm = 4 × 6 / 2 = 12. For 21 and 6: the GCF is 3, so lcm = 21 × 6 / 3 = 42.
Advertisement
Frequently asked questions
Why is lcm(0, 5) zero and not five?
Every multiple of 0 equals 0. Since 0 is also a multiple of 5, it is their only common multiple and the LCM is defined as 0 by convention.
How do I add fractions with the LCM?
Use the LCM of the denominators as the common denominator, scale each numerator to match, then add. It is the smallest denominator that works.
Why might a very large pair be rejected?
The inputs must be safe integers, and the calculator reports an error when their common multiple is too large to show exactly rather than returning an approximation.