Greatest Common Factor Calculator

The greatest common factor is the largest whole number that divides every number in the list. Euclid’s algorithm finds it by repeated division with remainder.

Also called: GCD calculator · HCF calculator · Greatest common divisor calculator · Highest common factor calculator

  • Last updated
  • Formula tested against reference values

Your numbers

Two or more whole numbers, separated by commas or spaces.

Result

Greatest common factor
—

Calculating…

GCF as prime factors
—
Coprime?
—
Full table

How to use this calculator

  1. Enter or choose whole numbers.
  2. The greatest common factor updates as you type. Use Copy result or Share to keep it.

Method

gcd(a, b) = gcd(b, a mod b), repeated until the remainder is 0; gcd(a, b, c) = gcd(gcd(a, b), c)

a mod b
the remainder when a is divided by b

Worked example

  1. 180 = 3 × 48 + 36.
  2. 48 = 1 × 36 + 12.
  3. 36 = 3 × 12 + 0, so the last non-zero remainder, 12, is the GCF.

The greatest common factor of 48 and 180 is 12.

What the result means

Divide the numerator and denominator of a fraction by their GCF to reduce it in one step: 48/180 = 4/15. A GCF of 1 means the numbers are coprime.

Assumptions and limits

  • Whole numbers between −10¹⁵ and 10¹⁵; signs are ignored.

Questions

Are GCF, GCD and HCF the same?

Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number.

What is the GCF of 0 and a number?

Every number divides 0, so gcd(0, n) = |n|.