CALCULATE ALL — every calculation, from tomorrow

Math • Finance • Health • Conversion • Education — 100% free, no sign-up

Math

LCM Calculator

Find the least common multiple of two numbers in one click.

Find the least common multiple (LCM) of two numbers instantly — the smallest number both divide into evenly. Essential for adding fractions with different denominators, scheduling repeating events, and number-theory homework.

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.

How it's calculated

The LCM is computed as |a × b| ÷ GCF(a, b), using the Euclidean algorithm for the GCF — fast and exact for any integers.

Worked examples

LCM of 12 and 18

Prime factors: 12 = 2^2 x 3, 18 = 2 x 3^2. Take the highest power of each prime: 2^2 x 3^2 = 4 x 9 = 36. Verify: 36 / 12 = 3 and 36 / 18 = 2, both whole numbers. Is anything smaller a common multiple? Multiples of 18 are 18, 36, ... — 18 is not divisible by 12, so 36 is indeed the least. Shortcut check: 12 x 18 / GCF(12,18) = 216 / 6 = 36.

LCM of 4, 6, and 8

Prime factors: 4 = 2^2, 6 = 2 x 3, 8 = 2^3. Highest powers: 2^3 x 3 = 8 x 3 = 24. Verify: 24/4 = 6, 24/6 = 4, 24/8 = 3 — all whole. Note that 12 is a multiple of 4 and 6 but not of 8, which is why pairwise reasoning fails with three numbers and prime factorization is the safe method.

Frequently asked questions

What is the LCM of 12 and 18?

36. It's the smallest number both 12 and 18 divide into evenly (12 × 3 = 36, 18 × 2 = 36).

When do I need the LCM?

Most often when adding or subtracting fractions with different denominators — the LCM of the denominators is the common denominator to use.

What is the difference between LCM and GCF?

The LCM is the smallest number both numbers divide into; the GCF is the largest number that divides both. For 12 and 18, the LCM is 36 and the GCF is 6.

Is the LCM Calculator free to use?

Yes. The LCM Calculator on CalculateAll is completely free — no sign-up, no usage limits and nothing to install. The calculation runs entirely in your browser, so the numbers you enter never leave your device.

Does the LCM Calculator work on mobile phones?

Yes. The LCM Calculator is fully responsive and works on phones, tablets and computers. Open the page, enter your values, and the result updates instantly — no app download needed.

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.

Related calculators

References