Skip to content
    Arithmetic

    How to Find the HCF (GCD) of Two Numbers

    You've got 36 chocolate bars and 24 candies and want identical gift bags with nothing left over — what's the biggest number of bags you can make? That's exactly what the HCF finds, and this guide shows the fast way to get it.

    Math Solver Academic Editorial Board4 min read

    Key takeaways

    • HCF(a, b) is the largest number that divides both a and b exactly.
    • HCF and GCD mean the same thing — just different names in different countries.
    • The Euclidean algorithm finds it fast: keep dividing and swapping until the remainder is 0.
    • Two numbers with HCF = 1 are called coprime.
    In this guide
    1. 01What is the HCF (GCD)?
    2. 02Why does the HCF matter?
    3. 03The method (Euclidean algorithm)
    4. 04How to find the HCF step by step
    5. 05Common mistakes to avoid
    6. 06Tips and tricks
    7. 07Where you'll use it in real life
    8. 08Quick summary
    9. 09Worked example
    10. 10Frequently asked questions

    What is the HCF (GCD)?

    HCF stands for Highest Common Factor, also known as GCD (Greatest Common Divisor). It's the biggest number that divides both of your two numbers without leaving a remainder.

    Why does the HCF matter?

    The HCF lets you split things into the largest possible equal groups with nothing wasted. It's also the key step in reducing a fraction or ratio to its simplest form.

    HCF(9, 16) = 1, even though neither number is prime. Numbers like these, which share no factor bigger than 1, are called coprime.

    The method (Euclidean algorithm)

    HCF(a, b) = largest number that divides both a and b exactly
    SymbolWhat it meansExample
    aThe first number36
    bThe second number24
    HCF(a, b)The greatest common divisor of a and b12

    How to find the HCF step by step

    1. 1Divide the larger number by the smaller number and note the remainder.
    2. 2Replace the larger number with the smaller number, and the smaller number with the remainder.
    3. 3Repeat the division until the remainder becomes 0.
    4. 4The last non-zero remainder (the divisor at that final step) is the HCF.

    Enter your own two numbers in the calculator below to see every division step.

    Try it yourself

    Pre-filled with the example — change any value.

    🧮
    Arithmetic
    Middle School

    HCF / GCD Calculator

    Find the Highest Common Factor (Greatest Common Divisor) of two numbers

    HCF(a, b) = largest number dividing both a and b

    a = 36Active Variable
    Dynamic Formula Model
    1144
    154

    💡 Example

    Reference
    Inputs:a=48, b=18
    Result:6
    Open the full HCF / GCD Calculator calculator

    Common mistakes to avoid

    • Confusing HCF with LCM. HCF is the largest number that divides both numbers; LCM is the smallest number both numbers divide into.
    • Listing all factors for large numbers. This works for small numbers, but the Euclidean algorithm above is much faster for bigger ones.
    • Swapping the wrong numbers. In each round, the old divisor becomes the new dividend, and the remainder becomes the new divisor.

    Tips and tricks

    • For small numbers, listing factors of each and picking the biggest shared one works fine and can be quicker to see.
    • Check your answer by dividing both original numbers by your HCF — both results should be whole numbers.
    • The HCF is exactly what you need to simplify a fraction or reduce a ratio to lowest terms.

    Where you'll use it in real life

    • Party planning: making identical gift bags or teams using everything you have, with nothing left over.
    • Cooking: finding the largest batch size that uses whole amounts of every ingredient.
    • Math class: simplifying fractions and ratios to their lowest terms.
    • Scheduling: working alongside the LCM to plan events that repeat on different cycles.

    Quick summary

    To find the HCF of two numbers, use the Euclidean algorithm: repeatedly divide and swap until the remainder hits 0 — that last divisor is your answer. It's the largest number that splits both original numbers evenly. Try the calculator above with your own two numbers.

    Worked example

    You have 36 chocolate bars and 24 candies, and want to make identical gift bags using all of them with nothing left over. What's the largest number of gift bags you can make?

    1. 01HCF(36, 24) using the Euclidean algorithm
    2. 0236 = 1 × 24 + 12
    3. 0324 = 2 × 12 + 0
    4. 04Remainder is 0, so HCF = 12

    These numbers are pre-filled in the calculator above.

    Frequently asked questions

    What is the difference between HCF and GCD?

    They're the same thing — HCF (Highest Common Factor) is the term used in the UK and India, while GCD (Greatest Common Divisor) is more common in the US.

    What is the fastest way to find the HCF of two numbers?

    Use the Euclidean algorithm: repeatedly divide the larger number by the smaller one and replace the larger number with the remainder, until the remainder reaches 0.

    What is the HCF of two numbers that share no common factor besides 1?

    Their HCF is 1. For example, HCF(9, 16) = 1, because no number bigger than 1 divides both evenly. These are called coprime numbers.

    Can the HCF of two numbers be one of the numbers itself?

    Yes, whenever one number divides evenly into the other. For example, HCF(6, 18) = 6, because 6 divides both 6 and 18 exactly.

    #Arithmetic#Middle School#HCF / GCD Calculator
    Updated

    Sponsored ToolsAd

    More tools on Ytools →
    Calcu.click — 25+ Free Smart Calculators preview

    Calcu.click — 25+ Free Smart Calculators

    Brand new calculation platform with 0ms reactive math, 100% client-side privacy, and dedicated subdomains. Fast calculators for EMI, SIP, Mortgage, Income Tax, BMI, Age, Percentage, and more.

    25+ CalculatorsFinanceHealth0ms Real-TimeFree
    Keyboard Arena preview

    Keyboard Arena

    Master touch typing with real-time WPM speed tests, mechanical switch audio, A-Z finger biomechanics drills, 40+ structured lessons, and competitive arcade games.

    Typing TestWPMTouch Typing
    Flutter Log Explorer preview

    Flutter Log Explorer

    Real-time structured log viewer and search explorer for Flutter & Dart. Zero-config capture from Debug Adapter (DAP) & Dart VM Service with smart classification and filters.

    FlutterDartVS Code ExtensionOpen VSX