LCM Calculator
Least common multiple answers a scheduling question: when will two repeating cycles land together again? Buses every 12 and every 18 minutes, gears with different tooth counts, denominators that refuse to match — each needs the smallest number divisible by both inputs. This calculator returns that number, the GCD of the pair, and the identity tying the two together.
Enter values
Results
- Least common multiple (LCM)
- 36
- Greatest common divisor (GCD)
- 6
- Identity: LCM × GCD = A × B
- 36 × 6 = 12 × 18
How is the LCM calculated?
Two fields take whole numbers from 0 to 1,000,000. The calculator finds the greatest common divisor with Euclid's algorithm, divides the first input by it, then multiplies by the second — dividing first keeps the product comfortably inside exact integer range. The LCM leads the results, the GCD follows, and the last row writes the identity out in full: LCM × GCD on the left, A × B on the right.
Formula
LCM(A, B) = A ÷ GCD(A, B) × B, where GCD comes from repeated remainders: GCD(12, 18) → GCD(12, 6) → GCD(6, 0) = 6, so LCM = 12 ÷ 6 × 18 = 36. Because one operation undoes the other, LCM × GCD always equals A × B. Zero is excluded — every multiple of 0 is 0, so no smallest positive multiple exists.
Example
Buses leave a junction every 12 minutes and every 18 minutes. LCM(12, 18) = 36, so both are back together after 36 minutes — three loops of the first service and two of the second. Their GCD is 6 and the identity checks out: 36 × 6 = 216 = 12 × 18. Co-prime inputs such as 5 and 7 share no factor at all, so their LCM is simply the product, 35.
Things to remember
The least common multiple balloons when inputs share very little: 999 and 36 need 3,996 as their common multiple while their GCD is only 9. Keep the pair of ideas together — simplifying wants the GCD, synchronising wants the LCM — and the identity row is a one-second check that your arithmetic still holds.
Frequently Asked Questions
What is the least common multiple of 12 and 18?
36. The multiples of 12 run 12, 24, 36, 48 onwards and the multiples of 18 run 18, 36, 54 onwards, so 36 is the first number appearing in both lists. Dividing by the GCD finds it faster: 12 ÷ 6 × 18 = 36.
How do I find the LCM of two numbers?
Find the GCD first, divide one number by it and multiply by the other. Listing multiples until one matches also works, but only for small inputs. Prime factorisation is a third route: break both numbers into primes, then take every prime at its highest power.
What is the LCM of two prime numbers?
Their product, because primes share no factor beyond 1: LCM(5, 7) = 35 and LCM(11, 13) = 143. The same rule covers any co-prime pair, so 8 and 15 — no shared factor between them — have an LCM of 120.
Why does LCM times GCD equal A times B?
Dividing A by the GCD strips out the shared factors once, and multiplying by B restores every factor of B — exactly the product. For 12 and 18 the GCD is 6 and the LCM is 36, and 36 × 6 = 216, the same as 12 × 18.
Related Calculators
- HCF CalculatorMath & ArithmeticFind the highest common factor of two numbers, shown with every division performed by Euclid's algorithm.
- Factor CalculatorMath & ArithmeticList every factor of a whole number, count them and see the prime factorisation written out with powers.
- Prime Number CalculatorMath & ArithmeticCheck whether a number is prime, see its smallest prime factor and find the next prime that follows it.
- Fraction CalculatorMath & ArithmeticAdd, subtract, multiply or divide two fractions and get the answer simplified, plus its decimal and percentage forms.