Back to Home

LCM Calculator

Find the least common multiple of two or more numbers instantly.

Least Common Multiple
24
for 4, 6, 8
Numbers: 4, 6, 8
GCD (all numbers): 2
LCM: 24

LCM is the smallest number divisible by all inputs.

Step-by-Step Working (Prime Factorization)

Complete LCM Calculator Guide 2025

The Least Common Multiple, or LCM, is one of the first tools students learn in school, and it keeps showing up long after: in adding fractions, scheduling repeating events, and simplifying ratios in engineering and everyday planning. Despite being simple in concept, working it out by hand for three or more numbers can get tedious and error-prone.

Our LCM Calculator finds the least common multiple of two or more numbers instantly. Enter any list of whole numbers separated by commas, and you get the LCM along with the greatest common divisor (GCD) and a full step-by-step prime factorization, so you can see exactly how the answer was reached. It is free, works on any device and needs no sign-up.

Quick Fact: The LCM of two numbers is always divisible by both, and it is never smaller than the larger of the two numbers.

What Is LCM?

The Least Common Multiple of a set of numbers is the smallest positive number that all of them divide into evenly, with no remainder. For example, the multiples of 4 are 4, 8, 12, 16, 20, 24... and the multiples of 6 are 6, 12, 18, 24, 30... The smallest number appearing in both lists is 12, so the LCM of 4 and 6 is 12.

How to Find LCM: Three Methods

1. Listing Multiples

Write out multiples of each number until you find the smallest one shared by all of them. This works well for small numbers but becomes slow for large ones or more than two numbers.

2. Prime Factorization

Break each number down into its prime factors, then multiply together the highest power of every prime that appears in any of the numbers. This is the method our calculator shows in its step-by-step working, because it scales well to any number of inputs.

Example: LCM of 12 and 18.
12 = 22 × 3
18 = 2 × 32
LCM = 22 × 32 = 4 × 9 = 36

3. Using GCD

For two numbers, LCM(a, b) = (a × b) ÷ GCD(a, b), where GCD is the greatest common divisor. This is often the fastest method by hand once you know the GCD.

Example: LCM of 8 and 12. GCD(8, 12) = 4, so LCM = (8 × 12) ÷ 4 = 96 ÷ 4 = 24.

Quick Tip: The Euclidean algorithm is the fastest way to find GCD by hand: repeatedly replace the larger number with the remainder of dividing it by the smaller number, until the remainder is 0.

How This Calculator Works

  1. Enter two or more positive whole numbers, separated by commas, in the input box above.
  2. The calculator breaks each number down into its prime factors.
  3. It takes the highest power of every prime that appears across all the numbers.
  4. Multiplying those highest powers together gives the LCM, shown instantly with full working.
  5. The GCD of the full set is also shown, useful when you need both values together.

LCM of Common Number Pairs

NumbersGCDLCM
4, 6212
6, 8224
5, 10510
7, 9163
12, 15, 20160
2, 3, 4, 5160

Notice that when two numbers share no common factors other than 1, meaning their GCD is 1, they are called coprime, and their LCM is simply the product of the two numbers, as seen with 7 and 9 above.

LCM Method Comparison

MethodBest ForDrawback
Listing MultiplesSmall numbers, quick mental checksSlow for large or multiple numbers
Prime FactorizationAny size, any count of numbersRequires factoring each number first
GCD FormulaExactly two numbersDoes not extend directly to three or more numbers

For three or more numbers, prime factorization is generally the most reliable method, which is why our calculator's step-by-step working uses it by default, regardless of how many numbers you enter.

LCM vs. GCD: What Is the Difference?

LCM and GCD are opposite but related ideas. The GCD (greatest common divisor, also called HCF) is the largest number that divides all the given numbers without a remainder. The LCM is the smallest number that all the given numbers divide into without a remainder. GCD shrinks toward the smallest shared factor, while LCM grows toward the smallest shared multiple, and for two numbers they are linked by the formula shown above.

Real-World Uses of LCM

  • Adding and subtracting fractions: Find a common denominator by using the LCM of the denominators.
  • Scheduling: Work out when repeating events, such as buses, shifts or machine cycles, line up again.
  • Music and rhythm: Determine when different note patterns or time signatures realign.
  • Manufacturing and engineering: Coordinate gears, production cycles and batch sizes that repeat at different intervals.
  • Puzzles and competitions: LCM questions are common in school exams and math olympiads.

LCM in Scheduling: A Practical Example

Suppose Bus A arrives every 12 minutes and Bus B arrives every 18 minutes, and both just left the station together. The next time they will both be at the station at the same moment is the LCM of 12 and 18, which is 36 minutes later. This exact type of reasoning applies to shift rotations, traffic light cycles, and any situation where two or more repeating events need to be synchronized.

Worked Example: Adding Fractions with LCM

Add 1/4 and 1/6. The denominators are 4 and 6, and their LCM is 12. Convert both fractions to have denominator 12: 1/4 = 3/12 and 1/6 = 2/12. Adding gives 3/12 + 2/12 = 5/12, which is already in lowest terms.

LCM of Numbers That Divide Evenly

If one number is a multiple of another, the LCM is simply the larger number. For example, the LCM of 5 and 20 is 20, since 20 is already a multiple of 5. This shortcut is worth remembering, since it lets you skip the full factorization process whenever one number divides evenly into another.

Worked Example: LCM of Three Numbers

Find the LCM of 6, 10 and 15.
6 = 2 × 3
10 = 2 × 5
15 = 3 × 5
Take the highest power of every prime that appears: 2, 3 and 5.
LCM = 2 × 3 × 5 = 30

Common Mistakes to Avoid

1. Confusing LCM with GCD

LCM is the smallest shared multiple, while GCD is the largest shared factor. Mixing them up is one of the most frequent errors in this topic.

2. Missing a Prime Factor

When using prime factorization, make sure every prime that appears in any number is included in the final product, using its highest power across all the numbers.

3. Stopping Too Early When Listing Multiples

For three or more numbers, the shared multiple may not appear until much further down the list than expected, especially if the numbers do not share many factors.

4. Entering Zero or Negative Numbers

LCM is only defined for positive whole numbers. Zero and negative inputs do not have a meaningful least common multiple in the usual sense.

Note: This calculator accepts positive whole numbers only. Decimals, negative numbers and zero are not supported.

Conclusion

LCM is a small but genuinely useful concept that connects arithmetic to fractions, scheduling and many practical problems. Use the calculator above to get instant, accurate results for any list of numbers, and follow the prime factorization steps to understand and practice the method by hand.

LCM Calculator: Frequently Asked Questions

What is the LCM of two numbers?
The LCM of two numbers is the smallest positive number that both numbers divide into evenly, with no remainder.
How is LCM different from GCD?
GCD (greatest common divisor) is the largest number that divides all the given numbers, while LCM is the smallest number that all the given numbers divide into.
Can I find the LCM of more than two numbers?
Yes. Enter as many numbers as you like, separated by commas, and the calculator will find the LCM of the entire set using prime factorization.
What is the LCM of two coprime numbers?
If two numbers share no common factor other than 1, their LCM is simply the product of the two numbers, for example LCM(7, 9) = 63.
Why is LCM useful for adding fractions?
To add or subtract fractions, you need a common denominator. Using the LCM of the denominators gives the smallest possible common denominator, keeping the numbers simpler to work with.