LCM Calculator

Find the least common multiple of two numbers, see where their multiples first line up, and understand exactly why.

The First Point Where Two Patterns Line Up

The least common multiple (LCM) of two numbers is the smallest number that both of them divide into evenly. If you list the multiples of 4 (4, 8, 12, 16, 20...) and the multiples of 6 (6, 12, 18, 24...), the first number they have in common is 12 — so LCM(4, 6) = 12.

Think of it as two repeating patterns that eventually sync up. If one event happens every 4 days and another every 6 days, and both happen today, the LCM tells you exactly how many days pass before they both happen on the same day again. That's a more common real-life question than it might sound like — it's the same math behind bus schedules, blinking lights, and orbital alignments.

At a glance:
• The LCM is always a multiple of both original numbers
• LCM(a, b) is never smaller than the larger of the two numbers
• If two numbers are coprime, their LCM is simply their product
• LCM and GCD are connected: LCM(a, b) × GCD(a, b) = a × b

LCM Calculator

Multiples Timeline

LCM

12

least common multiple

GCD

2

used to derive LCM

a × b

24

check: LCM × GCD

How to Actually Calculate the LCM

Fastest formula:

LCM(a, b) = (a × b) ÷ GCD(a, b)

Find the GCD first (with the Euclidean algorithm), then plug it into this formula.

Worked Example

Given: a = 4, b = 6

Step 1: Find GCD(4, 6) → the largest number dividing both is 2
Step 2: Multiply the two numbers → 4 × 6 = 24
Step 3: Divide by the GCD → 24 ÷ 2 = 12

The Prime Factorization Method

Break each number into prime factors: 4 = 2², and 6 = 2 × 3. For the LCM, take every prime that appears in either factorization, using the highest power it appears with anywhere: that's 2² and 3¹. Multiply those together — 4 × 3 = 12 — matching the answer above. This method is especially useful when working with more than two numbers at once.

LCM Reference Table

These pairs come up constantly when adding fractions with unlike denominators, since the LCM becomes the lowest common denominator.

Common Pairs

a b LCM Note
3 4 12 Coprime, so LCM = a × b
6 8 24 Common denominator for 1/6 + 1/8
5 10 10 One number divides the other
12 18 36 Shares factor of 6

Where the LCM Shows Up in Practice

Adding and Subtracting Fractions: Combining fractions with different denominators, like 1/4 + 1/6, requires rewriting both over a shared denominator — and the smallest one that works is exactly the LCM of the two original denominators.

Traffic Lights & Public Transit: If one bus route runs every 15 minutes and another every 20 minutes, and both depart together at 8:00 AM, the LCM of 15 and 20 tells a commuter exactly when both buses will next leave the station at the same time.

Manufacturing & Gear Trains: When two gears with different tooth counts mesh together, the LCM of their tooth counts determines how many rotations pass before the exact same two teeth line up again — relevant for predicting wear patterns.

Event & Task Scheduling: Recurring tasks on different cycles (a report due every 7 days, a review due every 12 days) will next coincide on the same day exactly LCM(7, 12) days from now.

Music & Rhythm: When two rhythmic patterns of different lengths repeat simultaneously, the LCM of their lengths tells a musician how many total beats pass before both patterns return to their starting point together.

Packaging & Bulk Ordering: If hot dogs come in packs of 10 and buns come in packs of 8, the LCM tells you the smallest number of hot dogs and buns you'd need to buy to use every single one with none left over.

Tips for Working With LCMs

✓ If one number divides the other, the LCM is the larger one: LCM(5, 10) = 10, since 10 is already a multiple of 5 — no extra calculation needed.

✓ Coprime numbers multiply straight through: If GCD(a, b) = 1, then LCM(a, b) is simply a × b, with nothing to simplify.

✓ LCM only gets bigger with more numbers: Adding a third or fourth number to the calculation can only keep the LCM the same or make it larger — never smaller.

✓ For more than two numbers, combine two at a time: Find LCM(a, b) first, then find the LCM of that result with c, and so on down the list.

✓ Don't confuse it with GCD: A quick sanity check — the LCM should always be a large number (a multiple), while the GCD should always be a small number (a divisor).

✓ Skip listing multiples for large numbers: Listing multiples works fine for small numbers, but the GCD-based formula is dramatically faster once the numbers get large.

Why Ancient Calendars Needed This Math

Calendars Were the Original LCM Problem: Long before formal number theory existed, astronomers and calendar-makers were already solving LCM-style problems by necessity — figuring out how many years must pass before the lunar cycle and solar year realign, since the two don't divide evenly into each other.

The Metonic Cycle: Around 432 BCE, the Greek astronomer Meton of Athens identified that 19 solar years correspond almost exactly to 235 lunar months, a discovery essentially equivalent to finding a near-common-multiple between two incompatible cycles — a relationship still used in calculating the date of Easter today.

Chinese and Babylonian Parallels: Ancient Chinese and Babylonian astronomers independently worked out comparable cycle-alignment periods for their own calendars, arriving at similar answers to the same underlying LCM-type problem, without direct contact between the two traditions.

Formalized Much Later: The LCM as a defined arithmetic operation, connected explicitly to the GCD through the formula used today, was formalized as part of the broader development of number theory in the centuries following Euclid, even though people had been solving LCM problems by necessity for millennia before that.

Frequently Asked Questions

Q: What's the LCM of a number and itself?

It's just the number itself — LCM(7, 7) = 7, since a number is always its own smallest multiple.

Q: Can the LCM of two numbers be smaller than both of them?

No. The LCM is always greater than or equal to the larger of the two input numbers, since it must be a multiple of both.

Q: How do I find the LCM of three or more numbers at once?

Combine them two at a time: find the LCM of the first pair, then find the LCM of that result with the next number, repeating until every number has been included.

Q: Why do I need the LCM to add fractions?

Fractions can only be added directly when they share the same denominator. The LCM of the original denominators gives the smallest shared denominator to convert both fractions to before adding.

Q: Is there an LCM for negative numbers?

By convention, the LCM is defined for positive integers. If negative numbers are involved, most calculations use their absolute values first.

Q: What's the LCM of 0 and another number?

LCM(0, n) is defined as 0 in most conventions, since 0 is technically a multiple of every number, making it the "smallest" shared multiple in that specific edge case.