LCM Calculator (Least Common Multiple)
Enter two to six positive integers to find their least common multiple (LCM). The calculator shows the full prime factorization of each number, the merged factor table used to build the LCM, the GCD-based shortcut, and plain-English steps so you can follow every stage of the working.
What is the least common multiple?
The least common multiple (LCM) of two or more integers is the smallest positive integer that is divisible by every number in the set. For example, multiples of 4 are 4, 8, 12, 16, 20, 24, ... and multiples of 6 are 6, 12, 18, 24, ... The smallest number that appears in both lists is 12, so LCM(4, 6) = 12. The LCM is always at least as large as the biggest number in the set, and it equals the product of all the numbers only when they share no common factors (i.e., their GCF is 1).
Three ways to find the LCM
Method 1 - Listing multiples: write out multiples of each number and find the first one they share. Fast for small numbers but tedious for large ones. Method 2 - Prime factorization: break each number into its prime factors, then multiply the highest power of every prime that appears across any of the numbers. This is the most reliable method for large integers and is what this calculator shows in its step-by-step panel. Method 3 - GCF shortcut: for two numbers a and b, LCM(a, b) = (a x b) / GCF(a, b). Extend this to more numbers by applying it sequentially: LCM(a, b, c) = LCM(LCM(a, b), c).
LCM and fractions - the least common denominator
The most common real-world use of the LCM is adding or subtracting fractions with different denominators. The least common denominator (LCD) of two fractions is exactly the LCM of their denominators. For example, to add 1/4 and 1/6 you need a common denominator: LCM(4, 6) = 12, so 1/4 = 3/12 and 1/6 = 2/12, giving 3/12 + 2/12 = 5/12. Using the LCM keeps the resulting fraction in its simplest form, avoiding large numerators and denominators.
LCM and GCF - the fundamental identity
For any two positive integers a and b, there is a useful identity: LCM(a, b) x GCF(a, b) = a x b. This means that knowing either the LCM or the GCF immediately gives you the other, without re-doing the full factorization. The ratio LCM / GCF shown in the results tells you how "spread apart" the two numbers are in terms of their shared and unshared prime factors. When the GCF equals 1 (the numbers are coprime), the LCM is exactly their product, and the ratio is that product. Knowing this identity is a quick sanity check: if LCM x GCF does not equal the product of the two numbers, something went wrong.
Quick divisibility rules
| Divisor | Number is divisible if... | Example |
|---|---|---|
| 2 | Last digit is even (0, 2, 4, 6, 8) | 128 ends in 8 - yes |
| 3 | Sum of digits is divisible by 3 | 123: 1+2+3=6 - yes |
| 4 | Last two digits form a number divisible by 4 | 312: 12/4=3 - yes |
| 5 | Last digit is 0 or 5 | 135 ends in 5 - yes |
| 6 | Divisible by both 2 and 3 | 42: even and digit sum 6 - yes |
| 7 | Double last digit, subtract from rest; repeat | 161: 16 - 2=14 - yes |
| 8 | Last three digits divisible by 8 | 1,024: 024/8=3 - yes |
| 9 | Sum of digits divisible by 9 | 729: 7+2+9=18 - yes |
| 10 | Last digit is 0 | 250 ends in 0 - yes |
Use these rules to spot small prime factors before running a full factorization.
Frequently asked questions
What is the LCM of two prime numbers?
If both numbers are prime and different from each other, they share no common factors, so their GCF is 1 and their LCM is simply their product. For example, LCM(5, 7) = 35. If both numbers are the same prime, the LCM equals that prime (e.g., LCM(7, 7) = 7).
Can the LCM be smaller than any of the input numbers?
No. The LCM is always at least as large as the largest number in the set, because it must be a multiple of every input. The only time the LCM equals the largest input is when all the other numbers are already divisors of that largest number.
What is the difference between LCM and GCF?
The GCF (greatest common factor, also called GCD) is the largest number that divides all the inputs exactly. The LCM is the smallest number that all the inputs divide exactly. They move in opposite directions: large GCF means the numbers share many factors; large LCM relative to the inputs means they share few. For two numbers, LCM x GCF always equals their product.
How do I find the LCM of three or more numbers?
The cleanest way is the prime factorization method: find the prime factors of each number, then collect the highest power of every prime that appears. Multiply those highest powers together to get the LCM. Alternatively, apply the two-number LCM formula repeatedly: find LCM of the first two, then find LCM of that result and the third number, and so on. Both approaches give the same answer.
What does it mean for two numbers to be coprime?
Two numbers are coprime (or relatively prime) when their GCF is 1, meaning they share no prime factors at all. For coprime numbers the LCM equals their product: LCM(8, 9) = 72 because 8 = 2^3 and 9 = 3^2 share no primes. Consecutive integers are always coprime, and so are most pairs of distinct prime numbers.
Why is the LCM useful for scheduling problems?
If event A repeats every a days and event B repeats every b days, they next coincide after LCM(a, b) days. The classic example is cicada emergence: 13-year and 17-year cicada broods both emerge in the same year only every LCM(13, 17) = 221 years, because 13 and 17 are coprime primes. The same logic applies to gear ratios, repeating patterns in art and music, and synchronized machinery.