F / HCF Calculator: Find the Greatest Common Factor (Without Listing Every Factor)
First, let’s clear up the name, because it confuses a lot of people. GCF, HCF and GCD are the same thing. In the US it’s usually the greatest common factor. In the UK, Pakistan and India, most textbooks say highest common factor. And some books call it the greatest common divisor. Three names, one idea.
The idea is simple: it’s the biggest number that divides into all of your numbers exactly. For 12 and 18, that’s 6.
With small numbers you can do this in your head. With numbers like 252 and 396, not so much. That’s where a GCF / HCF calculator saves you a lot of time. Below I’ll show you how to use the free one on All Math Solver, and then the three methods it’s built on, so you can do it by hand in an exam too.
How to use the GCF / HCF calculator
- Open the GCF Calculator.
- Type your numbers, separated by commas or spaces. For example: 48, 180. You can enter anywhere from 2 to 10 whole numbers.
- Press Calculate.
You don’t just get the answer. It breaks each number into prime factors, picks out the primes they share, shows the GCF, and then checks it again using Euclid’s algorithm. So if your teacher wants a particular method, you can see it.
Method 1: List the factors
This is the method most of us learned first. It’s fine for small numbers.
Find the HCF of 18 and 24.
Factors of 18: 1, 2, 3, 6, 9, 18
Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24
The common ones are 1, 2, 3 and 6. The biggest is 6.
The problem is obvious once the numbers get bigger. Nobody wants to list every factor of 180.
Method 2: Prime factorisation
This is what the calculator does, and it’s the method most exam boards like to see.
Break each number into primes. Then take only the primes that appear in every number, using the lowest power of each.
Find the GCF of 48 and 180.
48 = 2 × 2 × 2 × 2 × 3 = 2⁴ × 3
180 = 2 × 2 × 3 × 3 × 5 = 2² × 3² × 5
Which primes are in both? 2 and 3. The 5 only appears in 180, so it’s out.
The lowest power of 2 is 2². The lowest power of 3 is 3¹.
GCF = 2² × 3 = 12
Why the lowest power? Because 48 only has four 2s and 180 only has two. Whatever divides both of them can’t use more 2s than the one with fewer.
Method 3: Euclid’s algorithm
This one feels a bit like a trick the first time you see it, but it’s the fastest way for big numbers. It’s over 2,000 years old and it’s still what computers use.
Divide the bigger number by the smaller one and keep the remainder. Then divide the smaller number by that remainder. Keep going until the remainder is zero. The last number you divided by is the GCF.
Same example, 48 and 180.
180 ÷ 48 = 3, remainder 36
48 ÷ 36 = 1, remainder 12
36 ÷ 12 = 3, remainder 0
The remainder hit zero when we divided by 12, so the GCF is 12. Same answer, no prime factors needed.
More than two numbers
The prime method works for as many numbers as you like. The calculator takes up to 10.
Find the HCF of 24, 36 and 60.
24 = 2³ × 3
36 = 2² × 3²
60 = 2² × 3 × 5
Primes in all three: 2 and 3. Lowest powers: 2² and 3¹. So the HCF is 4 × 3 = 12.
Where you actually use the GCF
Simplifying fractions
This is the big one. Divide the top and bottom by their GCF and the fraction is fully simplified in one go.
48/180: the GCF is 12. 48 ÷ 12 = 4 and 180 ÷ 12 = 15. So 48/180 = 4/15. No need to keep halving and halving.
Splitting things into equal groups
A florist has 18 red roses and 24 white roses. She wants to make identical bouquets using all of them. What’s the most bouquets she can make?
That’s the HCF of 18 and 24, which is 6. Each bouquet gets 3 red and 4 white.
Cutting into equal lengths
You have two ribbons, 84 cm and 126 cm long. You want to cut both into pieces of the same length, as long as possible, with nothing left over.
84 = 2² × 3 × 7 and 126 = 2 × 3² × 7. Common primes with lowest powers: 2 × 3 × 7 = 42 cm. You’d get 2 pieces from the first ribbon and 3 from the second.
GCF vs LCM: don’t mix them up
They sound similar and use the same prime factors, so students swap them all the time.
| GCF / HCF | LCM | |
|---|---|---|
| What it is | Biggest number that divides into all of them | Smallest number they all divide into |
| Size | Never bigger than your smallest number | Never smaller than your biggest number |
| Prime method | Common primes only, lowest powers | All primes, highest powers |
| Example (12 and 18) | 6 | 36 |
| Used for | Simplifying fractions, equal groups | Adding fractions, things that repeat |
A handy check for two numbers: GCF × LCM = the two numbers multiplied together. For 12 and 18: 6 × 36 = 216, and 12 × 18 = 216. It works every time.
Need the other one? The LCM Calculator works the same way. And if you’re adding fractions, our guide to the fractions LCM calculator walks you through it.
Common mistakes
Taking the highest powers instead of the lowest. That gives you the LCM, not the GCF. If your answer is bigger than one of your numbers, something’s gone wrong.
Including a prime that isn’t in every number. In the 48 and 180 example, the 5 has to go because 48 doesn’t have one.
Stopping too early in Euclid’s algorithm. Keep going until the remainder is actually zero.
Forgetting that the answer can be 1. If two numbers share no prime factors, like 8 and 15, their GCF is 1. That’s a perfectly good answer. It means the numbers are coprime.
Questions people ask
Are GCF, HCF and GCD the same? Yes. They’re three names for the same thing. Which one you use mostly depends on your country and textbook.
What does a GCF of 1 mean? The numbers share no common factor except 1. They’re called coprime, or relatively prime. 8 and 15 are an example.
Can the GCF be bigger than the numbers? No. It can’t be bigger than the smallest number in your list. If one number divides all the others, it is the GCF.
How many numbers can I put into the calculator? Between 2 and 10 whole numbers, separated by commas or spaces.
Which method is best? Listing factors for small numbers, prime factorisation when your teacher wants to see working, and Euclid’s algorithm for big numbers.
Give it a go
Try one by hand first, maybe the HCF of 84 and 126 from above. Then put it into the free GCF / HCF calculator and check your prime factors against the steps. Once you’ve done a few, you’ll spot common factors without even thinking about it.
