GCF Calculator
Enter two or more whole numbers to get their greatest common factor and see how it is found.
Result
The largest whole number that divides every number in the list without a remainder.
Prime factorisation
- 48 = 24 × 3
- 18 = 2 × 32
Common prime factors with the smallest exponent: 2 × 3 = 6
Euclidean algorithm
- 48 = 2 × 18 + 12
- 18 = 1 × 12 + 6
- 12 = 2 × 6 + 0
How to use the GCF calculator
Type two to ten whole numbers separated by commas or spaces. The greatest common factor appears at once, together with the working: the prime factorisation of each number and the steps of the Euclidean algorithm. Negative signs are ignored, because divisors of a number and of its negative are the same. Use digits only, without decimals or thousands separators, up to 30 digits per number.
Two ways to find the GCF
Prime factorisation. Write each number as a product of primes, then multiply the primes that appear in every number, each with the smallest exponent it has in any of them.
Euclidean algorithm. Divide the larger number by the smaller one and keep the remainder. Repeat with the divisor and the remainder until the remainder is 0. The last non-zero remainder is the GCF. For more than two numbers the calculator takes the GCF of the first two, then the GCF of that result and the third number, and so on.
Worked example: GCF(48, 18)
- 48 = 24 × 3 and 18 = 2 × 32. The common primes with their smallest exponents are 2 and 3, so the GCF is 2 × 3 = 6.
- Euclid: 48 = 2 × 18 + 12, then 18 = 1 × 12 + 6, then 12 = 2 × 6 + 0. The last non-zero remainder is 6.
Dividing each number by 6 gives 8 and 3, which share no factor, so 48/18 simplifies to 8/3.
Limits and conventions
- GCF(0, n) = n, and the GCF of all zeros is undefined.
- A GCF of 1 means the numbers are coprime.
- Prime factorisations are listed for numbers up to 1015. Larger numbers (up to 30 digits) still get an exact GCF and the Euclidean steps, because the algorithm does not need factoring.
- To get the smallest common multiple instead, use the LCM calculator: for two numbers, GCF × LCM = their product.
Frequently asked questions
Are GCF, GCD and HCF the same thing?
Yes. Greatest common factor (GCF), greatest common divisor (GCD) and highest common factor (HCF) are three names for the largest whole number that divides every number in the list without a remainder.
How do I use the GCF to simplify a fraction?
Divide the numerator and the denominator by their GCF. For 48/18 the GCF is 6, so the fraction simplifies to 8/3. The calculator lists each number divided by the GCF for this purpose.
What is the GCF of a number and 0?
It is the number itself, because every integer divides 0. So GCF(0, 5) = 5. If every number entered is 0 the GCF is undefined and the calculator asks for another value.
Sources and methodology
Last reviewed 2026-12-04