GCD (HCF) Formula Explained, With Examples

Updated 5 Oct 2026 in Math & Geometry

Every gcd (hcf) result comes from one formula. Once you understand what goes into it, you can sanity-check any figure you are given, whether by an employer, a bank, a teacher or another website.

The formula

Euclid's algorithm: gcd(a, b) = gcd(b, a mod b).

What each input means

Example

For example, with these inputs:

the calculator returns:

Why it matters

These calculations come up in school, at work and in daily life, from PSLE and O-Level practice to measuring a room for new flooring. Doing them by hand builds understanding, and a calculator lets you check the answer instantly.

In everyday life the same maths shows up in discounts, recipe scaling, renovation measurements and comparing prices per unit. Being comfortable with it saves money and avoids costly measuring mistakes.

Each formula has assumptions built in. Area formulas assume flat shapes, volume formulas assume regular solids and statistical measures assume the data you enter is the data you want to describe. Knowing the assumptions helps you pick the right tool.

A quick mental estimate before calculating is a powerful check. If a room's floor area comes out at 4,000 square metres or a percentage comes out above 100% when it should not, you know to look again.

Related calculations

Use the GCD (HCF) Calculator to plug in your own numbers.

Run your own numbers: GCD (HCF) Calculator

Related guides