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
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
- 24 = 2³ × 3
- 36 = 2² × 3²
- 60 = 2² × 3 × 5
- Shared primes at their lowest powers: 2² × 3 = 12
GCF(24, 36, 60) = 12
Euclid for 36 and 60
- 60 mod 36 = 24
- 36 mod 24 = 12
- 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.