GCF Calculator (Greatest Common Factor)

Also known as the greatest common divisor (GCD) or highest common factor (HCF). Enter two or more whole numbers separated by commas or spaces.

Find the GCF

At least two whole numbers, separated by commas or spaces.

Greatest common factor12
Numbers
24, 36, 60

Working

  1. 24 = 2³ × 3
  2. 36 = 2² × 3²
  3. 60 = 2² × 3 × 5
  4. Multiply the prime factors common to every number: GCF = 12

Two ways to find the GCF

Prime factorization: write each number as a product of primes and multiply the primes they all share, using the lowest power of each.

Euclidean algorithm: repeatedly replace the larger number by the remainder of dividing it by the smaller, until the remainder is 0. The last non-zero remainder is the GCF. This is much faster for large numbers.

gcd(a, b) = gcd(b, a mod b), and gcd(a, 0) = a

Worked example

GCF of 24, 36 and 60

  1. 24 = 2³ × 3
  2. 36 = 2² × 3²
  3. 60 = 2² × 3 × 5
  4. Shared primes at their lowest powers: 2² × 3 = 12

GCF(24, 36, 60) = 12

Euclid for 36 and 60

  1. 60 mod 36 = 24
  2. 36 mod 24 = 12
  3. 24 mod 12 = 0 → stop

GCF = 12

Where it is used

  • Reducing fractions: 36/60 ÷ 12/12 = 3/5.
  • Simplifying ratios such as 24 : 36 : 60 → 2 : 3 : 5.
  • Cutting materials into the largest equal pieces with nothing left over.