GCF Calculator
Find the greatest common factor (also called HCF or GCD) of two or more numbers, with three worked methods.
Enter two or more numbers
Greatest common factor
Loading calculator…
The greatest common factor of a set of numbers is the largest whole number that divides every one of them exactly. For example, the GCF of 48 and 60 is 12. This calculator handles two to five numbers and shows the full working for all three standard methods, so you can check your own answer step by step. To see every shared factor rather than just the largest, use the common factors calculator.
GCF, HCF, and GCD — the same thing
These three names describe an identical idea and are used interchangeably around the world:
- GCF — greatest common factor (common in the US)
- HCF — highest common factor (common in the UK, India, and Pakistan)
- GCD — greatest common divisor (common in mathematics and computer science)
Whichever term your textbook uses, the calculation is the same, and this calculator handles all of them.
Method 1 — Listing factors
The most intuitive method: write out all factors of each number and find the largest one they share.
Worked example — GCF of 24 and 36:
- Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24
- Factors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36
- Shared factors: 1, 2, 3, 4, 6, 12
The largest shared factor is 12, so GCF(24, 36) = 12.
This method is clear for small numbers but slow for large ones — you can use the factor calculator to list factors quickly.
Method 2 — Prime factorization
Break each number into primes, then take the lowest power of every prime that appears in all of them.
Worked example — GCF of 48 and 60:
- 48 = 2⁴ × 3
- 60 = 2² × 3 × 5
- Shared primes: 2 (lowest power 2²) and 3 (lowest power 3¹)
GCF = 2² × 3 = 12. The prime 5 is excluded because it appears only in 60.
You can factorize any number with the prime factorization calculator.
Method 3 — The Euclidean algorithm
The fastest method, and the one computers use. Divide the larger number by the smaller, keep the remainder, and repeat until the remainder is 0.
Worked example — GCF of 1071 and 462:
- 1071 = 462 × 2 + 147
- 462 = 147 × 3 + 21
- 147 = 21 × 7 + 0
The last non-zero divisor is 21, so GCF(1071, 462) = 21. Notice this took only three steps, while listing all factors of 1071 would take far longer.
The GCF and LCM relationship
For any two numbers, the GCF and the LCM are connected by a simple identity:
GCF(a, b) × LCM(a, b) = a × b
For 48 and 60: GCF is 12, LCM is 240, and 12 × 240 = 2880 = 48 × 60. This means once you know one, you can compute the other instantly.
Where the GCF is used
- Simplifying fractions: divide numerator and denominator by their GCF. 18/24 ÷ 6 = 3/4.
- Equal grouping: with 48 pens and 60 pencils, the GCF of 12 tells you the largest number of identical kits you can make — 4 pens and 5 pencils each.
- Algebra: factoring out the greatest common factor is the first step in simplifying most polynomial expressions.
- Ratios: reducing a ratio to simplest form means dividing both parts by their GCF.