Calculator Tools

Factoring Calculator

Factor polynomials and whole numbers step by step. Type an expression such as x² + 5x + 6, and see the factored form, the method used at each step, and the zeros.

Enter an expression

We read this as

x2+5⁢x+6

Try an example

How to type your function
x squaredx^2
2 times x2x or 2*x
Multiplying brackets(x+1)(x-2)
A fraction as a coefficientx^2/2 - 2
A number to factor360

Use x as the variable and brackets to make the order clear, for example 1/(2x).

Result

x2+5⁢x+6=(x+2)⁢(x+3)

Checked: multiplying the factors back out gives the original expression.

Step-by-step solution
  1. Split the middle term

    Multiply a·c = 1·6 = 6. Find two numbers with product 6 and sum 5: 3 and 2. Split 5x into 3x + 2x, group the terms, and take out the common factor to get (x + 2)(x + 3).

    (x+2)⁢(x+3)

What is factoring?

Factoring means writing a number or an expression as a product of smaller pieces called factors. For example, x² − 4 = (x − 2)(x + 2) and 12 = 2 · 2 · 3. It is the reverse of multiplying out brackets. Factoring is how you solve quadratic equations, simplify fractions, cancel terms in limits, and find where a graph crosses the x-axis. This free factoring calculator factors polynomials and whole numbers, shows which method it used at each step, and checks every answer by multiplying the factors back out.

How to use the factoring calculator

  1. Type your expression. Use x as the variable, for example x^2+5x+6. You can also type brackets such as (x+1)(x-2) or a whole number such as 360.
  2. Check the preview. The line "We read this as" shows how your entry was understood, so you can spot a missing bracket early.
  3. Read the answer. The factored form appears right away, together with the zeros of the polynomial when it has linear factors.
  4. Follow the steps. Each method is listed in order, with the expression after that step.

Factoring formulas

Common factor
ab + ac = a(b + c)
Difference of squares
a² − b² = (a − b)(a + b)
Perfect square (plus)
a² + 2ab + b² = (a + b)²
Perfect square (minus)
a² − 2ab + b² = (a − b)²
Sum of cubes
a³ + b³ = (a + b)(a² − ab + b²)
Difference of cubes
a³ − b³ = (a − b)(a² + ab + b²)
Trinomial
x² + (p + q)x + pq = (x + p)(x + q)

Factoring methods with examples

Work in this order: take out the common factor, look for a pattern, then try a method for the number of terms and the degree. These examples come straight from the calculator, so you can compare them with your own work.

Take out the common factor

Look for the largest number and power of x that divides every term. 6x + 12 has a common factor of 6.

6⁢x+12=6(x+2)

Trinomial with a leading 1

For x² + bx + c, find two numbers that multiply to c and add to b. Here 2 · 5 = 10 and 2 + 5 = 7.

x2+7⁢x+10=(x+2)⁢(x+5)

Trinomial with another leading coefficient

Multiply a·c = 6·(−2) = −12. Find two numbers with that product that add to 1: 4 and −3. Split the middle term and group.

6⁢x2+x−2=(2⁢x−1)⁢(3⁢x+2)

Difference of squares

Use a² − b² = (a − b)(a + b). Here a = x and b = 2.

x2−4=(x−2)⁢(x+2)

Perfect square trinomial

When a² ± 2ab + b² appears, it equals (a ± b)². Here a = 2x and b = 3.

4⁢x2−12⁢x+9=(2⁢x−3)2

Sum of cubes

Use a³ + b³ = (a + b)(a² − ab + b²). Here a = x and b = 3.

x3+27=(x+3)⁢(x2−3⁢x+9)

Difference of cubes

Use a³ − b³ = (a − b)(a² + ab + b²). Here a = x and b = 2.

x3−8=(x−2)⁢(x2+2⁢x+4)

Factor by grouping

With four terms, factor each pair: 3x²(x + 2) + 2(x + 2). Both pairs share (x + 2).

3⁢x3+6⁢x2+2⁢x+4=(x+2)⁢(3⁢x2+2)

Rational roots for higher degrees

For x³ − 6x² + 11x − 6, the possible rational roots are factors of 6. Testing shows x = 1, 2, and 3 are roots.

x3−6⁢x2+11⁢x−6=(x−3)⁢(x−2)⁢(x−1)

Quadratic in x²

Treat x² as a single variable y. Then x⁴ − 5x² + 4 becomes y² − 5y + 4 = (y − 1)(y − 4).

x4−5⁢x2+4=(x−2)⁢(x−1)⁢(x+1)⁢(x+2)

Factoring a whole number

Divide by the smallest prime that fits, again and again, until nothing is left.

360=23⋅32⋅5

An expression that does not factor

A sum of squares such as x² + 1 has no factors with real numbers, so it is left as it is.

x2+1cannot be factored further

