GCF (HCF) Calculator

The greatest common factor (GCF) is the largest number that divides two or more numbers exactly. It is also called the highest common factor (HCF) or greatest common divisor (GCD). This calculator finds it with Euclid's algorithm and checks the result with the prime factor method.

Try:

How to use the gcf (hcf) calculator

  1. Enter two or more whole numbers, separated by commas.
  2. Press Calculate.
  3. See the GCF, Euclid's algorithm steps and the prime factors.

Formula

gcd⁡(a,b)=gcd⁡(b, a mod b)\gcd(a, b) = \gcd(b,\, a \bmod b)

Worked example: 48, 180

  • Numbers: 48, 180

✓ Answer checked

1212
Step-by-step working (3 steps)
  1. Euclid's algorithm Euclid's algorithm

    Divide the larger number by the smaller and keep the remainder. Repeat until the remainder is 0.

    180=3×48+3648=1×36+1236=3×12+0\begin{gathered}180 = 3 \times 48 + 36\\48 = 1 \times 36 + 12\\36 = 3 \times 12 + 0\end{gathered}
  2. Read the answer

    The last non-zero remainder is the GCF.

    gcd⁡(48,180)=12\gcd(48, 180) = 12
  3. Prime factor method

    Take each prime that appears in every number, using its smallest power.

    48=24×3180=22×32×5\begin{gathered}48 = 2^{4} \times 3\\180 = 2^{2} \times 3^{2} \times 5\end{gathered}
Formulas used
gcd⁡(a,b)=gcd⁡(b, a mod b)\gcd(a, b) = \gcd(b,\, a \bmod b)
How this was checked
  • ✓ 12 divides every number exactly.
  • ✓ After dividing by the GCF, the numbers share no further common factor.

Frequently asked questions

What is the GCF of 48 and 180?

12. It is the largest number that divides both 48 and 180 exactly.

Are GCF, HCF and GCD the same?

Yes. They are three names for the same thing: the greatest common factor.

What does it mean if the GCF is 1?

The numbers are coprime, meaning they share no common factor other than 1.

Related calculators

Related guides