GCF Calculator (HCF / GCD)
Find the greatest common factor of two or more numbers with prime factors and Euclid's algorithm.
Separate the numbers with commas or spaces (2 to 10 whole numbers).
How do you find the GCF (HCF) of numbers?
Multiply the prime factors that all the numbers share, each with its lowest power, or use Euclid's algorithm: divide, keep the remainder, and repeat until the remainder is 0. For 84 and 126 the GCF is 42.
Checked by the All Math Solver team · Last reviewed · How we check our answers
How to Find the GCF, HCF or GCD
Greatest common factor by prime factors and Euclid's algorithmThe greatest common factor (GCF) is the largest number that divides all the given numbers exactly. It is also called the highest common factor (HCF) in the UK and India, and the greatest common divisor (GCD) in many textbooks.
The calculator takes only the primes common to every number, with their lowest power: \(48 = 2^4 \times 3\) and \(180 = 2^2 \times 3^2 \times 5\) give \(\text{GCF} = 2^2 \times 3 = 12\). It confirms the result with Euclid's algorithm, the quickest method for large numbers. The GCF is used to simplify fractions.
How to use the GCF calculator
- Type two or more whole numbers separated by commas or spaces, for example 48, 180 (up to 10 numbers).
- Press Calculate.
- You see the prime factors of each number, the common primes with their lowest powers, the GCF, and Euclid's algorithm as a check.
Example: GCF (HCF) of 48 and 180 → 48 = 2⁴·3, 180 = 2²·3²·5, so GCF = 2²·3 = 12
Worked examples
GCF by prime factors
Question: Find the GCF (HCF) of 84 and 126
- 84 = 2² × 3 × 7 and 126 = 2 × 3² × 7.
- Take the primes they share with the lowest power: 2, 3 and 7.
- Multiply: 2 × 3 × 7.
Answer: GCF = 42
The same answer with Euclid's algorithm
Question: GCF of 84 and 126
- 126 = 1 × 84 + 42.
- 84 = 2 × 42 + 0.
- The remainder is now 0, so the last divisor is the GCF.
Answer: GCF = 42
Frequently asked questions
Are GCF, HCF and GCD the same thing?
Yes. Greatest common factor (GCF, common in the US and Canada), highest common factor (HCF, common in the UK and India) and greatest common divisor (GCD) all mean the largest number that divides every given number exactly.
How does Euclid's algorithm work?
Divide the larger number by the smaller and keep the remainder. Then divide the previous divisor by that remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCF.
What does a GCF of 1 mean?
If the GCF is 1 the numbers have no common factor other than 1. They are called co-prime or relatively prime, for example 8 and 15.
Where is the GCF used?
To simplify fractions (divide the top and bottom by their GCF), to factorise algebraic expressions, and to split things into the largest equal groups.