LCM Calculator

Find the least common multiple of two or more numbers, with the working.

LCM Calculator tool

Separate with commas, spaces or new lines

—
Least common multiple
—
Greatest common factor
—
LCM in prime factors

About the LCM Calculator

The least common multiple tells you when repeating events line up and what common denominator to use when adding fractions. If one bus leaves every 12 minutes and another every 18, they leave together every 36 minutes, the LCM of 12 and 18. This LCM calculator handles two or more numbers and shows the prime factor and GCD methods step by step.

With prime factors, write each number as a product of primes and take every prime that appears, to the highest power it appears in any of the numbers. With the GCD method, LCM(a, b) = a × b ÷ GCD(a, b), applied two numbers at a time for longer lists. Both always give the same result, and the calculator works exactly with arbitrarily large integers.

Example: for 4, 6 and 15, the prime factorizations are 2², 2 × 3 and 3 × 5. Taking the highest powers gives 2² × 3 × 5 = 60, so the LCM is 60. Using GCDs: LCM(4, 6) = 24 ÷ 2 = 12, and LCM(12, 15) = 180 ÷ 3 = 60. So two buses that run every 4 and 6 minutes, and a third every 15, all leave together every 60 minutes.

The LCM of denominators is the least common denominator used for fractions. Try the LCD calculator for fractions directly, the GCF calculator for common factors, and the fraction calculator to add and subtract fractions.

How to use the LCM Calculator

  1. Enter the numbersType two or more whole numbers separated by commas or spaces.
  2. Read the LCMSee the least common multiple and the greatest common factor.
  3. Check the prime factor methodSee each factorization and the highest power of each prime.
  4. Check the GCD methodSee LCM(a, b) = a × b ÷ GCD(a, b) applied step by step.

LCM Calculator features

  • LCM of any number of integers
  • Prime factor method with highest powers
  • GCD formula method step by step
  • Greatest common factor as a bonus
  • Exact for very large numbers
  • Accepts commas, spaces or new lines
  • Free and private

Common uses

  • Adding and subtracting fractions
  • Finding when repeating events coincide
  • Scheduling rotations and shifts
  • Gear and pulley tooth-count problems
  • Number theory homework

The least common multiple in practice: packs, gears, rhythms and fractions

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

The least common multiple of two numbers is the smallest number that both divide into exactly. It answers questions about things that repeat on different cycles: when two events next coincide, how many of each pack to buy so nothing is left over, or which denominator to use when adding fractions. This guide covers those uses with worked examples and explains the quick formula linking the LCM to the greatest common factor.

Buying in packs

A classic example involves items sold in different pack sizes. If burger patties come in packs of 10 and buns in packs of 8, the smallest number of each that matches exactly is the LCM of 10 and 8, which is 40. You would buy 4 packs of patties and 5 packs of buns. The same reasoning applies to plates and cups, nuts and bolts, or any items used in pairs but sold in different quantities.

Gears

When two gears mesh, the same pair of teeth meets again only after a number of teeth equal to the LCM of their tooth counts has passed. For gears with 24 and 36 teeth, the LCM is 72, so the smaller gear turns 3 times and the larger 2 times before the same teeth meet again. Designers often choose tooth counts with a large LCM, so that wear spreads evenly across all the teeth.

Rhythms in music

Musicians use the LCM when combining rhythms. A pattern of 3 beats played against a pattern of 4 beats, a common polyrhythm, lines up again every 12 beats, the LCM of 3 and 4. Drummers and composers count these cycles to know when two patterns will return to a shared starting point.

Adding fractions

To add fractions with different denominators, rewrite them over a common denominator, and the LCM of the denominators is the smallest one that works. For 1/8 + 1/12, the LCM of 8 and 12 is 24, so the sum is 3/24 + 2/24 = 5/24. Using the product of the denominators, 96, also works, but gives larger numbers that then need simplifying.

The formula with the GCF

For two numbers, the LCM equals their product divided by their greatest common factor. For 24 and 36, the product is 864 and the GCF is 12, so the LCM is 864 ÷ 12 = 72. This is often the quickest method, because the GCF can be found rapidly with Euclid's algorithm.

