Factoring Out the GCF in Algebra: Step-by-Step with Examples

How to find the greatest common factor of algebraic terms, factor it out of polynomials, handle negatives and binomial factors, and check your work.

A man with glasses thinking in front of a chalkboard
Photo by Vitaly Gariev on Unsplash
Try the GCF Calculator – Enter two or more whole numbers to get their greatest common factor, least common multiple, prime factorizations and the Euclidean algorithm worked out.

Factoring out the greatest common factor is the first step in almost every factoring problem in algebra. It undoes the distributive property: instead of multiplying 3x(2x + 5) out to 6x² + 15x, you start with 6x² + 15x and pull the 3x back out.

Step 1: find the GCF of the coefficients

Treat the numbers on their own. For 12x³ + 18x² − 30x, the coefficients are 12, 18 and 30, and their GCF is 6. The GCF calculator handles any set of coefficients.

Step 2: find the GCF of each variable

For each variable that appears in every term, take the lowest power. Here x appears as x³, x² and x, so the variable part is x¹. A variable missing from any term isn't part of the GCF.

Step 3: divide each term by the GCF

The GCF is 6x. Divide each term:

  • 12x³ ÷ 6x = 2x²
  • 18x² ÷ 6x = 3x
  • −30x ÷ 6x = −5

12x³ + 18x² − 30x = 6x(2x² + 3x − 5)

Step 4: check by multiplying back

Distribute 6x over the parentheses and you should get the original expression. Also check that the terms inside the parentheses have no common factor left; if they do, you didn't use the greatest one.

More examples

ExpressionGCFFactored form
8a + 2044(2a + 5)
15x²y − 25xy²5xy5xy(3x − 5y)
9m⁴ + 6m³ + 3m²3m²3m²(3m² + 2m + 1)
14p³q² − 21p²q³ + 7pq7pq7pq(2p²q − 3pq² + 1)

Notice the "+ 1" in the last two rows. When a term equals the GCF itself, it leaves 1 behind, not 0. Forgetting it is one of the most common errors.

Negative leading coefficients

By convention, if the first term is negative, factor out a negative GCF so the polynomial inside starts positive: −4x² + 12x = −4x(x − 3). Both −4x(x − 3) and 4x(−x + 3) are correct, but the first is usually preferred.

Binomial GCFs

A common factor can be a whole expression. In 3x(x − 2) + 5(x − 2), both terms contain (x − 2):

3x(x − 2) + 5(x − 2) = (x − 2)(3x + 5)

This is the basis of factoring by grouping, used for four-term polynomials such as x³ + 2x² + 4x + 8 = x²(x + 2) + 4(x + 2) = (x + 2)(x² + 4).

Why factor out the GCF first?

  • It makes the remaining polynomial smaller and easier to factor further. 2x² + 10x + 12 = 2(x² + 5x + 6) = 2(x + 2)(x + 3).
  • It simplifies algebraic fractions; see simplifying fractions with the GCF.
  • It helps solve equations: 6x² + 15x = 0 becomes 3x(2x + 5) = 0, so x = 0 or x = −2.5.

Further reading from official sources

More gcf guides

A student writing formulas on a chalkboardGCF vs. LCM: What's the Difference and When to Use EachThe greatest common factor and least common multiple are easy to confuse. Learn what each one means, how they're related, and which one a word problem needs.3 min readA man standing in front of a chalkboard covered in equationsThe Euclidean Algorithm: The Fastest Way to Find the GCFHow Euclid's division method finds the greatest common factor of large numbers in a few steps, why it works, and how to extend it to three or more numbers.3 min readA young boy writing complex formulas on a chalkboardPrime Factorization: Factor Trees, Division Ladders and Divisibility RulesBreak any number into prime factors using factor trees or the ladder method, with divisibility shortcuts and examples of using primes to find the GCF and LCM.3 min read