Math Calculators
GCF Calculator


GCF Calculator

Find the Greatest Common Factor (GCF) instantly with our free GCF Calculator. Get step-by-step solutions, prime factorization, and factor lists. Try it now!

Result

GCF = 4

There was an error with your calculation.

Last updated: June 3, 2026

Table of Contents

  1. The Greatest Common Factor Calculator
  2. Directions for Use
  3. The Definition of the Greatest Common Factor
  4. How to Find the Greatest Common Factor
    1. Solution by factorization
    2. Calculation example
    3. Prime factorization
  5. Calculation example
  6. Euclid’s algorithm
  7. Calculation example
  8. Why is the GCF only defined for positive numbers
  9. The greatest common factor of 0

GCF Calculator

The Greatest Common Factor Calculator

Our Greatest Common Factor Calculator is a fast and highly accurate online tool designed to find the greatest common factor (GCF) of a list of numbers. In addition to calculating the GCF, this tool conveniently provides a comprehensive list of all factors for your inputted numbers.

The GCF is frequently referred to as the greatest common denominator, the greatest common divisor (GCD), or the highest common factor (HCF). Because these terms are mathematically identical, you can seamlessly use this GCF calculator to solve for any of them.

Directions for Use

To use our GCF finder, simply input your numbers separated by commas or spaces, then click “Calculate.” The tool will instantly return the greatest common factor of your list and provide a step-by-step breakdown showing how the value was determined. By default, this calculator illustrates the solution using the factorization method.

Limitations on input values:

  1. You must input whole numbers.
  2. Only one of the numbers can be zero.
  3. You can only enter positive integers.

The Definition of the Greatest Common Factor

The Greatest Common Factor (GCF)—also known as the Greatest Common Divisor (GCD)—is the highest positive integer that divides two or more given numbers evenly, without leaving a remainder. In simple terms, it is the largest number shared across the factor lists of your given integers. For instance, the GCF of 12 and 18 is 6, because 6 is the largest integer that divides both 12 and 18 perfectly.

In mathematical cases involving zero, the GCF is the absolute value of the non-zero integer (since every integer divides into zero). However, if all the integers in your set are zero, the greatest common factor remains undefined.

To illustrate, the factors of the number 12 are 1, 2, 3, 4, 6, and 12. The "common factors" of multiple numbers are the divisors shared by all of them. If we need to find the common factors of 12 and 16, we first list all individual factors for each number and compare the lists to see which factors overlap:

12: 1, 2, 3, 4, 6, 12

16: 1, 2, 4, 8, 16

As shown above, the common factors shared by 12 and 16 are 1, 2, and 4. The greatest common factor is simply the highest value among them. Therefore, the GCF of 12 and 16 is 4.

How to Find the Greatest Common Factor

There are several mathematical methods used to calculate the GCF of a set of numbers. The most straightforward approach is solving by factorization.

Solution by factorization

To find the greatest common factor using this method, simply follow the steps demonstrated in the previous section: first, identify all the factors for each number in your list. Next, pinpoint the common factors shared between them, and finally, select the highest value.

Solving by factorization is highly practical for smaller numbers or when the factors are easy to calculate mentally. However, for larger and more complex integers, advanced methods like prime factorization or Euclid's algorithm offer greater efficiency.

Calculation example

Find the greatest common factor of the numbers 3, 9, and 48.

Solution:

  • The factors of 3 are 1 and 3.
  • The factors of 9 are 1, 3, and 9.
  • The factors of 48 are 1, 2, 3, 4, 6, 8, 12, 16, 24, and 48.

The common factors are 1 and 3. Therefore, the greatest common factor is 3.

Answer: GCF = 3

Prime factorization

Another highly effective strategy for finding the GCF involves prime factorization. This method consists of the following steps:

  1. Find all the prime factors of the numbers in the given set.
  2. List the common prime factors shared by all numbers in the set.
  3. Multiply these common prime factors together to get the greatest common factor.

Calculation example

Find the greatest common factor of the numbers 16, 24, and 76.

Solution

  • The prime factorization of 16 is: 2 × 2 × 2 × 2, or 2⁴.
  • The prime factorization of 24 is: 2 × 2 × 2 × 3, or 2³ × 3¹.
  • The prime factorization of 76 is: 2 × 2 × 19, or 2² × 19¹.
  • The common prime factors are: 2 × 2, or 2².

Therefore, the greatest common factor is: 2 × 2 = 2² = 4

Answer: GCF = 4

Euclid’s algorithm

Euclid's algorithm is especially handy for finding the greatest common factor of large numbers, where manual factorization would be overly cumbersome and time-consuming. Developed by the ancient Greek mathematician Euclid, this algorithm operates on a simple mathematical principle: the GCF of two numbers, m and n (where m > n), is exactly the same as the GCF of n and m - n.

To calculate the GCF of two numbers (m and n) using this algorithm, you must consecutively replace the larger of the two numbers with their difference:

First, replace m with m - n. You now have a new set of numbers: m - n and n.

Check which of the two current numbers is larger, and replace that number with the difference between them.

Repeat this process until the two numbers become equal. That final matching number is the greatest common factor of your original set.

Calculation example

Find the greatest common factor of the following numbers: 124, 98.

Solution

The larger number in this set is 124. Let’s replace it with the difference of the two numbers (124 - 98 = 26) to generate the following set:

26, 98

The larger number in our new set is 98. Let’s replace it with the difference of these numbers (98 - 26 = 72) to get:

26, 72

We can continue to subtract 26 from the larger number two more times: 72 - 26 - 26 = 20. Now our set looks like this:

26, 20

In the following iteration, we replace 26 with its difference from 20 (26 - 20 = 6) to get:

6, 20

Next, we subtract 6 from 20. We can repeat this operation three times, since the resulting difference will still be greater than 6:

20 - 6 - 6 - 6 = 2

Now our set is:

6, 2

The subsequent iterations are:

(6 - 2 = 4), 2 or 4, 2

(4 - 2 = 2), 2 or 2, 2

Now we have a set of two equal numbers:

2, 2

Therefore, the greatest common factor of 124 and 98 is 2.

Answer: GCF = 2

Why is the GCF only defined for positive numbers

By mathematical definition, the greatest common factor is strictly limited to positive numbers. Accordingly, our GCF calculator only accepts positive integers as valid inputs. The GCF is always a positive value, even when evaluating negative numbers. For example, -4 is a valid factor of -8. However, 4 is also a factor of -8 (because -8 = 4 × (-2)). Because the greatest common factor must be the largest possible divisor shared between the numbers, the final GCF will inherently always be positive.

The greatest common factor of 0

When calculating the greatest common factor of a number and zero, the result is always the absolute value of the non-zero integer. This rule applies because zero can be divided by any non-zero integer. For instance, the GCF of 8 and 0 is 8, while the GCF of -8 and 0 is also 8 (representing the absolute value of -8).