Math Calculators
GCF Calculator


GCF Calculator

Greatest common factor calculator finds the GCF of a set of numbers and all factors of these numbers. Solutions with steps for finding the GCF are also demonstrated.

Result

GCF = 4

There was an error with your calculation.

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

The greatest common factor calculator is an online tool that allows you to quickly and accurately find the greatest common factor (GCF) of a list of numbers. It will also provide all the factors of the numbers in that list.

The GCF is sometimes referred to as the greatest common denominator, the greatest common divisor, or the highest common factor. This GCF calculator can, therefore, be used to find the solution for any of those terms.

Directions for Use

To use the GCF finder, enter all numbers separated by commas or spaces and press “Calculate.” The calculator will return the GCF of the listed numbers and will demonstrate the solution for finding its value. The calculator will always illustrate the solution by factorization.

Limitations on the 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 integers without leaving a remainder. It is the largest number that all the given integers can be divided by. For example, the GCF of 12 and 18 is 6, as 6 is the largest number that divides both 12 and 18 without leaving any remainder.

In cases involving zero, the GCF is the absolute value of the non-zero integer, since every integer divides zero. However, if all integers in the set are zero, the GCF is undefined.

For example, the factors of number 12 would be 1, 2, 3, 4, 6, and 12. The common factors of several numbers are those factors that can divide all those numbers without remainders. For example, if we had to find all common factors of numbers 12 and 16, we would first need to list all the factors of each number and then check which factors are on both lists:

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

16: 1, 2, 4, 8, 16

The common factors of the given numbers (12 and 16) are 1, 2, and 4. The greatest common factor is simply the largest one of these numbers. In the case of 12 and 16, the GCF is 4.

How to Find the Greatest Common Factor

There are several ways to find the GCF of several numbers. The most straightforward one is the solution by factorization.

Solution by factorization

To find the GCF using this method, follow the steps described above — first, identify the factors of all the numbers in the list, then find the common factors and choose the largest one.

The solution by factorization method is more practical for smaller numbers or when the factors of the numbers are easily identifiable. For larger numbers, methods like prime factorization or Euclid's algorithm may be more efficient.

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.

Common factors are 1 and 3. Then the greatest common factor is 3.

Answer: GCF = 3

Prime factorization

Another strategy for finding the greatest common factor of a set of numbers consists of the following steps:

  1. Find all the prime factors of the numbers in the given set.
  2. List the common prime factors for all set numbers.
  3. To get the greatest common factor, multiply the common prime factors.

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

This algorithm is handy for finding the greatest common factors of large numbers, where using any type of factorization would be very cumbersome and time-consuming. This algorithm, developed by Euclid, uses the fact that the GCF of the two numbers m and n, where m > n, is the same as the GCF of the two numbers n and m - n.

To use this algorithm for the finding the GCF of the two numbers m and n, you need to consecutively replace the largest of the two numbers with the difference of the numbers:

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

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

Repeat until the two numbers become equal. That number will be the greatest common factor of the original set of numbers.

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 in numbers 124 - 98 = 26 so that we get the following set:

26, 98

The larger number in this set is 98. Let’s replace it with the difference in numbers, (98 - 26) = 72 so that we get the following set:

26, 72

We can 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 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 following 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

The greatest common factor is only defined for positive numbers. The GCF calculator also only takes positive integers as inputs. The GCF will always be positive, even for negative numbers. For example, -4 is a factor of -8. However, 4 is also a factor of -8, since -8 = 4 × (-2). Since the greatest common factor is always the largest of all common factors, it will always be positive.

The greatest common factor of 0

The greatest common factor of a number and zero is always the absolute value of the non-zero number. This is because any number is a divisor of zero. For example, the GCF of 8 and 0 is 8, and the GCF of -8 and 0 is 8 (the absolute value of -8).