Common factoring mistakes

  • Forgetting the common factor. Always take it out first: 2x² + 8x = 2x(x + 4), not just a partial factoring.
  • Using the difference of squares on a sum. x² + 9 does not factor as (x + 3)(x − 3). Multiply that back and you get x² − 9.
  • Mixing up the signs in a trinomial. For x² + 5x + 6 the two numbers must add to +5, so the factors are (x + 2)(x + 3), not (x − 2)(x − 3).
  • Stopping too early. x⁴ − 16 = (x² − 4)(x² + 4) is not finished, because x² − 4 factors again into (x − 2)(x + 2).
  • Not checking. Multiply the factors back out. You should get the original expression.

What this calculator can and cannot do

It factors polynomials in one variable, x, with whole-number or fraction coefficients, up to degree 8, and it factors whole numbers up to 1,000,000,000,000. It works over the rational numbers, so a result such as x² − 2 is left as it is, even though it factors with √2. For polynomials of high degree with large coefficients, it says so when it cannot be sure a factor is fully broken down. It does not factor expressions with several variables, and it does not find the greatest common factor or least common multiple of several numbers.

Factoring terms explained

Factor
A number or expression that divides another one exactly and is multiplied with others to make it.
Greatest common factor (GCF)
The largest factor shared by every term, such as 3x in 6x² + 9x.
Trinomial
A polynomial with three terms, such as x² + 5x + 6.
Irreducible
A polynomial that cannot be factored further using the numbers allowed. Over the rationals, x² + 1 and x² − 2 are irreducible.
Root or zero
A value of x that makes the polynomial 0. Each root r gives a factor (x − r).
Prime number
A whole number above 1 whose only factors are 1 and itself.
Prime factorization
Writing a whole number as a product of primes, such as 360 = 2³ · 3² · 5.

Related calculators

Factoring is the key to cancelling in limits, so try the limit calculatornext. You can also use the derivative calculator or thematrix calculator.

Frequently asked questions

What is factoring?

Factoring means writing a number or an expression as a product of smaller pieces called factors. For example, x² − 4 = (x − 2)(x + 2), and 12 = 2 · 2 · 3. Factoring is the reverse of multiplying out brackets.

How do I factor a polynomial?

First take out the greatest common factor. Then look for a pattern: a difference of squares, a sum or difference of cubes, or a trinomial. For a trinomial x² + bx + c, find two numbers that multiply to c and add to b. With four terms, try grouping. For higher degrees, try the rational root theorem. This calculator tries these methods in turn and shows which one it used.

How do I factor a trinomial such as x² + 5x + 6?

Find two numbers that multiply to the constant term (6) and add to the middle coefficient (5). Here they are 2 and 3, so x² + 5x + 6 = (x + 2)(x + 3). When the first coefficient is not 1, multiply it by the constant term, find two numbers with that product and the middle coefficient as their sum, split the middle term, and factor by grouping.

What is the difference of squares?

It is the pattern a² − b² = (a − b)(a + b). For example, x² − 4 = x² − 2² = (x − 2)(x + 2). It only works for a difference. A sum of squares such as x² + 9 cannot be factored using real numbers.

What are the sum and difference of cubes formulas?

a³ + b³ = (a + b)(a² − ab + b²) and a³ − b³ = (a − b)(a² + ab + b²). For example, x³ − 8 = (x − 2)(x² + 2x + 4). The quadratic factor in each formula cannot be factored further with real numbers.

What is factoring by grouping?

With four terms, split them into two pairs, take the common factor out of each pair, and look for a shared bracket. For example, 3x³ + 6x² + 2x + 4 = 3x²(x + 2) + 2(x + 2) = (x + 2)(3x² + 2).

What does "cannot be factored further" mean?

The calculator factors over the rational numbers, which means whole-number and fraction coefficients only. An expression that cannot be broken down that way is called irreducible. For example, x² + 1 is irreducible, and x² − 2 is irreducible over the rationals even though it equals (x − √2)(x + √2) with irrational numbers.

Can I factor a whole number?

Yes. Enter a whole number such as 360 and the calculator gives its prime factorization, 2³ · 3² · 5, with the division steps. A prime number is reported as prime. Numbers can have an absolute value up to 1,000,000,000,000.

What can I type into the calculator?

Use x as the variable and type the expression as you would on a calculator: x^2 for x squared, 2x or 2*x for 2 times x, and brackets such as (x+1)(x-2). Fractions are allowed as coefficients, for example x^2/2 − 2. The degree can be up to 8 and coefficients up to 1,000,000.

Does the calculator show the steps and check its answer?

Yes. Each method is listed in order, with the product after that step. The answer is also checked automatically by multiplying the factors back out and comparing with your expression.

Can it factor expressions with more than one variable?

Not yet. This calculator works with polynomials in a single variable, x, and with whole numbers. It also does not find the greatest common factor or least common multiple of several numbers.