Free · No sign-up · Private
GCD Calculator
Find the greatest common divisor of two or more integers.
Quick answer
The greatest common divisor is the largest whole number that divides all the given numbers exactly. The GCD of 48, 180 and 72 is 12. The calculator uses the Euclidean algorithm: replace the larger number by the remainder of dividing it by the smaller one until the remainder is 0.
Step by step
How to use the GCD Calculator
01
Enter two or more integers.
02
See their greatest common divisor.
Formula
GCD via the Euclidean algorithmWorked examples
GCD examples
| Numbers | GCD |
|---|---|
| 12, 18 | 6 |
| 48, 180 | 12 |
| 84, 126 | 42 |
| 17, 31 | 1 |
| 270, 192 | 6 |
Good to know
The Euclidean algorithm step by step
For 180 and 48: 180 ÷ 48 leaves 36; 48 ÷ 36 leaves 12; 36 ÷ 12 leaves 0. The last non-zero remainder, 12, is the GCD. It needs only a few steps even for very large numbers.
Where the GCD is used
Simplifying fractions (divide the top and bottom by their GCD), cutting materials into equal pieces with no waste, and finding the least common multiple, since LCM(a, b) = a × b ÷ GCD(a, b).
Finding the GCD by prime factors
Write each number as a product of primes and keep only the primes they share, at the lowest power. 48 = 2⁴ × 3 and 180 = 2² × 3² × 5, so their GCD is 2² × 3 = 12. For large numbers the Euclidean algorithm is much faster, which is why the calculator uses it.
FAQ
Frequently asked questions
Are GCD, GCF and HCF the same?
Yes. Greatest common divisor, greatest common factor and highest common factor are three names for the same number.
What if the numbers share no factor?
Their GCD is 1 and they are called coprime, like 17 and 31.
More math tools
Related tools
LCM Calculator
Find the least common multiple of two or more integers.
Open toolBasic Calculator
A simple calculator for addition, subtraction, multiplication and division.
Open toolScientific Calculator
Evaluate expressions with powers, roots, trigonometry, logarithms and constants.
Open toolFraction Calculator
Add, subtract, multiply and divide fractions and simplify the result.
Open tool