GCF Calculator

The greatest common factor is the largest whole number that divides into all of your numbers with no remainder. It’s the number you divide by to simplify a fraction or ratio in one step.

Answer

42

GCF(84, 126)

Step by step

  1. Prime factors:
  2. 84 = 2² × 3 × 7
  3. 126 = 2 × 3² × 7
  4. Primes shared by all, at their lowest power: 2 × 3 × 7 = 42.
  5. Check with Euclid’s algorithm:
  6. 126 = 1 × 84 + 42
  7. 84 = 2 × 42 + 0
  8. The last non-zero remainder is 42.

Answer: 42

Still stuck? Ask the tutor about these steps
0/800

How it works

Prime methodproduct of shared primes at their lowest power
EuclidGCF(a, b) = GCF(b, a mod b)

For small numbers, list all factors of each and pick the largest one they share.

Prime factorization: write each number as primes and multiply the primes they have in common.

Euclid’s algorithm (from around 300 BC) is fastest for big numbers: divide the larger by the smaller, then divide the smaller by the remainder, and repeat until the remainder is 0.

Worked example

Find the GCF of 84 and 126.

  1. 84 = 2² × 3 × 7 · 126 = 2 × 3² × 7
  2. Shared: 2 × 3 × 7
  3. GCF = 42

Frequently asked questions

Is GCF the same as GCD and HCF?

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

What if the GCF is 1?

Then the numbers are called coprime or relatively prime — like 8 and 15. A fraction made from them is already in simplest form.