Skip to content
AllCalcHub

GCF Calculator

Find the greatest common factor (GCF, also called HCF or GCD) of two or more whole numbers, with prime-factor working.

About the GCF Calculator

The greatest common factor is the largest whole number that divides every number in the set without a remainder. It's used to simplify fractions and to split things into equal groups.

Two methods give the same answer: list the shared prime factors (shown below), or use Euclid's algorithm, which repeatedly replaces the larger number with the remainder of dividing it by the smaller.

The formula

GCF(a, b) = GCF(b, a mod b), until the remainder is 0

a mod b
remainder when a is divided by b

For two numbers, GCF × LCM = a × b.

Worked example

GCF of 24 and 36

  1. 24 = 2³ × 3
  2. 36 = 2² × 3²
  3. Shared: 2² × 3 = 12

Questions people ask

Is GCF the same as HCF and GCD?

Yes. Highest common factor and greatest common divisor are other names for it.

What is the GCF of numbers with no common factors?

It's 1, and the numbers are called co-prime (or relatively prime).