LCM Calculator — Least Common Multiple of 2 or More Numbers
Find the smallest number every value divides into — the way you add fractions and sync repeating events
The least common multiple (LCM) of two or more whole numbers is the smallest positive number that every one of them divides into evenly. The LCM of 4 and 6 is 12, because 12 is the first number that appears in both the list of multiples of 4 (4, 8, 12, 16…) and the list of multiples of 6 (6, 12, 18…). It's one of the most useful ideas in middle-school math because it answers a very practical question: when do two repeating patterns line up again?
You meet the LCM most often when you add or subtract fractions. To add 1/4 + 1/6 you need a common denominator, and the cleanest one is the LCM of 4 and 6, which is 12 — so the sum becomes 3/12 + 2/12 = 5/12. That "least common denominator" is just the LCM of the denominators. The same idea schedules events that repeat on different cycles: if one bus comes every 4 minutes and another every 6, they arrive together every 12 minutes.
There are three reliable ways to find the LCM, and this calculator shows all of them.
Listing multiples. Write out the multiples of each number until you hit the first one they share. Quick for small numbers, slow for big ones.
The GCD shortcut (the fast, exact method). For two numbers, LCM(a, b) = |a × b| ÷ GCD(a, b), where GCD is the greatest common divisor. For 4 and 6, GCD = 2, so LCM = (4 × 6) ÷ 2 = 24 ÷ 2 = 12. For three or more numbers you fold the rule across the list: LCM(a, b, c) = LCM( LCM(a, b), c ). This is exactly how the calculator computes the answer, using the Euclidean algorithm for the GCD, so it stays fast and precise even for large values.
Prime factorization. Break each number into primes, then take the highest power of each prime that appears anywhere. 4 = 2² and 6 = 2 × 3, so the LCM uses 2² and 3¹ → 4 × 3 = 12. This method makes it obvious why the answer is what it is.
A few facts worth keeping in mind: the LCM is never smaller than the largest input; if one number is a multiple of the other, the larger one is the LCM (LCM of 3 and 12 is 12); and for any two numbers, LCM × GCD = the product of the two numbers. This tool accepts two or more whole numbers, ignores order, and shows the GCD, the prime factorization, and the first several shared multiples so you can check the result by hand.
Calculator
Fill in the fields and click "Calculate" for instant results.
📰 Formula
• Two numbers (GCD method): LCM(a, b) = |a × b| / GCD(a, b) • GCD via Euclid: GCD(a, b) = GCD(b, a mod b), until the remainder is 0 • Three or more: LCM(a, b, c) = LCM( LCM(a, b), c ) — fold pairwise across the list • Prime factorization: take the highest power of every prime that appears, then multiply • Identity: LCM(a, b) × GCD(a, b) = a × b
📰 Formula
• Two numbers (GCD method): LCM(a, b) = |a × b| / GCD(a, b) • GCD via Euclid: GCD(a, b) = GCD(b, a mod b), until the remainder is 0 • Three or more: LCM(a, b, c) = LCM( LCM(a, b), c ) — fold pairwise across the list • Prime factorization: take the highest power of every prime that appears, then multiply • Identity: LCM(a, b) × GCD(a, b) = a × b
🧪 Worked examples
Example 2
Example 3
Example 4
⚠️ Common mistakes
- Confusing LCM with GCF/GCD — the LCM is the smallest shared multiple (a bigger number), the GCF is the largest shared divisor (a smaller number).
- Multiplying the numbers together and stopping — a × b is a common multiple but usually not the least one.
- Forgetting to use the highest power of each prime in the factorization method (using 2 instead of 2³).
- Entering fractions or decimals — the LCM is defined for whole numbers only.
- Assuming the LCM is always the product; it only equals a × b when the numbers share no common factor.
💡 Tips
- Use the GCD shortcut: LCM(a, b) = a × b ÷ GCD(a, b) — far faster than listing multiples.
- If one number divides the other evenly, the larger number is the LCM — no work needed.
- For three or more numbers, find the LCM of the first two, then combine that result with the next number, and so on.
- Adding fractions? The least common denominator is just the LCM of the denominators.
Embed this calculator on your site
Copy the code below and paste it into the HTML of your site or blog.
<iframe src="https://www.calcnimbus.com/embed/lcm-calculator" width="100%" height="500" frameborder="0" style="border:1px solid #eee;border-radius:12px"></iframe>
❓ Frequently asked questions
What is the least common multiple (LCM)?
It's the smallest positive whole number that two or more numbers all divide into evenly. For 4 and 6 it's 12, because 12 is the first number that appears in both their multiplication tables.
What's the difference between LCM and GCF (or GCD)?
The LCM is the smallest number both values divide into (it's at least as big as the larger input). The GCF/GCD is the largest number that divides both (it's no bigger than the smaller input). They're related: LCM × GCD = the product of the two numbers.
How do I find the LCM using the GCD?
Use LCM(a, b) = (a × b) ÷ GCD(a, b). For 12 and 18, the GCD is 6, so the LCM = (12 × 18) ÷ 6 = 216 ÷ 6 = 36. This calculator uses exactly this method, extended pairwise for three or more numbers.
How do I find the LCM of three or more numbers?
Take the LCM of the first two numbers, then take the LCM of that result with the third, and keep folding across the list. LCM(a, b, c) = LCM( LCM(a, b), c ).
How is the LCM used to add fractions?
The least common denominator is the LCM of the denominators. To add 1/4 + 1/6, the LCM of 4 and 6 is 12, so you rewrite them as 3/12 + 2/12 = 5/12.
Is the LCM always the two numbers multiplied together?
Only when the numbers share no common factor (their GCD is 1), like 4 and 9 → LCM 36. If they share a factor, the LCM is smaller than the product. For 4 and 6, the product is 24 but the LCM is 12.
What is the LCM if one number is a multiple of the other?
The larger number is the LCM. Since 12 is already a multiple of 3, the LCM of 3 and 12 is just 12. No further calculation is needed.
Can the LCM be smaller than the largest number entered?
No. Every number has to divide into the LCM, so the LCM is always greater than or equal to the largest value you enter. It can equal the largest value, but never go below it.
Does the LCM work with negative numbers or decimals?
The least common multiple is defined for positive whole numbers. This calculator uses the absolute value of each entry and requires whole numbers, so enter positive integers for a meaningful result.