GCD Calculator

Find the greatest common divisor (also called GCF or HCF) of two or more numbers with full Euclidean algorithm steps. Free, instant and private — everything is computed in your browser.

Whole numbers only, up to 1000 digits each. Negative numbers are treated by their absolute value.

How to use the GCD calculator

  1. Enter your numbers. Type two or more whole numbers into the box, separated by commas, spaces or new lines — for example 48, 180, 36.
  2. Read the GCD instantly. The greatest common divisor appears as soon as you type, along with a note when your numbers are coprime.
  3. Follow the steps. The Euclidean algorithm working is shown line by line, so you can copy the result or use the steps in your homework.

About this tool

The greatest common divisor (GCD) — also known as the greatest common factor (GCF) or highest common factor (HCF) — is the largest whole number that divides all of your numbers without a remainder. This free GCD calculator uses the classic Euclidean algorithm, repeatedly replacing the larger number by the remainder of the division until the remainder is zero. For more than two numbers it applies the identity gcd(a, b, c) = gcd(gcd(a, b), c). It handles arbitrarily large integers exactly (up to 1000 digits) thanks to big-integer arithmetic, so there is no rounding and no overflow.

Common uses include simplifying fractions (divide numerator and denominator by their GCD — see the fraction simplifier), finding common tile or box sizes, and computing the least common multiple via the LCM calculator. All calculations run locally in your browser — nothing you type is uploaded, stored or logged.

Frequently asked questions

Are GCD, GCF and HCF the same thing?

Yes. Greatest common divisor (GCD), greatest common factor (GCF) and highest common factor (HCF) are three names for exactly the same value: the largest integer that divides all the given numbers evenly.

How does the Euclidean algorithm work?

To find gcd(a, b) with a ≥ b, divide a by b and keep the remainder r. Since any common divisor of a and b also divides r, gcd(a, b) = gcd(b, r). Repeat until the remainder is 0 — the last non-zero remainder is the GCD. It converges very quickly even for numbers hundreds of digits long.

What is the GCD when one of the numbers is 0?

Every integer divides 0, so gcd(n, 0) = |n|. If all the numbers you enter are 0, the GCD is defined to be 0, since there is no largest divisor of zero.

What does it mean if the GCD is 1?

The numbers are called coprime (or relatively prime): they share no common factor greater than 1. For example, 8 and 15 are coprime even though neither of them is a prime number.