GCD calculator (greatest common divisor)

Type two or more whole numbers to get the largest number that divides all of them with no remainder. Useful for simplifying fractions and splitting items into equal groups.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter numbers (separate with commas or spaces).
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Euclidean algorithm: gcd(a, b) = gcd(b, a mod b), repeated until the remainder is 0; then gcd(a, b, c) = gcd(gcd(a, b), c).

Example

Result: Greatest common divisor: 12; Coprime?: No.

Limits and caveats

  • Accepts whole numbers up to 10^15 and ignores minus signs.
  • Euclidean steps are shown for the first two numbers only.

Questions about this tool

Is GCD the same as GCF or HCF?

Yes. Greatest common divisor, greatest common factor and highest common factor all name the largest whole number that divides every number in the list.

How do I simplify a fraction with the GCD?

Divide the numerator and denominator by their GCD. For example gcd(48, 180) = 12, so 48/180 becomes 4/15.

What does coprime mean?

Two numbers are coprime when their GCD is 1, like 8 and 15, even if neither of them is prime.