Skip to content
Math

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.

Your details

First positive integer (fractions are rounded to the nearest whole number).
Second positive integer.
Third number to include in the LCM (optional).
Fourth number to include in the LCM (optional).
Fifth number to include in the LCM (optional).
Sixth number to include in the LCM (optional).
LCM
36

Least common multiple of all entered numbers

GCF6
LCM / GCF ratio6
Product / LCM ratio6
Numbers entered2
LCM36
GCF6

LCM(12, 18) = 36

  • The greatest common factor is 6, so the numbers share at least one prime factor.
  • The LCM is the smallest positive integer that both 12 and 18 divide without a remainder.
  • The LCM is useful for adding or subtracting fractions: it gives the least common denominator.

Next stepTo add fractions with these denominators, convert both to 36 and then add the numerators.

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

DivisorNumber is divisible if...Example
2Last digit is even (0, 2, 4, 6, 8)128 ends in 8 - yes
3Sum of digits is divisible by 3123: 1+2+3=6 - yes
4Last two digits form a number divisible by 4312: 12/4=3 - yes
5Last digit is 0 or 5135 ends in 5 - yes
6Divisible by both 2 and 342: even and digit sum 6 - yes
7Double last digit, subtract from rest; repeat161: 16 - 2=14 - yes
8Last three digits divisible by 81,024: 024/8=3 - yes
9Sum of digits divisible by 9729: 7+2+9=18 - yes
10Last digit is 0250 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.

Sources

Written by Dr. Rajiv Menon, PhD Applied Mathematician · Bengaluru, India

Applied mathematician bridging algebraic theory and computational tools for students, engineers, and everyday problem-solvers.

Search 3,500+ calculators

Loading search…