Overview
The greatest common divisor of two numbers is the largest number that divides both without a remainder. For example, the common divisors of 12 and 18 are 1, 2, 3 and 6, and the greatest is 6. The calculator works with any number of integers.
Formula
GCD(a, b) = GCD(b, a mod b); the last non-zero remainder is the greatest common divisor.
How it works
Enter the numbers
Separate them with commas or spaces.
Apply the Euclidean algorithm
Divide the numbers and repeat with the remainder.
Read the result
The GCD appears along with each number's factorization.
Worked examples
Example 1: 12 and 18
GCD(12, 18) = 6, because 6 divides both numbers without a remainder.
Example 2: 24, 36 and 60
GCD = 12.
Frequently asked questions
Can I use negative numbers?
Yes. The absolute value of each number is used because the GCD is positive.
What is the difference between GCD and LCM?
GCD is the greatest common divisor, while LCM is the least common multiple.
Can I enter more than two numbers?
Yes. Add the numbers separated by commas or spaces.
This calculator is for educational and informational purposes only and is not a substitute for professional advice.