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.

GCD CalculatorRuns in your browser
GCD
12

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 algorithm

Worked examples

GCD examples

NumbersGCD
12, 186
48, 18012
84, 12642
17, 311
270, 1926

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.