šŸ”¢ Math

šŸ“ šŸ“ HCF Calculator: How to Find Highest Common Factor (GCD)

Learn how to find the Highest Common Factor (HCF) or GCD using prime factorization and the Euclidean algorithm. Covers methods, worked examples, and real-world applications.

⏱️ 8 min read🦉 365tool.net🌍 For everyone worldwide

The Highest Common Factor (HCF) — also called the Greatest Common Divisor (GCD) or Greatest Common Factor (GCF) — is the largest number that divides two or more given numbers without leaving a remainder. It is essential for simplifying fractions, solving ratio problems, and a wide range of number theory applications. The Euclidean algorithm for finding the GCD is one of the oldest algorithms in mathematics, dating back over 2,300 years.

What is HCF/GCD?

The HCF of two numbers is the largest factor common to both.

  • Factors of 12: 1, 2, 3, 4, 6, 12
  • Factors of 18: 1, 2, 3, 6, 9, 18
  • Common factors: 1, 2, 3, 6
  • HCF(12, 18) = 6 — the largest common factor

Method 1: Prime Factorization

Step 1: Find the prime factorization of each number.
Step 2: Identify prime factors that appear in ALL numbers.
Step 3: Take the LOWEST power of each common prime.
Step 4: Multiply these together.

Example: HCF(36, 48)

  • 36 = 2² Ɨ 3²
  • 48 = 2⁓ Ɨ 3
  • Common primes: 2 (lowest power: 2²) and 3 (lowest power: 3¹)
  • HCF = 2² Ɨ 3 = 4 Ɨ 3 = 12

Verify: 36 Ć· 12 = 3 āœ“ and 48 Ć· 12 = 4 āœ“ — both divide evenly.

Example: HCF(60, 84, 108)

  • 60 = 2² Ɨ 3 Ɨ 5
  • 84 = 2² Ɨ 3 Ɨ 7
  • 108 = 2² Ɨ 3³
  • Common to ALL: 2² and 3¹ (3 appears in all but lowest power is 3¹)
  • HCF = 4 Ɨ 3 = 12

Method 2: The Euclidean Algorithm (Most Efficient)

The Euclidean algorithm is the fastest method for finding GCD, particularly for large numbers. The key insight: GCD(a, b) = GCD(b, a mod b).

Algorithm: Divide the larger by the smaller; replace the larger with the smaller, and the smaller with the remainder. Repeat until the remainder is 0 — the last non-zero divisor is the GCD.

Example: GCD(252, 105)

  • 252 Ć· 105 = 2 remainder 42 → now find GCD(105, 42)
  • 105 Ć· 42 = 2 remainder 21 → now find GCD(42, 21)
  • 42 Ć· 21 = 2 remainder 0 → GCD = 21

Verify: 252 Ć· 21 = 12 āœ“ and 105 Ć· 21 = 5 āœ“

Example: GCD(48, 18)

  • 48 Ć· 18 = 2 remainder 12
  • 18 Ć· 12 = 1 remainder 6
  • 12 Ć· 6 = 2 remainder 0 → GCD = 6

Method 3: Division Method (Suitable for Exams)

Divide both numbers by their smallest common prime factor, then continue until the results share no common factor:

HCF(24, 36):

  • Both divisible by 2: 24→12, 36→18
  • Both divisible by 2: 12→6, 18→9
  • Both divisible by 3: 6→2, 9→3
  • 2 and 3 share no common factor → stop
  • HCF = 2 Ɨ 2 Ɨ 3 = 12

Real-World Applications

Simplifying Fractions

Divide both numerator and denominator by their GCD to simplify:

36/48: GCD(36, 48) = 12 → 36/12 = 3, 48/12 = 4 → 3/4

Dividing into Equal Groups

You have 48 apples and 72 oranges to pack into identical baskets, with each basket containing the same number of each fruit. What is the maximum number of baskets?

GCD(48, 72) = 24 → 24 baskets, each with 2 apples and 3 oranges

Tiling Problems

A floor measuring 180 cm Ɨ 252 cm is to be tiled with identical square tiles (no cutting). The largest tile size = GCD(180, 252) = 36 cm.

Gear Design

GCD is used in gear ratio design to find the simplest ratio between two gears and identify how many rotations before they return to their starting alignment.

Key Properties of HCF/GCD

  • HCF(a, b) Ɨ LCM(a, b) = a Ɨ b (valid for two numbers)
  • HCF(a, b) = HCF(b, a mod b) — basis of Euclidean algorithm
  • HCF of co-prime numbers = 1: HCF(9, 25) = 1
  • HCF of a number with itself = the number: HCF(15, 15) = 15
  • HCF is always ≤ the smallest of the given numbers

Try It Yourself! ✨

Use our free HCF / GCD Calculator — results appear as you type. No sign-up needed!

🚀 Open HCF / GCD Calculator Free

❓ Frequently Asked Questions

What is HCF (Highest Common Factor)?
HCF, also called GCD (Greatest Common Divisor), is the largest number that divides all the given numbers without a remainder. HCF(12, 18) = 6 because 6 is the largest number that divides both 12 and 18 exactly. Common factors of 12 and 18 are 1, 2, 3, and 6 — the highest is 6.
How do you find HCF using prime factorization?
Factor each number into primes. For HCF, take only the prime factors common to ALL numbers, using the lowest power each appears. HCF(36, 48): 36=2²×3², 48=2⁓×3. Common primes: 2 (lowest power 2²) and 3 (lowest power 3¹). HCF = 2²×3 = 12. For LCM, use the highest power instead.
What is the Euclidean algorithm for GCD?
Divide the larger number by the smaller, then replace the larger with the smaller and the smaller with the remainder. Repeat until remainder = 0; the last non-zero number is the GCD. GCD(252, 105): 252Ć·105=2 r42 → 105Ć·42=2 r21 → 42Ć·21=2 r0 → GCD=21. This ancient algorithm is the most efficient method for large numbers.
What is the relationship between HCF and LCM?
For two numbers a and b: HCF(a,b) Ɨ LCM(a,b) = a Ɨ b. This lets you find one from the other: if HCF(a,b)=4 and LCM=48, then aƗb = 4Ɨ48 = 192. This shortcut works only for two numbers — it doesn't generalize to three or more numbers.
How is HCF used in real life?
HCF is used to simplify fractions (divide numerator and denominator by their GCD), divide items into equal groups without leftovers (packing problems), find the largest tile size for floor tiling, determine gear ratios in engineering, and solve "equal sharing" problems in scheduling and distribution.