How gcd calculator works
The greatest common divisor (GCD), also called the greatest common factor (GCF) or highest common factor (HCF), is the largest positive integer that divides all the given numbers without a remainder. For example, the GCD of 24 and 36 is 12, because 12 is the largest number that divides both.
This calculator uses the Euclidean algorithm, which repeatedly divides the larger number by the smaller and takes the remainder until the remainder is zero. The last non-zero remainder is the GCD. For multiple numbers, it reduces them pairwise.
Enter two or more integers (comma-separated). The calculator finds the GCD of all of them. Only integers are accepted; decimal numbers are rejected.
Frequently asked questions
What is the GCD?
The greatest common divisor (GCD) is the largest positive integer that divides all given numbers without a remainder. For example, GCD(24, 36) = 12 because 12 is the largest number dividing both 24 and 36.
How is the GCD calculated?
The calculator uses the Euclidean algorithm: repeatedly divide the larger number by the smaller, take the remainder, and repeat until the remainder is zero. The last non-zero remainder is the GCD.
Can I find the GCD of more than two numbers?
Yes. Enter a comma-separated list of integers and the calculator finds the GCD of all of them by reducing them pairwise.
What is the difference between GCD and LCM?
GCD is the largest number that divides all inputs. LCM (least common multiple) is the smallest number that all inputs divide into. GCD(12, 18) = 6, while LCM(12, 18) = 36.