Greatest Common Factor (GCF) Calculator with Steps
Find the greatest common factor of two or more numbers in seconds. This calculator shows you complete step by step solutions using three different methods: prime factorization, listing factors, and the Euclidean algorithm.
The calculator automatically detects whether you entered numbers or polynomial terms and finds the GCF accordingly. Just enter your values and see the answer with full working.
What Is the Greatest Common Factor?
The greatest common factor, or GCF, is the largest number that divides evenly into two or more numbers without leaving a remainder.
For example, if you have the numbers 12 and 18:
- Factors of 12: 1, 2, 3, 4, 6, 12
- Factors of 18: 1, 2, 3, 6, 9, 18
- Common factors: 1, 2, 3, 6
- Greatest common factor: 6
The number 6 is the largest number that goes into both 12 and 18 evenly. That makes it the GCF.
You might also hear GCF called by other names. Some textbooks and teachers use GCD (greatest common divisor) or HCF (highest common factor). These all mean exactly the same thing. They’re just different ways to say “the biggest number that divides into all the given numbers.”
Why the Greatest Common Factor Matters
You use the GCF more than you might realize.
Simplifying fractions:
When you reduce a fraction to lowest terms, you’re dividing both the numerator and denominator by their GCF. To simplify 12/18, you divide both by 6 (their GCF) to get 2/3.
Factoring in algebra:
Before you factor a polynomial, you always check if there’s a GCF to pull out first. For the expression 6x² + 9x, the GCF is 3x. Factoring that out gives you 3x(2x + 3).
Real world problems:
If you need to cut two boards (one 12 feet, one 18 feet) into equal length pieces with no waste, the longest pieces you can cut are 6 feet each. That’s the GCF.
Adding and subtracting fractions:
Finding a common denominator often involves the GCF’s cousin, the LCM (least common multiple). But understanding GCF helps you understand LCM.
Three Methods to Find the Greatest Common Factor
There are three main ways to find the greatest common factor. Each method works, but some are faster for certain types of problems.
Method 1: Listing Factors
This method works well for smaller numbers. You list all the factors of each number, find the ones that appear in every list, then pick the biggest.
Example: Find the GCF of 24 and 36
This method is straightforward and easy to understand. The downside? It gets slow with large numbers. Listing all factors of 360 takes a while.
When to use listing factors: Small numbers (under 50), when you’re just learning about GCF, when you need to see all factors anyway.
Method 2: Prime Factorization
This method is more efficient for larger numbers. You break each number into prime factors, find the common prime factors, then multiply them.
Example: Find the GCF of 48 and 72
The key trick: use the LOWEST power of each common prime factor. If one number has 2⁴ and another has 2³, use 2³ for the GCF.
When to use prime factorization: Larger numbers (over 50), when you need efficiency, when working with three or more numbers.
Method 3: Euclidean Algorithm
This method is the fastest for very large numbers. It uses division and remainders. The process looks strange at first but it’s surprisingly quick.
Example: Find the GCF of 48 and 72
The algorithm works by repeatedly dividing until you hit zero. The number right before zero is your GCF.
Here’s another example with bigger numbers:
Find GCF of 252 and 105
252 ÷ 105 = 2 remainder 42 105 ÷ 42 = 2 remainder 21 42 ÷ 21 = 2 remainder 0
GCF = 21
When to use Euclidean algorithm: Very large numbers, when you need speed, when working with just two numbers.
Also check: Factoring Calculator
Finding Greatest Common Factor of More Than Two Numbers
All three methods work for finding the GCF of three or more numbers, but the approach changes slightly.
Using listing factors (with three numbers):
Find the GCF of 12, 18, and 24.
Factors of 12: 1, 2, 3, 4, 6, 12 Factors of 18: 1, 2, 3, 6, 9, 18 Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24
Common to ALL three: 1, 2, 3, 6 GCF = 6
Using prime factorization (with three numbers):
Find the GCF of 30, 45, and 60.
30 = 2 × 3 × 5 45 = 3² × 5 60 = 2² × 3 × 5
Common prime factors (lowest powers):
- 3 appears in all three (lowest power: 3¹)
- 5 appears in all three (lowest power: 5¹)
- 2 does NOT appear in 45, so we skip it
GCF = 3 × 5 = 15
Using Euclidean algorithm (with three numbers):
Find the GCF of three numbers by finding GCF of the first two, then finding GCF of that result and the third number.
Find GCF of 48, 72, and 96.
First, find GCF(48, 72) = 24 (using the algorithm) Then, find GCF(24, 96) = 24 (using the algorithm)
Final GCF = 24
This works because GCF(a, b, c) = GCF(GCF(a, b), c).
Greatest Common Factor in Factoring Polynomials
The GCF isn’t just for numbers. It’s the first step in factoring any polynomial expression.
When you have a polynomial like 6x² + 9x, you look for the GCF of the terms before doing anything else.
Example: Factor 6x² + 9x
Step 1: Find GCF of the coefficients GCF(6, 9) = 3
Step 2: Find GCF of the variables Both terms have x. The lowest power is x¹.
Step 3: Combine coefficient and variable GCF GCF = 3x
Step 4: Factor out the GCF 6x² + 9x = 3x(2x + 3)
Step 5: Check by multiplying back 3x(2x + 3) = 6x² + 9x ✓
Another example: 12x³y + 18x²y² + 24xy³
Step 1: GCF of coefficients GCF(12, 18, 24) = 6
Step 2: GCF of variables All terms have at least xy (lowest powers)
Step 3: Combined GCF GCF = 6xy
Step 4: Factor it out 12x³y + 18x²y² + 24xy³ = 6xy(2x² + 3xy + 4y²)
Step 5: Check 6xy(2x² + 3xy + 4y²) = 12x³y + 18x²y² + 24xy³ ✓
Factoring out the GCF first makes the remaining polynomial simpler. Sometimes the GCF is all you need to factor. Other times, you factor the GCF first, then factor what’s left using other methods.
GCF vs LCM: What’s the Difference?
People often confuse GCF and LCM because they both involve factors and multiples. But they’re opposites.
Handy trick to remember:
LCM sounds like “multiple” → think multiplication → answer is bigger
GCF sounds like “factor” → think division → answer is smaller
Frequently Asked Questions
Practice Problems
Try these on your own, then use the calculator to check your answers.
Easy (listing factors method):
- Find GCF(8, 12)
- Find GCF(15, 25)
- Find GCF(6, 9, 12)
Medium (prime factorization method):
4. Find GCF(48, 72)
5. Find GCF(60, 90, 120)
6. Find GCF(54, 81)
Challenging (any method):
7. Find GCF(144, 216)
8. Find GCF(105, 252, 315)
9. Find GCF(256, 384)
Polynomial problems:
10. Factor out the GCF: 8x² + 12
11. Factor out the GCF: 15x³y + 25x²y² + 20xy³
12. Factor out the GCF: 36a²b³ + 48ab²
Answers:
- 4
- 5
- 3
- 24
- 30
- 27
- 72
- 21
- 128
- 4x(2x + 3)
- 5xy(3x² + 5xy + 4y²)
- 12ab²(3ab + 4)
Why This Greatest Common Factor Calculator Is Better
Most Greatest Common Factor calculators only handle numbers. Ours automatically detects whether you entered numbers or polynomial terms and calculates accordingly.
Type regular numbers and get the numerical GCF. Type algebraic terms and get the polynomial GCF. You don’t need separate calculators.
Features:
- Auto detects numbers vs polynomials
- Shows complete step by step solutions
- Displays three different methods
- Handles 2, 3, or more values
- Works with large numbers
- Free with no limits
- No ads during calculation
- Works on any device
The calculator uses the most efficient method automatically but lets you see all three approaches if you want to learn them.
Related Calculators and Resources
Need help with related concepts?
