GCF Calculator (Greatest Common Factor)

Quick answerThe greatest common factor (GCF), also called the GCD or HCF, is the largest number that divides all of your numbers with no remainder. List the prime factors, keep the ones shared by every number and multiply them. The GCF of 8 and 12 is 4.

Enter 2 to 6 whole numbers, for example 48, 36, 60.

GCF(8, 12) = 4

  • LCM: 24
  • Coprime: no
Prime factors of 8 and 12; shared factors give GCF 42223812Shared primes multiply: GCF = 4

Step-by-step solution

  1. Prime factorisation of 8: 23.
  2. Prime factorisation of 12: 22 × 3.
  3. Common prime factors, each at its lowest power: 22.
  4. Multiply the shared factors: 4.
  5. Euclid check: GCF × LCM = 4 × 24 = 96 = 8 × 12.

Example shown: the default numbers above. Change them and press Calculate.

What you get when you use this calculator

Every result includes the answer, a picture of what the answer means and the full working, so you can check the method as well as the number.

What you get from the GCF Calculator. Two or more whole numbers → Shared prime factors → The GCF with a Venn diagramWhat you get from the GCF CalculatorYOU ENTERTwo or more wholenumbersTHE CALCULATORShared prime factorsYOU GETThe GCF with a Venndiagram

How to use the GCF Calculator

  1. Type your numbers into the boxes above.
  2. Press Calculate (or hit Enter).
  3. Read the highlighted answer, check the picture, then follow the numbered steps to see how it was found.
  4. Use Copy answer to paste the result into your homework or notes.

Formula and method

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

Worked examples

Example 1: 8, 12

GCF(8, 12) = 4

  1. Prime factorisation of 8: 23.
  2. Prime factorisation of 12: 22 × 3.
  3. Common prime factors, each at its lowest power: 22.
  4. Multiply the shared factors: 4.
  5. Euclid check: GCF × LCM = 4 × 24 = 96 = 8 × 12.

Example 2: 48, 36, 60

GCF(48, 36, 60) = 12

  1. Prime factorisation of 48: 24 × 3.
  2. Prime factorisation of 36: 22 × 32.
  3. Prime factorisation of 60: 22 × 3 × 5.
  4. Common prime factors, each at its lowest power: 22, 3.
  5. Multiply the shared factors: 12.

Example 3: 84, 126

GCF(84, 126) = 42

Show the steps
  1. Prime factorisation of 84: 22 × 3 × 7.
  2. Prime factorisation of 126: 2 × 32 × 7.
  3. Common prime factors, each at its lowest power: 2, 3, 7.
  4. Multiply the shared factors: 42.
  5. Euclid check: GCF × LCM = 42 × 252 = 10,584 = 84 × 126.

Example 4: 17, 31

GCF(17, 31) = 1

Show the steps
  1. Prime factorisation of 17: 17.
  2. Prime factorisation of 31: 31.
  3. The numbers share no prime factors.
  4. Multiply the shared factors: 1.
  5. Euclid check: GCF × LCM = 1 × 527 = 527 = 17 × 31.

Practice problems

Try each one on paper first, then open the answer.

Problem 1: 18, 24

GCF(18, 24) = 6

Problem 2: 45, 75

GCF(45, 75) = 15

Problem 3: 56, 98

GCF(56, 98) = 14

Problem 4: 100, 150, 250

GCF(100, 150, 250) = 50

Frequently asked questions

Are GCF, GCD and HCF the same thing?

Yes. Greatest common factor, greatest common divisor and highest common factor all mean the same number.

What is the GCF of two prime numbers?

It is 1, because two different primes share no factors other than 1.

How is the GCF used with fractions?

Divide the numerator and denominator by their GCF to reduce a fraction to lowest terms.

Learn the method

Related calculators

Calculators are for learning and general use. If a result matters (an exam, a build, a purchase), double-check it. Read the disclaimer.