An HCF calculator finds the highest common factor of two or more whole numbers: the largest number that divides all of them exactly. The same value is also called the greatest common divisor (GCD) or the greatest common factor (GCF), and all three names mean exactly the same thing. Type your numbers, press Find HCF, and this calculator gives the answer together with the prime factors of each number and the full step-by-step working, so you can check it or copy the method into your homework.
What is the HCF?
A factor of a number is a whole number that divides it with no remainder. The factors of 24 are 1, 2, 3, 4, 6, 8, 12 and 24, and the factors of 54 are 1, 2, 3, 6, 9, 18, 27 and 54. The numbers that appear in both lists are 1, 2, 3 and 6. These are the common factors, and the biggest one, 6, is the highest common factor. In symbols, this is written gcd(54, 24) = 6.
Listing every factor works well for small numbers, but it quickly becomes slow for large ones. That is why the two methods below are much more useful in practice.
How to use the HCF calculator
- Type your numbers in the box, with commas or spaces between them. You can enter up to twenty numbers.
- Press Find HCF.
- Read the answer at the top of the result panel, along with the lowest common multiple of the same numbers.
- Check the working. The panel lists the prime factors of each number and, for up to five numbers, every division in Euclid's method.
How to find the HCF by prime factorisation
Write each number as a product of prime numbers, then multiply together only the primes that all the numbers share, using the lowest power of each.
- 24 = 2³ × 3
- 54 = 2 × 3³
Both numbers contain the primes 2 and 3. The lowest power of 2 is 2¹ and the lowest power of 3 is 3¹, so the HCF is 2 × 3 = 6.
How to find the HCF with Euclid's method
The Euclidean algorithm is one of the oldest algorithms still in everyday use, first described by the Greek mathematician Euclid in his Elements around 300 BC. It relies on the fact that the HCF of two numbers doesn't change when the larger number is replaced by its remainder after dividing by the smaller one. Keep dividing until the remainder is zero, and the last divisor is the answer:
- 54 = 2 × 24 + 6
- 24 = 4 × 6 + 0
The remainder has reached zero and the last divisor was 6, so the HCF of 54 and 24 is 6. This method needs only a few divisions even for very large numbers, which is why this calculator uses it.
Finding the HCF of more than two numbers
Work through the numbers one pair at a time. Find the HCF of the first two, then find the HCF of that answer and the third number, and carry on to the end of the list. For 12, 18 and 24, the HCF of 12 and 18 is 6, and the HCF of 6 and 24 is 6, so the HCF of all three is 6.
What does an HCF of 1 mean?
If the only factor two numbers have in common is 1, they are called coprime, or relatively prime. For example, 9 and 28 are coprime even though neither of them is a prime number. A fraction whose top and bottom are coprime is already in its simplest form.
Where the HCF is useful
- Simplifying fractions. Divide the top and bottom by their HCF: 24/54 becomes 4/9 after dividing both by 6.
- Simplifying ratios, in exactly the same way.
- Tiling and cutting. A rectangle measuring 24 by 60 can be covered exactly by square tiles of side 12, the HCF of 24 and 60, and no larger square will fit evenly.
- Sharing things equally. The HCF tells you the largest group size that divides two or more quantities with nothing left over.
HCF and LCM together
The HCF and the lowest common multiple are closely linked. For any two positive whole numbers, the HCF multiplied by the LCM equals the product of the two numbers. Since 54 × 24 = 1,296 and the HCF is 6, the LCM must be 1,296 ÷ 6 = 216. This shortcut only works for two numbers at a time, so don't apply it directly to a longer list.
Common mistakes
- Mixing up the HCF and the LCM. The HCF can never be larger than the smallest number in your list, while the LCM can never be smaller than the largest.
- Using the highest power of a prime. For the HCF you need the lowest power that appears in every number.
- Forgetting a prime that is missing from one number. It can't be part of the HCF, because it isn't common to all of them.
- Typing commas inside a number. Enter 1000, not 1,000, because the calculator treats a comma as a separator.
How to check your answer
Two quick tests will catch almost any slip. First, divide each of your numbers by the HCF: every division must come out exactly. Second, look at the results of those divisions, because they should share no common factor other than 1. For 54 and 24, dividing by 6 gives 9 and 4, and those two have nothing in common, so 6 really is the highest. If the results still share a factor, your answer is too small.
Related math tools
Use the fraction calculator to work with fractions, simplify a ratio with the ratio calculator, and find an average with the average calculator. To find the smallest shared multiple instead, use the LCM calculator.
What next
Use this often? Add HCF / GCD to your Home screen.
Frequently asked questions
How does the HCF calculator work?
It repeats Euclid's division method on your numbers, one pair at a time, until the remainder is zero. It also lists each number's prime factors.
Are HCF, GCD and GCF the same?
Yes. Highest common factor, greatest common divisor and greatest common factor are three names for the same value.
What is the HCF of 54 and 24?
The HCF of 54 and 24 is 6, because 6 is the largest number that divides both exactly.
What does it mean if the HCF is 1?
The numbers are coprime: they share no factor other than 1. They don't have to be prime themselves.
How do I find the HCF of three numbers?
Find the HCF of the first two, then the HCF of that answer and the third number.
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.