Introduction
The least common multiple (LCM) of two or more numbers is the smallest number that all of them divide into evenly. Its most famous job is adding fractions with different denominators — the LCM of the denominators is the smallest common denominator, keeping the numbers small and the arithmetic clean. But it shows up anywhere cycles align: two buses departing every 12 and 18 minutes coincide every 36 minutes (the LCM of 12 and 18), and two gears with 12 and 18 teeth realign every 36 tooth-steps. Anytime you need events to 'line up,' you are looking for a common multiple, and the least one is the first time they coincide.
The reliable way to find it is prime factorization: break each number into primes, take the highest power of each prime that appears in any of them, and multiply those together. For 12 (2^2 x 3) and 18 (2 x 3^2), that gives 2^2 x 3^2 = 4 x 9 = 36. A handy shortcut for two numbers is LCM(a,b) = a x b / GCF(a,b) — for 12 and 18, that is 216 / 6 = 36 — which is how this calculator works under the hood. Do not confuse the LCM with the GCF: the GCF is the largest divisor shared by the numbers (used for simplifying), while the LCM is the smallest multiple shared by them (used for combining). They are duals, linked by that very formula.
The LCM at work: schedules, cycles and denominators
Worked example: LCM of 15 and 20
Enter 15 as the First number and 20 as the Second number. The calculator finds the greatest common factor of the pair, which is 5, and applies LCM(a, b) = a × b ÷ GCF(a, b): 15 × 20 = 300, and 300 ÷ 5 = 60. Check the answer by dividing back: 60 ÷ 15 = 4 and 60 ÷ 20 = 3, both whole numbers, and no smaller candidate works — the multiples of 20 run 20, 40, 60, and neither 20 nor 40 is divisible by 15. Notice how much the shared factor matters: because 15 and 20 overlap by 5, their LCM of 60 is well below their raw product of 300.
When cycles line up — and when they refuse to
Two workshop machines that cycle every 15 minutes and every 20 minutes, started together, next run in step after exactly 60 minutes — the LCM of their two periods entered in the First number and Second number fields. The opposite extreme is a pair with nothing in common: 8 and 9 share a GCF of just 1, so this calculator returns 8 × 9 ÷ 1 = 72, the full product. Coprime pairs always behave this way, which is why two cycles with no shared factor can take a surprisingly long time to coincide, and why LCM results grow so quickly when large unrelated numbers are involved. The same logic sets a common denominator: to add 1/15 + 1/20, use the LCM of 60, rewrite the fractions as 4/60 and 3/60, and the sum is 7/60 with no further simplifying needed.
Buying in packs: the LCM as a shopping answer
The same two-field calculation settles a classic purchasing mismatch. Hot dog sausages come in packs of 10 and buns in packs of 8, and you want equal numbers of each with nothing left over: enter 8 as the First number and 10 as the Second number, and the calculator returns LCM(8, 10) = 40, since the pair's GCF is 2 and 8 × 10 ÷ 2 = 40. That means buying 5 packs of buns (5 × 8 = 40) and 4 packs of sausages (4 × 10 = 40). Any smaller common multiple would leave the counts unmatched, and every larger solution is simply a multiple of this one — 80, 120, and so on — which is why the least common multiple, rather than just any common multiple, is the useful shopping figure.
Input rules and edge cases for this LCM tool
The tool accepts exactly two numbers, so a three-number problem is solved in two passes: find the LCM of the first pair, then find the LCM of that result and the third number. For 4, 6 and 8, the first pass gives LCM(4, 6) = 12, and the second gives LCM(12, 8) = 24. Decimal entries are rounded to the nearest whole number before anything is computed, so typing 4.6 is treated as 5 — enter true integers if the exact LCM matters. Negative entries are treated as their positive equivalents, since the LCM is defined on magnitudes. Entering zero in either field returns no result, because every number is a multiple of zero's partner in a degenerate way and the formula's division by GCF(a, 0) is not meaningful here. Entering the same number twice simply returns that number, and for very large coprime inputs expect the answer to approach the full product of the two, which can be far larger than either input.