HCF Calculator

Find the highest common factor of two numbers, also called the GCF or GCD. You get the common factors, both prime factorizations and the working.

Examples:24, 3648, 18084, 12617, 31

HCF(48, 180) = 12

Common factors

1, 2, 3, 4, 6, 12

Prime factorizations

48 = 243

180 = 22325

Euclidean algorithm

  1. 180 = 3 × 48 + 36
  2. 48 = 1 × 36 + 12
  3. 36 = 3 × 12 + 0

The last non-zero remainder is the HCF.

What Is the Highest Common Factor (HCF)?

The highest common factor of two numbers is the biggest whole number that divides both of them exactly. Take 36 and 60. The factors of 36 are 1, 2, 3, 4, 6, 9, 12, 18 and 36. The factors of 60 are 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 and 60. They share 1, 2, 3, 4, 6 and 12, and the biggest is 12. So HCF(36, 60) = 12.

HCF, GCF (greatest common factor) and GCD (greatest common divisor) are three names for the same number. HCF is the word used in the UK, India and many other countries, so if your book says HCF, this is the right page.

How to Use This HCF Calculator

  1. Enter two numbers in the First number and Second number boxes.
  2. Press Calculate, or hit Enter.
  3. You get the HCF, the LCM, the prime factorization of each number, the common factors and the division steps.

Method 1: HCF by the Division Method

This is the method most Indian and UK textbooks call the long division method, and it is the best choice when the numbers are big. Divide the larger number by the smaller one. Then divide the old divisor by the remainder. Repeat until the remainder is 0. The last divisor is the HCF.

Handwritten long division for the HCF of 36 and 60: 60 divided by 36 gives 1 remainder 24, 36 divided by 24 gives 1 remainder 12, 24 divided by 12 gives 2 remainder 0, so the last divisor 12 is the HCF
60 ÷ 36 leaves 24, then 36 ÷ 24 leaves 12, then 24 ÷ 12 leaves 0. The last divisor, 12, is the HCF.

Why does it work? Anything that divides both numbers also divides the remainder, so the pair keeps the same common factors while the numbers shrink. When the remainder hits 0, the divisor you just used is what is left.

Method 2: HCF by Prime Factorization

Write each number as a product of primes. Pick the primes that appear in both, at their lowest power, and multiply them. For 36 and 60:

The shared primes are 2 and 3. The lowest power of 2 is 2², and the lowest power of 3 is 3¹. So HCF = 2² × 3 = 4 × 3 = 12. The prime 5 only appears in 60, so it stays out.

Method 3: HCF by Listing Factors

For small numbers you can simply list the factors, as we did for 36 and 60 at the top of the page, and pick the biggest one in both lists. It is the easiest method to understand, and a good way to check the other two.

How to Find the HCF of Three Numbers

Find the HCF of two of the numbers, then find the HCF of that answer and the third number. Here it is for 12, 18 and 30:

Handwritten work for the HCF of 12, 18 and 30: HCF(12, 18) = 6, then HCF(6, 30) = 6, and 12 = 6 × 2, 18 = 6 × 3, 30 = 6 × 5, so the HCF is 6
HCF(12, 18) = 6, then HCF(6, 30) = 6. After dividing by 6 you get 2, 3 and 5, which share nothing.

There is a nice way to check. Divide each number by your answer: 12 ÷ 6 = 2, 18 ÷ 6 = 3 and 30 ÷ 6 = 5. Those three results have no common factor except 1, so no bigger number could have worked.

The Link Between HCF and LCM

For any two numbers, the HCF and the LCM multiply to give the same result as the numbers themselves:

HCF × LCM = first number × second number

Check it with 36 and 60. The HCF is 12 and the LCM is 180, and 12 × 180 = 2,160, which is also 36 × 60. So if you know the HCF and one of the numbers, you can get the missing number too. This rule is only true for two numbers, not three.

HCF Word Problems

Any question that asks for the largest equal size, group or piece is an HCF question.

Cutting ropes

Two ropes are 84 cm and 126 cm long. They are cut into equal pieces that are as long as possible, with nothing left over. How long is each piece?

Handwritten word problem for two ropes of 84 cm and 126 cm: 84 = 2 squared times 3 times 7 and 126 = 2 times 3 squared times 7, HCF = 2 × 3 × 7 = 42 cm, giving 2 pieces and 3 pieces
HCF(84, 126) = 42, so the longest piece is 42 cm. That gives 2 pieces and 3 pieces.

Packing boxes

A shop has 48 apples and 36 oranges and wants identical boxes with no fruit left over. HCF(48, 36) = 12, so it can fill at most 12 boxes. Each box gets 4 apples (48 ÷ 12) and 3 oranges (36 ÷ 12).

Simplifying a fraction

To reduce 84/126, divide the top and bottom by their HCF, which is 42. You get 84 ÷ 42 = 2 and 126 ÷ 42 = 3, so 84/126 = 2/3. One step, and it is in lowest terms.

HCF Shortcuts Worth Remembering

Common HCF Mistakes to Avoid

Enter the same two numbers in the calculator above to check your answer.

HCF Calculator: FAQs

What does HCF stand for?

HCF stands for highest common factor. It is the largest whole number that divides two or more numbers exactly. For 36 and 60 the HCF is 12.

Are HCF, GCF and GCD the same?

Yes. HCF (highest common factor), GCF (greatest common factor) and GCD (greatest common divisor) are three names for the same number. Which one you use depends on your country and your textbook.

What is the HCF of 36 and 60?

It is 12. In primes, 36 = 2² × 3² and 60 = 2² × 3 × 5. The shared primes at their lowest powers are 2² and 3, and 2² × 3 = 12. With the division method: 60 ÷ 36 leaves 24, 36 ÷ 24 leaves 12, and 24 ÷ 12 leaves 0, so the last divisor is 12.

What is the HCF of two prime numbers?

It is 1, as long as the two primes are different. Two different primes share no factor other than 1. For example HCF(13, 17) = 1. Numbers like this are called coprime.

Which method is best for finding the HCF of large numbers?

The division method (long division). It only needs repeated division with remainders, so you never have to list factors or find primes. Prime factorization is a good second choice, and listing factors is best kept for small numbers.

How are the HCF and LCM related?

For two numbers, HCF × LCM = first number × second number. For 36 and 60 the HCF is 12 and the LCM is 180, and 12 × 180 = 2,160 = 36 × 60. This only works for two numbers at a time.

How do you find the HCF of three numbers?

Find the HCF of the first two, then find the HCF of that answer and the third number. For 12, 18 and 30, HCF(12, 18) = 6 and HCF(6, 30) = 6, so the answer is 6.

Can the HCF be bigger than the numbers?

No. The HCF divides every number, so it can never be bigger than the smallest one. If one number divides the other, the HCF is the smaller number, such as HCF(9, 27) = 9.