HCF calculator — highest common factor

Enter two or more numbers and the calculator finds their highest common factor. Beside the answer it shows the LCM and the prime factorisation.

HCF
6
LCM of these numbers72
Prime factors2 · 3

The HCF of 12, 18, 24 is 6.

Formula

NWD=a = b·q + r → NWD(b, r)

Euclid’s algorithm: divide the larger number by the smaller and repeat with the remainder until the remainder is zero.

How we got there

12, 18, 24 → 6

The HCF of two coprime numbers is 1 — they share no factor greater than one.

How to find the HCF by hand

  1. Divide the larger number by the smaller

    For 18 and 12: 18 ÷ 12 = 1 remainder 6.

  2. Repeat with the divisor and the remainder

    Now 12 ÷ 6 = 2 remainder 0.

  3. The last non-zero divisor is the HCF

    The remainder hit zero, so the HCF of 18 and 12 is 6.

  4. For more numbers, work in pairs

    HCF(12, 18, 24) is HCF(HCF(12, 18), 24), that is HCF(6, 24) = 6.

HCF and LCM before a test? a lesson with a Mathema tutor

Frequently asked questions

Use Euclid’s algorithm, or factorise into primes and multiply the shared factors. The HCF of 12 and 18 is 6.

That their HCF is 1, as for 8 and 15. They share no factor other than one.

Chiefly for simplifying fractions — dividing the numerator and denominator by the HCF gives lowest terms at once.

Unlock the Mathema lesson library

Leave your email and phone — we will take you through to the Mathema platform and open up the preparation library: problem sets, quizzes and lesson plans written by teachers.

We use your details only to set up the account and get in touch about a lesson. No spam.

HCF and LCM to master?

Book a free introductory lesson with a Mathema tutor. 30 minutes online, no commitment — we find the gap and the plan to close it.