Three or more numbers

For more than two numbers, find the LCM of the first two, then the LCM of that result with the next number, and so on. For 8, 12 and 15: the LCM of 8 and 12 is 24, and the LCM of 24 and 15 is 120. Prime factorisation gives the same result directly: 8 = 2³, 12 = 2² × 3 and 15 = 3 × 5, so the LCM is 2³ × 3 × 5 = 120.

A worked example: medicine reminders

A carer gives one medicine every 8 hours, another every 12 hours and checks a third device every 6 hours, all starting together at 8 am. The LCM of 8, 12 and 6 is 24, so all three tasks coincide again every 24 hours, at 8 am each day. Between those times, the 8-hour and 12-hour tasks coincide every 24 hours, while the 6-hour and 12-hour tasks coincide every 12 hours, at 8 am and 8 pm.

Laying out the cycles this way helps plan a daily routine. Medicine schedules should always follow the prescriber's instructions; the arithmetic simply helps organise them.

The LCM and calendars

Calendar cycles combine in the same way. The days of the week repeat every 7 days, and a date falls on the same weekday again in a non-leap year after 365 days, which is 52 weeks plus 1 day. Working out when cycles align, such as a monthly bill falling on a particular weekday, is an LCM problem in disguise.

Common mistakes

  • Multiplying numbers together and calling the product the LCM.
  • Confusing the LCM with the GCF.
  • Forgetting a number when combining three or more.
  • Using the LCM when a problem asks for equal groups, which needs the GCF.

Related tools

For common factors, use GCF Calculator. For fractions, try LCD Calculator, and for prime factors, Prime Factorization Calculator.

Shift rotations

Rotating schedules are another everyday LCM problem. If one worker is on a 4-day rotation and another on a 6-day rotation, and both start on the same day, they share a working day again every 12 days, the LCM of 4 and 6. Managers use this to see when particular people will overlap, and to plan meetings, training or handovers on days when the right people are present.

In spreadsheets and code

Excel and Google Sheets provide =LCM(), which accepts several numbers, and Python 3.9 and later include math.lcm. For older tools, the formula a × b ÷ GCF works with any GCD function. Building the LCM from the GCF is also the safest approach in code, because it keeps intermediate numbers small.

Limits

Results are exact for whole numbers of any practical size.

Frequently asked questions

What is the least common multiple?

The smallest positive number that is a multiple of each given number. The LCM of 4 and 6 is 12, because 12 is the first number both divide into.

How do I find the LCM using prime factors?

Factor each number into primes, then multiply each prime to the highest power that appears. For 12 = 2² × 3 and 18 = 2 × 3², the LCM is 2² × 3² = 36.

What is the formula for LCM using GCD?

LCM(a, b) = a × b ÷ GCD(a, b). For 12 and 18, GCD = 6, so LCM = 216 ÷ 6 = 36. For three or more numbers, apply it two at a time.

What is the difference between LCM and GCF?

The GCF is the largest number that divides all the numbers; the LCM is the smallest number all of them divide into. The GCF is never larger than the smallest number, and the LCM never smaller than the largest.

What is the LCM of two prime numbers?

Their product. Different primes share no factors, so the LCM of 7 and 11 is 77. More generally, the LCM of any two coprime numbers, such as 8 and 9, is their product, 72.

How is the LCM used with fractions?

The LCM of the denominators is the least common denominator. To add 1/4 + 1/6, use 12: 3/12 + 2/12 = 5/12. Using the LCM keeps the numbers as small as possible.

When do two repeating events happen together?

After the LCM of their intervals. If one light flashes every 8 seconds and another every 12, they flash together every 24 seconds. If both start together now, they coincide again at 24, 48 and 72 seconds.

Can the LCM be smaller than one of the numbers?

No. Every number must divide the LCM, so it is at least as large as the largest number in the list. It equals the largest number exactly when every other number divides it, as with 3, 4 and 12, whose LCM is 12.