LCM Calculator (Least Common Multiple)
Find the least common multiple of two or more whole numbers, with the GCF and the prime-factor working that shows how the LCM is built.
The least common multiple (LCM) is the smallest positive number that every number in your list divides into exactly. You need it to add fractions with different denominators, to work out when repeating schedules line up again, or to match gear teeth and tile patterns. Enter two or more whole numbers to get the LCM, the greatest common factor and the prime-factor working.
How to use this tool
- Type the whole numbers, separated by commas or spaces, for example 12, 18, 30.
- Read the LCM and the GCF (greatest common factor).
- Check the prime factorization of each number in the first table.
- The second table lists the highest power of each prime; multiplying them gives the LCM.
Formula
LCM = product of each prime raised to its highest power in any of the numbers · two numbers: LCM(a, b) = a × b ÷ GCF(a, b)
The GCF uses the lowest power of each shared prime instead. The two-number shortcut does not carry over directly to three or more numbers, so the calculator combines them one at a time: LCM(a, b, c) = LCM(LCM(a, b), c). Negative numbers are treated by their absolute value.
Example
Find the LCM of 12, 18 and 30. Factor each one: 12 = 2² × 3, 18 = 2 × 3² and 30 = 2 × 3 × 5. Take the highest power of every prime that appears: 2², 3² and 5. Multiply them: 4 × 9 × 5 = 180. The GCF uses the lowest shared powers instead, 2 × 3 = 6.
Frequently asked questions
How is the LCM used to add fractions?
The LCM of the denominators is the lowest common denominator. For 1/4 + 1/6, LCM(4, 6) = 12, so rewrite the sum as 3/12 + 2/12 = 5/12.
What is the LCM of two prime numbers?
Their product, because they share no factors: LCM(7, 13) = 91. The same holds for any two numbers whose GCF is 1.
Two buses leave together, one every 12 minutes and one every 18. When do they leave together again?
After LCM(12, 18) = 36 minutes.
Why can’t I enter 0 or decimals?
Every number divides 0, so a least positive common multiple involving 0 does not exist, and multiples are defined for whole numbers. To work with decimals, scale them to whole numbers first.
Last updated: 2026-10-30