GCD LCM Calculator: Two Numbers, Two Useful Answers
The GCD is the largest number that divides both numbers cleanly, and the LCM is the smallest number both divide into. Together they simplify fractions and line up repeating cycles.
What is the GCD LCM Calculator?
Enter two whole numbers and the tool finds their greatest common divisor with Euclid's algorithm, then works out the least common multiple from it. The two are linked: the LCM equals the product of the numbers divided by their GCD.
How to use it
- Enter the first number.
- Enter the second number.
- Click Calculate GCD and LCM.
Worked example
For 12 and 18, the greatest common divisor is 6 and the least common multiple is 36, and 6 times 36 equals 12 times 18, which is 216.
What is Euclid's algorithm?
A fast way to find the GCD: repeatedly replace the pair with the smaller number and the remainder, until the remainder is zero.
Frequently asked questions
Why do GCD and LCM multiply to the product?
Because every shared factor is counted once in the GCD and the rest in the LCM, so their product rebuilds the original product.
Can this handle zero?
No. Both numbers must be non-zero whole numbers for the GCD and LCM to make sense here.