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.

Factoring Pro

Solve complex polynomials instantly

x² + 5x + 6 Simple Trinomial
6x² + 7x - 5 Complex Trinomial
4x² - 12x + 9 Perfect Square
x² - 49 Diff. of Squares
x³ - 27 Diff. of Cubes
2x² + 4x Common Factor
x³ + 64 Sum of Cubes
4x³ - 8x² + 12x Polynomial GCF
← Back to Examples
Result Type
Answer
Steps go here...

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.”

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.

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

  • Step 1: List all factors of 24 Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24
  • Step 2: List all factors of 36 Factors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36
  • Step 3: Find common factors Common factors: 1, 2, 3, 4, 6, 12
  • Step 4: Pick the greatest one GCF = 12

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

  • Step 1: Find prime factorization of 48 48 = 2 × 2 × 2 × 2 × 3 48 = 2⁴ × 3
  • Step 2: Find prime factorization of 72 72 = 2 × 2 × 2 × 3 × 3 72 = 2³ × 3²
  • Step 3: Identify common prime factors with lowest powers Both have 2 and 3 as prime factors Lowest power of 2: 2³ Lowest power of 3: 3¹
  • Step 4: Multiply the common factors GCF = 2³ × 3 = 8 × 3 = 24

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

  • Step 1: Divide the larger by the smaller 72 ÷ 48 = 1 remainder 24
  • Step 2: Divide the previous divisor by the remainder 48 ÷ 24 = 2 remainder 0
  • Step 3: When remainder is 0, the last divisor is the GCF GCF = 24

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

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).

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.

  • GCF (Greatest Common Factor):
    The LARGEST number that divides into all given numbers
    Uses division
    Answer is smaller than or equal to the smallest input number
    Used for simplifying fractions
  • Example with 12 and 18:
    GCF(12, 18):
    What’s the biggest number that goes into both?
    Answer: 6
  • When to use GCF:
    Reducing fractions (divide numerator and denominator by GCF)
    Dividing things into equal groups
    Simplifying ratios
    Factoring polynomials
  • LCM (Least Common Multiple):
    The SMALLEST number that all given numbers divide into
    Uses multiplication
    Answer is larger than or equal to the largest input number
    Used for adding fractions
  • Example with 12 and 18:
    LCM(12, 18):
    What’s the smallest number that both go into?
    Answer: 36
  • When to use LCM:
    Adding or subtracting fractions (find common denominator)
    Solving problems about repeating events
    Finding when cycles align

Handy trick to remember:
LCM sounds like “multiple” → think multiplication → answer is bigger
GCF sounds like “factor” → think division → answer is smaller

The GCF is always 1. Since 1 is the only factor of 1, and 1 divides into everything, 1 is the only common factor. For example, GCF(1, 25) = 1.

No, never. The GCF cannot be larger than the smallest number you’re working with. If you’re finding GCF(8, 12), the answer can’t be more than 8.
Actually, if one number divides evenly into another, the GCF equals the smaller number. GCF(8, 24) = 8 because 8 goes into 24 evenly.

The GCF of two different prime numbers is always 1. Prime numbers have no factors except 1 and themselves. Since different primes don’t share any factors, their GCF is 1.
Example: GCF(7, 13) = 1
But if you find the GCF of the same prime with itself, you get that prime. GCF(7, 7) = 7.

This gets mathematical. Technically, every number divides into 0 evenly (because 0 ÷ anything = 0). So GCF(5, 0) = 5, and more generally GCF(k, 0) = k for any number k.
However, GCF(0, 0) is undefined. Mathematicians don’t assign a value to it.
For practical purposes, you’ll rarely encounter GCF problems with 0 in them.

Yes, they’re identical. Different textbooks and countries use different names:

  • GCF = Greatest Common Factor (common in US)
  • HCF = Highest Common Factor (common in UK, India)
  • GCD = Greatest Common Divisor (used in number theory)

They all mean the exact same thing.

For small numbers, listing factors is fastest. For larger numbers, try these tricks:

If one number divides the other evenly: The GCF is the smaller number. GCF(15, 45) = 15.

If both are even: 2 is definitely a factor. Divide both by 2 and keep going. GCF(24, 32) = GCF(12, 16) = GCF(6, 8) = 2.

If they end in 5 or 0: 5 is likely a factor. Test it first.

If one is much larger: Use Euclidean algorithm. It’s fast even without a calculator.

Technically yes, but we usually ignore the negative signs. GCF is defined for positive integers. If you have -12 and 18, treat them as 12 and 18, so GCF = 6.
The GCF itself is always positive.

Then the GCF is 1, and we call the numbers “relatively prime” or “coprime.” They don’t have to be prime themselves, just prime relative to each other.
Example: 8 and 15 are coprime. GCF(8, 15) = 1.
Neither is prime (8 = 2³, 15 = 3 × 5), but they share no factors.

Try these on your own, then use the calculator to check your answers.

Easy (listing factors method):

  1. Find GCF(8, 12)
  2. Find GCF(15, 25)
  3. 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:

  1. 4
  2. 5
  3. 3
  4. 24
  5. 30
  6. 27
  7. 72
  8. 21
  9. 128
  10. 4x(2x + 3)
  11. 5xy(3x² + 5xy + 4y²)
  12. 12ab²(3ab + 4)

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.

  • 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?

Main factoring tool for polynomials

Break numbers into prime factors