GCF Calculator (Greatest Common Factor)
The greatest common factor (GCF) is the largest number that divides two or more numbers exactly. It is also called the highest common factor (HCF) or greatest common divisor (GCD). This calculator finds it with Euclid's algorithm and checks the result with the prime factor method.
How to use the gcf (hcf) calculator
- Enter two or more whole numbers, separated by commas.
- Press Calculate.
- See the GCF, Euclid's algorithm steps and the prime factors.
Formula
Worked example: 48, 180
- Numbers: 48, 180
✓ Answer checked
Step-by-step working (3 steps)
Euclid's algorithm Euclid's algorithm
Divide the larger number by the smaller and keep the remainder. Repeat until the remainder is 0.
Read the answer
The last non-zero remainder is the GCF.
Prime factor method
Take each prime that appears in every number, using its smallest power.
Formulas used
How this was checked
- ✓ 12 divides every number exactly.
- ✓ After dividing by the GCF, the numbers share no further common factor.
When to use the GCF (HCF) Calculator
- Simplify fractions in one step.
- Split items into the largest equal groups, such as 24 pens and 36 pencils into identical packs.
- Factorise algebra expressions by taking out the common factor.
- Cut tiles or fabric into the largest equal squares.
Quick facts to remember
- GCF, HCF and GCD all mean the same thing.
- Euclid's method: GCF(a, b) = GCF(b, a mod b).
- If the GCF is 1, the numbers are 'coprime'.
- GCF × LCM = a × b for two numbers.
Three ways to find the GCF
1. List the factors. Write every factor of each number and pick the largest one they share. Factors of 12 are 1, 2, 3, 4, 6, 12. Factors of 18 are 1, 2, 3, 6, 9, 18. The largest shared factor is 6, so GCF(12, 18) = 6. This works well for small numbers.
2. Prime factorization. Break each number into primes and multiply the primes they have in common, using the lowest power of each. 48 = 2⁴ × 3 and 180 = 2² × 3² × 5. The shared primes are 2² and 3, so GCF = 4 × 3 = 12.
3. Euclid's algorithm. Divide the larger number by the smaller and keep the remainder, then repeat with the smaller number and the remainder until the remainder is 0. For 180 and 48: 180 = 3 × 48 + 36, then 48 = 1 × 36 + 12, then 36 = 3 × 12 + 0. The last non-zero remainder, 12, is the GCF. This is the fastest method for large numbers and the one the calculator uses.
GCF of common number pairs
| Numbers | GCF |
|---|---|
| 8 and 12 | 4 |
| 12 and 18 | 6 |
| 15 and 25 | 5 |
| 16 and 24 | 8 |
| 24 and 36 | 12 |
| 36 and 48 | 12 |
| 42 and 56 | 14 |
| 48 and 180 | 12 |
| 18, 24 and 30 | 6 |
GCF vs LCM
The GCF is the largest number that divides into all the numbers. The LCM (least common multiple) is the smallest number they all divide into. For two numbers, GCF × LCM = the product of the numbers. For 12 and 18: GCF 6 × LCM 36 = 216 = 12 × 18.
Frequently asked questions
What is the GCF of 48 and 180?
12. It is the largest number that divides both 48 and 180 exactly.
Are GCF, HCF and GCD the same?
Yes. They are three names for the same thing: the greatest common factor.
What does it mean if the GCF is 1?
The numbers are coprime, meaning they share no common factor other than 1.
What is the GCF of 12 and 18?
The GCF of 12 and 18 is 6, because 6 is the largest number that divides both exactly.
Is GCF the same as HCF and GCD?
Yes. Greatest common factor (GCF), highest common factor (HCF) and greatest common divisor (GCD) are three names for the same thing.
What if the GCF is 1?
Then the numbers are called coprime or relatively prime. They share no factor except 1, for example 8 and 15.
How do I find the GCF with variables and exponents?
Find the GCF of the numbers, then for each variable take the smallest power that appears in every term. For 12x³y² and 18x²y⁵, the GCF of 12 and 18 is 6, the smallest power of x is x² and of y is y², so the GCF is 6x²y².
What is the HCF of 24 and 36?
12. It is the largest number that divides both 24 and 36 exactly.
People also search for
gcf calculatorhcf calculatorgcd calculatorgreatest common factorgcf (hcf) calculator with stepsfree gcf (hcf) calculator online
