What is an LCM?
An LCM — least common multiple — is the smallest number that both of two numbers divide into exactly. The LCM of 12 and 18 is 36: 36 ÷ 12 = 3 and 36 ÷ 18 = 2, both exact, and no smaller number works — 18 is divisible by 18 but not by 12, and 24 is divisible by 12 but not by 18. 36 is the first number where both fit.
The LCM is the number that lines two repeating cycles up. Two buses leaving every 12 and 18 minutes coincide every 36 minutes. Two lights blinking every 12 and 18 seconds flash together every 36 seconds. Whenever two rhythms need to meet, the LCM is when they meet.
This calculator takes two numbers and returns their LCM and their GCD, the greatest common divisor. The result updates as you type. Nothing is uploaded, and there is no sign-up.
How an LCM calculator works
The calculator finds the LCM through the GCD, using the formula LCM = |a × b| ÷ GCD. For 12 and 18: the GCD is 6, the product is 216, and 216 ÷ 6 = 36, so the LCM is 36. One GCD calculation and one division give the answer — no listing of multiples needed.
The formula works because the GCD measures exactly how much the two numbers overlap. Two numbers that share a large GCD have a small LCM relative to their product; two coprime numbers, with a GCD of 1, have an LCM equal to their full product. For 5 and 7, the GCD is 1 and the LCM is 35 — the whole product, because nothing overlaps.
You can check the answer by listing multiples when the numbers are small. The multiples of 12 are 12, 24, 36, 48; the multiples of 18 are 18, 36, 54 — and 36 is the first number on both lists. The formula and the list always agree.
LCM and GCD are two sides of one coin
The LCM and the GCD are linked by a single identity: GCD × LCM = a × b. For 12 and 18, 6 × 36 = 216 = 12 × 18. For 48 and 18, 6 × 144 = 864 = 48 × 18. The identity holds for every pair of whole numbers, and it is the fastest way to check an LCM answer by hand.
The two numbers also bracket the pair. The GCD is never bigger than the smaller input, and the LCM is never smaller than the bigger input. For 12 and 18, the GCD of 6 sits below both numbers and the LCM of 36 sits above both. If your LCM comes out smaller than one of the inputs, you have found the GCD by accident.
Thinking of them together also explains why the LCM of coprime numbers is their product. With nothing shared, the GCD is 1, the identity becomes 1 × LCM = a × b, and the LCM is simply a × b. For 5 and 7 that is 35, and for 7 and 13 it is 91 — the product, with no discount for overlap.
The identity also gives a quick sanity check for any LCM answer: divide the product by the GCD and confirm the result is divisible by both inputs. For 12 and 18, 216 ÷ 6 = 36, and 36 ÷ 12 = 3 with 36 ÷ 18 = 2 — both exact, so 36 is confirmed. A result that fails either division is wrong, whatever the calculator said.
A worked example: 12 and 18, 4 and 6, 5 and 7
Start with the defaults: 12 and 18. The GCD is 6, the product is 216, and 216 ÷ 6 = 36, so the LCM is 36. Check it: 36 ÷ 12 = 3 and 36 ÷ 18 = 2, both exact, and 24 fails on 18 while 18 fails on 12, so 36 is genuinely the least.
Now 4 and 6. The GCD is 2, the product is 24, and 24 ÷ 2 = 12, so the LCM is 12. Both numbers divide 12 exactly — 12 ÷ 4 = 3 and 12 ÷ 6 = 2 — and 6 is divisible by 6 but not by 4, so 12 is the smallest that works.
Finally the coprime pair: 5 and 7. The GCD is 1, the product is 35, and 35 ÷ 1 = 35, so the LCM is 35. No smaller number is divisible by both 5 and 7, because the first common multiple of two coprime numbers is always their product.
A quick mental check for any LCM answer is to divide it by both inputs and confirm both divisions are exact. For 12 and 18 with an LCM of 36, the quotients are 3 and 2 — whole numbers, as required. If either division leaves a remainder, the number is not a common multiple at all, and the real LCM is larger.
Where the LCM actually gets used
Adding fractions is the everyday use. To add 1/12 and 1/18, you need a common denominator, and the least common denominator is the LCM of 12 and 18, which is 36. The sum becomes 3/36 + 2/36 = 5/36. Any common multiple would work, but the LCM keeps the numbers small and the arithmetic clean. Adding fractions needs a common denominator, which is where the LCM comes in — our fraction calculator does the whole job in one go.
Scheduling runs on the LCM. Two machines serviced every 12 and 18 days coincide every 36 days, so the maintenance team plans a joint shutdown on that day. Two buses on 12-minute and 18-minute loops meet at the depot every 36 minutes, which is when drivers swap over.
Music and gearing use the same idea. Two rhythms repeating every 12 and 18 beats line up every 36 beats — the point where a drummer can bring both patterns together. Two gears with 12 and 18 teeth return to their starting alignment after 36 teeth have passed. A ratio calculator helps express the gear sizes as a simple ratio before the LCM finds the meeting point.
Traffic engineers use the LCM to time traffic lights. Two lights cycling every 12 and 18 seconds turn green together every 36 seconds, and the signal plan is built around that meeting point so that a driver catching one green light has a chance of catching the next. The same maths times factory machines that must pause together for a shift change.
LCM calculator vs GCD calculator
The LCM and the GCD answer opposite questions about the same pair. The LCM asks: what is the smallest number both of these divide? The GCD asks: what is the largest number that divides both of these? For 12 and 18, the answers are 36 and 6 — one above the inputs, one below them.
Use the LCM when you are lining things up — adding fractions, scheduling repeating events, finding when two cycles coincide. Use the GCD calculator when you are splitting things down — simplifying a fraction, cutting equal lengths, finding the biggest shared piece.
This calculator gives you both answers from one pair of inputs, so the choice is really about which row you read. The LCM is the main result here; the GCD page makes the GCD the main result, with the LCM alongside it.
Common LCM mistakes
The most common mistake is confusing the LCM with the GCD. The LCM of 12 and 18 is 36 — a big number, never smaller than the bigger input. The GCD is 6 — a small number, never bigger than the smaller input. If your LCM comes out smaller than one of the inputs, you have found the GCD by accident.
The second mistake is multiplying the numbers and calling the product the LCM. For 12 and 18 the product is 216, but the LCM is 36 — the product counts the overlap twice. The product is the LCM only when the numbers are coprime, like 5 and 7, where the GCD is 1 and nothing overlaps.
The third mistake is listing multiples and stopping at the first multiple of one number. The multiples of 12 start 12, 24, 36 — and 24 is divisible by 12 but not by 18, so it is not a common multiple at all. A common multiple must be divisible by both numbers, and the least of those is the LCM.
The fourth mistake is using the LCM on numbers that are not whole. The LCM is defined for integers; for decimals, scale first. 1.2 and 1.8 share an LCM of 3.6 only after scaling by 10 to 12 and 18 — and a scientific calculator can handle the scaling step if the decimals are awkward. A fifth mistake is assuming the LCM of three numbers is the LCM of the first two. It is the LCM of the result with the third: LCM(12, 18, 8) is LCM(36, 8) = 72. Build it up one pair at a time, and the method extends to any count of numbers.
How to use this LCM calculator
Type two whole numbers into the boxes — 12 and 18 are the defaults. The LCM and the GCD of the pair update live as you type, so you can watch the LCM change as you change either number. Decimals are rounded down to whole numbers, and negative numbers are treated as their positive versions, since the LCM depends only on divisibility.
Try 4 and 6 to check the tool: the LCM is 12 and the GCD is 2. Then try 5 and 7: the LCM is 35 and the GCD is 1, the product of the two numbers, which confirms they are coprime.
Everything runs in your browser. No account, no upload, no data sent anywhere — your numbers never leave your device. Use it for fractions, schedules, and repeating cycles, and pair it with the percentage calculator whenever a schedule or a fraction needs turning into a share of the whole.