About the GCF Calculator (GCD / HCF) tool
The greatest common factor (GCF) — also called the greatest common divisor (GCD) or highest common factor (HCF) — is the largest whole number that divides every number in a list without a remainder. It is what you divide by to simplify a fraction such as 84/126 to 2/3, to split items into the largest equal groups, or to reduce a ratio to its simplest form.
This calculator uses Euclid’s algorithm, one of the oldest algorithms still in everyday use. Divide the larger number by the smaller, keep the remainder, and repeat with the smaller number and the remainder until the remainder is zero; the last non-zero remainder is the GCF. Every division line is printed, for example 1071 = 2 × 462 + 147, so you can follow it or copy it into homework. For more than two numbers it applies the algorithm step by step, since GCF(a, b, c) = GCF(GCF(a, b), c).
It also shows the prime factorisation of each number and confirms the GCF by multiplying the shared primes with their lowest powers. For two numbers you get the Bézout identity from the extended Euclidean algorithm — whole numbers x and y with ax + by = GCF — which is used in modular arithmetic and cryptography. Inputs can be up to 60 digits and are handled exactly with BigInt.
How to use GCF Calculator (GCD / HCF)
- Enter two or more whole numbers in “Numbers (2 or more)”, separated by commas or spaces.
- Read the GCF in the result card, along with whether the numbers are coprime and their LCM.
- Look at the factorisation table to see the prime factors of each number.
- Click “Show steps” to see every line of Euclid’s algorithm and the prime-factor check.
- For exactly two numbers, note the Bézout identity row from the extended Euclidean algorithm.
Features
Euclid’s algorithm, line by line
Each division with quotient and remainder is shown until the remainder reaches zero.
GCF, GCD and HCF
Whatever your textbook calls it, it is the same number, calculated for up to 30 inputs.
Prime factorisation check
Shared primes with their lowest powers are multiplied to confirm the result a second way.
Bézout coefficients
For two numbers the extended algorithm gives x and y with ax + by = GCF, including negative inputs.
Coprime test and LCM
Instantly see whether the numbers are relatively prime, plus their least common multiple.
When to use it
- Simplify a fraction like 84/126 by dividing top and bottom by their GCF.
- Split 48 apples and 36 oranges into the largest identical gift bags.
- Reduce a ratio such as 1920:1080 to its simplest form.
- Find modular inverses for an RSA or number-theory exercise using Bézout coefficients.
- Check whether two numbers are coprime before using them in a gear or cipher design.
Frequently asked questions
Are GCF, GCD and HCF the same thing?
Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number. GCD is common in the US and in programming, HCF in the UK and India.
How does Euclid’s algorithm work?
Replace the pair (a, b) with (b, a mod b) repeatedly. When the remainder becomes 0, the other number is the GCF. For 1071 and 462: 1071 = 2 × 462 + 147, 462 = 3 × 147 + 21, 147 = 7 × 21 + 0, so the GCF is 21.
What is the GCF of two prime numbers?
1, unless they are the same prime. Any two numbers whose GCF is 1 are called coprime or relatively prime.
What is GCF(0, n)?
Every number divides 0, so GCF(0, n) = |n|. GCF(0, 0) is undefined, and the calculator says so.
What is the Bézout identity?
For any integers a and b there are integers x and y with ax + by = GCF(a, b). The extended Euclidean algorithm finds them, and they are used to compute modular inverses.