GCD & LCM
Numbers & arithmetic
Up to 5 numbers; shows Euclidean steps.
Numbers
Results
Verification: GCD × LCM = 6 × 72 = 432
Euclidean algorithm: gcd(12, 18)
| Step | a = q·b + r |
|---|---|
| 1 | 12 = 0 · 18 + 12 |
| 2 | 18 = 1 · 12 + 6 |
| 3 | 12 = 2 · 6 + 0 |
When the remainder is 0, the previous divisor is the GCD = 6.
Frequently asked questions
▶What do GCD and LCM mean?
GCD, the Greatest Common Divisor, is the largest number that divides all the given numbers exactly. LCM, the Lowest Common Multiple, is the smallest number that all of them divide into. For 12 and 18, the GCD is 6 and the LCM is 36. The tool shows both in a single click.
▶How do I find GCD and LCM of more than two numbers?
Just add as many numbers as you need, separated by commas or spaces. The calculator works pairwise : first finding the GCD or LCM of two, then combining with the next, and so on. For 8, 12 and 20, the GCD is 4 and the LCM is 120, which is what your textbook would give too.
▶What is the GCD of just one number?
Mathematically, the GCD of a single number is the number itself, because nothing larger can divide it. So the GCD of 24 alone is 24. Same goes for LCM. The tool accepts a single input and returns this gracefully instead of throwing an error.
▶What is the GCD if one of the numbers is 0?
By convention, the GCD of any number n and 0 is n itself, since every number divides 0. So GCD of 0 and 12 is 12. The LCM of 0 with anything is taken as 0 here. This matches how most Indian school textbooks and competitive-exam keys handle the edge case.
▶GCD versus LCM: when do I use which?
Use GCD when you want to split things into equal groups, like cutting two ribbons of 12 m and 18 m into the longest possible equal pieces : 6 m each. Use LCM for repeating cycles, like when two buses leaving every 12 and 18 minutes will meet again : every 36 minutes. Word problems usually hint clearly.
▶How does the tool compute LCM for big numbers?
It uses the relation LCM times GCD equals the product of the two numbers, and Euclid's algorithm to find the GCD quickly. So even for inputs like 1,23,456 and 7,89,012 the answer appears instantly. No prime factorisation needed by hand, which saves a lot of effort in higher-class problems.