Introduction
The Greatest Common Factor (GCF) of two or more numbers is the largest number that divides evenly into all of them. For example, the GCF of 8, 12, and 20 is 4, because 4 is the biggest number that goes into 8, 12, and 20 with no remainder. The GCF is also called the Greatest Common Divisor (GCD) or Highest Common Factor (HCF) — they all mean the same thing.
This GCF calculator finds the greatest common factor of any set of whole numbers instantly. Just type in two or more numbers, and the tool gives you the answer along with five different step-by-step methods that show how it was found: listing factors, prime factorization, the ladder (common division) method, the Euclidean algorithm, and the binary (Stein's) algorithm. It also shows all common factors, the LCM (Least Common Multiple), and tells you whether your numbers are coprime. Whether you are checking homework, simplifying fractions, or studying number theory, this calculator makes finding the GCF quick and easy.
How to use our GCF Calculator
Enter two or more whole numbers into the calculator, and it will find the Greatest Common Factor (GCF) along with step-by-step solutions using five different methods.
Enter two or more whole numbers: Type your numbers into the input box, separated by commas or spaces. For example, you can type "8, 12, 20" to find the greatest factor that all three numbers share. Each number must be a whole number between 0 and 10,000,000.
Click "Calculate GCF": Press the Calculate button to see your results. The calculator will show you the GCF, all common factors of your numbers, and the Least Common Multiple (LCM). It will also tell you if your numbers are coprime, meaning they share no common factor other than 1.
Explore five solution methods: Use the tabs below the result to see how the GCF is found using different approaches — Listing Factors, Prime Factorization, Common Division (Ladder Method), the Euclidean Algorithm, and Binary GCD (Stein's Algorithm). Each method walks you through the problem one step at a time so you can follow along and learn how it works.
Clear and start over: Press the "Clear" button to erase your input and results so you can enter a new set of numbers.
What Is the Greatest Common Factor (GCF)?
The Greatest Common Factor (GCF) of two or more whole numbers is the largest number that divides evenly into all of them with no remainder. It is also called the Greatest Common Divisor (GCD) or the Highest Common Factor (HCF) — these three terms all mean the same thing.
For example, the GCF of 12 and 18 is 6. Both 12 and 18 can be divided by 6 with nothing left over, and no number larger than 6 can do that.
How to Find the GCF
There are several ways to find the GCF. This calculator shows you five different methods step by step:
- Listing Factors: Write out every factor of each number, find the ones they share, and pick the biggest. This method is simple and works well for small numbers.
- Prime Factorization: Break each number down into its prime factors. Then multiply together only the prime factors that appear in every number, using the smallest power of each. For instance, 12 = 2² × 3 and 18 = 2 × 3², so the GCF = 2 × 3 = 6. If you need help breaking numbers into primes, our Factorial Calculator can be a useful companion when working with products of integers.
- Common Division (Ladder Method): Divide all the numbers by a shared prime factor at the same time. Keep dividing until no common prime factor is left. Multiply all the divisors together to get the GCF.
- Euclidean Algorithm: This classic method, dating back to the ancient Greek mathematician Euclid, uses repeated division. You replace the larger number with the remainder of dividing the two numbers, and repeat until the remainder is zero. The last non-zero remainder is the GCF. It is fast and works great for large numbers.
- Binary GCD (Stein's Algorithm): This method uses only subtraction and division by 2 instead of full division. Computers can perform these operations very quickly, making it an efficient choice for programming.
Why Is the GCF Useful?
The GCF shows up in many everyday math tasks. It is the key to simplifying fractions — you divide both the numerator and denominator by their GCF to reduce a fraction to its lowest terms. For example, 18/24 simplifies to 3/4 because the GCF of 18 and 24 is 6. Tools like the Percentage Calculator and Percent Change Calculator also rely on understanding how numbers relate to each other through division.
The GCF is also helpful when you need to split things into equal groups. If you have 24 red marbles and 36 blue marbles and you want to divide them into identical groups with no marbles left over, the largest number of groups you can make is 12 — the GCF of 24 and 36. This type of grouping problem is closely related to combinations and permutations, which count the different ways items can be arranged or selected.
GCF and LCM: How They Are Related
The GCF has a direct relationship with the Least Common Multiple (LCM). For any two positive numbers a and b:
GCF(a, b) × LCM(a, b) = a × b
This means if you know the GCF, you can quickly find the LCM, and vice versa. This calculator displays both values for you.
Special Cases to Know
- Coprime numbers: When the GCF of two or more numbers equals 1, those numbers are called coprime or relatively prime. They share no prime factors. For example, 8 and 15 are coprime because GCF(8, 15) = 1.
- GCF with zero: The GCF of any positive number and 0 is that positive number itself. This is because every integer divides 0 evenly. However, GCF(0, 0) is undefined since there is no greatest integer.
- GCF of more than two numbers: To find the GCF of three or more numbers, you can work in pairs. First find the GCF of the first two numbers, then find the GCF of that result with the next number, and so on. If you are working with statistical data sets involving multiple numbers, tools like the Mean Median Mode Calculator and the Standard Deviation Calculator can complement your analysis.