LCM Calculator
Enter two or more numbers to get their least common multiple, with the prime factorization method and the listing-multiples method written out.
2 to 10 positive whole numbers, separated by commas or spaces.
- GCF (greatest common factor)
- 6
- LCM as prime factors
- 2² × 3²
- Product of the two numbers
- 216
- LCM × GCF
- 36 × 6 = 216
Method 1: prime factorization
- Write each number as a product of primes:
- 12 = 2² × 3
- 18 = 2 × 3²
- Take the highest power of each prime that appears anywhere: 2² × 3² = 36.
Method 2: listing multiples
- Multiples of 12: 12, 24, 36, …
- Multiples of 18: 18, 36, …
- The smallest number in both lists is 36, so LCM(12, 18) = 36.
How this LCM calculator works
The least common multiple of two or more numbers is the smallest number that all of them divide into without a remainder. This LCM calculator finds it with prime factorization: every number is broken into primes, and the LCM is built by taking the highest power of each prime that appears anywhere, then multiplying those together. Because the result is built from exact prime powers it never overflows, so you can enter up to ten numbers as large as a trillion.
For two numbers there is also the shortcut LCM(a, b) = a × b ÷ GCF(a, b), and the old-fashioned way of simply listing multiples until one shows up in both lists. The calculator writes that list out too whenever it is short enough to be useful.
Worked example: LCM of 12 and 18
Start with the prime factorizations: 12 = 2² × 3 and 18 = 2 × 3². The highest power of 2 that appears is 2², and the highest power of 3 is 3². Multiply them: 2² × 3² = 36. Listing multiples confirms it: multiples of 12 are 12, 24, 36, …; multiples of 18 are 18, 36, …; the first number in both lists is 36. And the shortcut agrees: the GCF of 12 and 18 is 6, so 12 × 18 ÷ 6 = 216 ÷ 6 = 36.
With three numbers the factorization method is the one to use. For 12, 18 and 30 (30 = 2 × 3 × 5) the highest powers are 2², 3² and 5, so the LCM is 4 × 9 × 5 = 180. Do not try the a × b ÷ GCF shortcut on three numbers at once; it only works pairwise.
Why the LCM matters for fractions
The main reason anyone learns this is adding fractions. To compute 5/12 + 7/18 you need a common denominator, and the smallest one that works is the LCM of 12 and 18, which is 36. Convert: 5/12 = 15/36 and 7/18 = 14/36, so the sum is 29/36. You could use 12 × 18 = 216 as the denominator instead, but you would end up with 174/216 and have to simplify it back down. The LCM saves you that step.
The same idea shows up in scheduling: if one bus comes every 12 minutes and another every 18, they leave together every 36 minutes. Gears, repeating patterns and recipe scaling all use the LCM too.
Common mistakes
- Multiplying the numbers together. 12 × 18 = 216 is a common multiple, but it is not the least one unless the numbers share no factors.
- Taking the lowest power instead of the highest. That gives you the GCF, not the LCM. The LCM must be divisible by every number, so it needs the biggest exponent of each prime.
- Mixing up LCM and GCF. The LCM is always at least as big as the largest number; the GCF is never bigger than the smallest. If your answer is smaller than one of the inputs, you found the GCF.
If you want to see the full factor list of any single number, including every factor pair, use the factor calculator.
Frequently asked questions
›What is the least common multiple?
The LCM of two or more numbers is the smallest positive number that every one of them divides into evenly. The LCM of 4 and 6 is 12: it is the first number that appears in both lists of multiples.
›How do you find the LCM using prime factorization?
Write each number as a product of primes, then take the highest power of every prime that appears and multiply them together. 12 = 2² × 3 and 18 = 2 × 3², so LCM = 2² × 3² = 36.
›What is the LCM formula for two numbers?
LCM(a, b) = a × b ÷ GCF(a, b). For 12 and 18 the GCF is 6, so the LCM is 12 × 18 ÷ 6 = 36. This shortcut only works for two numbers at a time.
›What is the LCM used for?
Mostly adding and subtracting fractions: the LCM of the denominators is the least common denominator. 1/4 + 1/6 uses 12 as the common denominator: 3/12 + 2/12 = 5/12.
›What is the LCM of two prime numbers?
Their product, because primes share no factors. LCM(7, 11) = 77. The same is true for any two numbers whose GCF is 1.