LCM Calculator
Enter two whole numbers to find their least common multiple, computed through the GCF, with every step shown.
How to use this calculator
Type two whole numbers and press Calculate. The calculator first finds the greatest common factor, then uses it to get the least common multiple, the standard reliable route, and shows each step.
How it works
The shortcut formula is LCM(a, b) = |a × b| ÷ GCF(a, b). Listing multiples until they match works for small numbers, but the GCF route stays fast no matter how large the inputs get. The step panel shows the GCF computation first, then the final division.
Worked example
Example: LCM(12, 18)
Step 1, GCF: GCF(12, 18) = 6.
Step 2, Apply the formula: LCM = (12 × 18) ÷ 6 = 216 ÷ 6 = 36.
Check: multiples of 12 are 12, 24, 36…; multiples of 18 are 18, 36…, 36 is the first common one. Correct.
Common mistakes
- Multiplying the numbers and stopping: a × b is a common multiple, but rarely the least one, 12 × 18 = 216, while the LCM is 36.
- Forgetting the absolute value: with negative inputs, take |a × b| so the LCM stays positive.
- LCM involving 0: LCM(0, n) = 0, since every multiple of 0 is 0. It is correct, just rarely what anyone wants, double-check the input.
When to use it
The LCM aligns repeating cycles: bus schedules, gear teeth, planetary alignments in textbook problems, and, most commonly, it gives the common denominator for adding fractions. If you add 1/12 + 1/18 by hand, the LCM 36 is the denominator you want.
Frequently asked questions
For nonzero integers, the LCM of two numbers is the smallest positive number that both divide into evenly. (By convention, LCM(0, n) = 0, see the FAQ below.) For 12 and 18 it is 36.
Use LCM(a,b) = |a × b| ÷ GCF(a,b). Find the GCF with the Euclidean algorithm, multiply the numbers, and divide. The calculator above does all three steps.
Zero, because 0 is a multiple of every number, it is automatically the smallest common multiple. In practice this usually signals a typo in the input.
The LCM of two denominators is the least common denominator. Using it keeps the numbers small: 1/12 + 1/18 becomes 3/36 + 2/36 = 5/36.