Uni-Sine
MathematicsAlgebra

Factoring calculator with steps

This factoring calculator factors a polynomial completely and names the method at each step: greatest common factor, difference of two squares, perfect square, trinomials, grouping, sums and differences of cubes, and the rational root theorem for higher powers. Type an expression and it gives the factored form, the roots, and the full working.

It opens on the cubic x³ − 6x² + 11x − 6, which it breaks into (x − 3)(x − 2)(x − 1) with the rational root theorem. In the UK this is called factorising, and the calculator works the same either way.

Try it

Factoring Calculator

Factorise expressions and quadratics with full working

Go to its page

How to use the factoring calculator

  1. Type your expression in the Factorise box. For a power, type ^ and the number, then press the right arrow key to come back down.
  2. Read the answer under Factorised, then the readouts: whether it is fully factored, which methods were used, and the roots.
  3. Follow the working. Each step says what it spotted, such as two numbers that multiply to ac and add to b, and shows the expression after that step.
  4. Look at the visual. For one letter it draws the graph, which crosses the x-axis at each real root. For several letters it draws a factor tree showing how the expression came apart.

Expressions can use more than one letter, so 6x²y + 9xy² works as well as x² + 5x + 6. The Examples list loads one of each type to try. For practice, Practice and help sets random expressions to factor, with a hint and a worked solution for each.

The factoring methods it uses

Always look for a common factor first, then for a pattern. These are the methods the calculator names, with an expression for each that you can type in.

MethodPatternType thisFactored
Greatest common factorEvery term shares a factor6x^2y+9xy^23xy(2x + 3y)
Difference of two squaresa² − b² = (a − b)(a + b)4x^2-9y^2(2x − 3y)(2x + 3y)
Perfect squarea² − 2ab + b² = (a − b)²9x^2-30x+25(3x − 5)²
Trinomial (quadratic)ax² + bx + c3x^2+4x-4(x + 2)(3x − 2)
GroupingFour terms in two pairsab+3a+2b+6(a + 2)(b + 3)
Sum of two cubesa³ + b³ = (a + b)(a² − ab + b²)27x^3+8(3x + 2)(9x² − 6x + 4)
Difference of two cubesa³ − b³ = (a − b)(a² + ab + b²)x^3-8(x − 2)(x² + 2x + 4)
Rational rootDegree 3 or more2x^3+3x^2-11x-6(x − 2)(x + 3)(2x + 1)

It factors over the rational numbers, which means every number in the answer is a whole number or a fraction. That is the kind of answer school algebra expects.

Worked examples you can check in the calculator

Example 1: take out the common factor first

Factor 5x³ − 20x completely. Both terms share 5 and x, so take out 5x. What is left is a difference of two squares:

5x^3 - 20x = 5x\left(x^2 - 4\right) = 5x(x - 2)(x + 2)

The calculator gives 5x(x − 2)(x + 2) and lists both methods: common factor, then difference of two squares. Stopping at 5x(x² − 4) would not be factored completely.

Example 2: factoring trinomials with a = 1

Factor x² − 10x + 21. Find two numbers that multiply to 21 and add to −10. They are −7 and −3, because −7 × −3 = 21 and −7 + (−3) = −10:

x^2 - 10x + 21 = (x - 7)(x - 3)

Check by expanding: x² − 3x − 7x + 21 = x² − 10x + 21.

Example 3: trinomials with a ≠ 1, the ac method

Factor 3x² + 4x − 4. Here a = 3, b = 4 and c = −4, so ac = −12. The two numbers you want have a product of −12 and a sum of 4: they are 6 and −2. Use them to split the middle term, then factor each pair:

3x^2 + 4x - 4 = 3x^2 + 6x - 2x - 4
= 3x(x + 2) - 2(x + 2) = (3x - 2)(x + 2)

This is the method the calculator shows. The x method, or diamond method, finds the same two numbers: ac goes in the top of the X, b in the bottom, and the two numbers on the sides. Once you have them, split the middle term as above. Try one now, then press Mark to check it in our Algebra course.

Factor a quadratic into two brackets.

Press Mark to have your answer marked in the Algebra course.

Example 4: factoring by grouping

Factor ab + 3a + 2b + 6. Group the first two terms and the last two, take out a factor from each pair, and a common bracket appears:

ab + 3a + 2b + 6 = a(b + 3) + 2(b + 3) = (a + 2)(b + 3)

Grouping is how the calculator handles four-term cubics too. Load the Grouping example and it turns x³ + 3x² + 2x + 6 into (x + 3)(x² + 2).

Example 5: a cubic by the rational root theorem

Factor 2x³ + 3x² − 11x − 6. Any rational root is a factor of the constant term over a factor of the leading coefficient, so the candidates are ±1, ±2, ±3, ±6, ±1/2 and ±3/2. Try x = 2:

2(2)^3 + 3(2)^2 - 11(2) - 6 = 16 + 12 - 22 - 6 = 0

So (x − 2) is a factor. Divide it out to get 2x² + 7x + 3, then factor that trinomial:

2x^3 + 3x^2 - 11x - 6 = (x - 2)\left(2x^2 + 7x + 3\right) = (x - 2)(2x + 1)(x + 3)

The calculator finds x = −1/2 first, so its working divides out (2x + 1) instead, but the final answer is the same. For the division step on its own, use the Polynomial Division Calculator.

Example 6: a quartic that is a quadratic in disguise

Factor x⁴ − 5x² + 4. Treat x² as the letter: it is a trinomial whose numbers multiply to 4 and add to −5, which are −1 and −4. Each bracket is then a difference of two squares:

x^4 - 5x^2 + 4 = \left(x^2 - 1\right)\left(x^2 - 4\right) = (x - 1)(x + 1)(x - 2)(x + 2)

Solve by factoring: the roots

Factoring is the quickest way to solve many polynomial equations. If a product is zero, one of its factors must be zero. So once 3x² + 4x − 4 = 0 is factored as (3x − 2)(x + 2) = 0, either 3x − 2 = 0 or x + 2 = 0:

x = \frac{2}{3}\ \ \text{or}\ \ x = -2

The calculator lists these under Real roots, and its graph crosses the x-axis at both.

y = 3{ x}^{2}+4 x-4
-3.5-3-2.5-2-1.5-1-0.50.511.52-10-55101520x = −2x = 2/3
Drag to pan, scroll to zoom. x from -3.5 to 2, y from -10.1 to 23.6.

Here x is the variable and y is the value of the expression. Each root is a place where y = 0. Remember to move everything to one side first: you cannot factor x² + x = 12 as it stands, only x² + x − 12 = 0, which gives (x − 3)(x + 4) = 0.

When it says "cannot be factorised over the rationals"

Some expressions have no factors with whole-number or fraction coefficients. For a quadratic, the test is the discriminant, b² − 4ac: it factors over the rationals only when b² − 4ac is a perfect square. The calculator shows this check.

  • x² + x + 1 has b² − 4ac = −3. It has no real roots at all, and the calculator gives its complex roots instead.
  • x² − 2 has b² − 4ac = 8, which is not a perfect square. It has real roots, ±√2, but they are not rational, so it does not factor in school algebra.
  • x² + 4 is a sum of two squares. It never factors over the real numbers, which is why x⁴ − 16 stops at (x − 2)(x + 2)(x² + 4).

For roots like ±√2, use the quadratic formula or complete the square instead.

Common mistakes

  • Skipping the common factor. Factor 3x² − 12 as 3(x² − 4) first, then 3(x − 2)(x + 2). Missing the 3 makes the rest harder.
  • Stopping too early. "Factor completely" means keep going until no bracket splits further. (x² − 4)(x² + 4) is not finished.
  • Factoring a sum of squares. a² + b² does not factor over the real numbers. Only a difference of squares does.
  • Mixing up signs in cubes. In a³ − b³ = (a − b)(a² + ab + b²), the first bracket has the same sign as the original, and the last term is always plus.
  • Forgetting the leading coefficient. 3x² + 4x − 4 is not (x + 6)(x − 2). When a ≠ 1, use ac, not just c.
  • Not checking. Expand your answer. If you get back the original expression, it is right.

Practise factoring in a short timed paper

Factoring runs through Pre-Algebra & Algebra 1 and Geometry, Algebra 2 & SAT Math practice, and through GCSE Maths Higher in the UK. Each daily paper is a short timed paper of 8 questions worth 25 to 35 marks, and the papers mix topics. The Algebra course covers common factors, the diamond method and factoring quadratics, each with practice.

Common questions

What does factor completely mean?
Write the expression as a product where no factor can be broken down any further. 5x³ − 20x factored completely is 5x(x − 2)(x + 2), not 5x(x² − 4).
How do you factor a trinomial?
Take out any common factor. If the x² term has a coefficient of 1, find two numbers that multiply to c and add to b. If not, find two numbers that multiply to ac and add to b, split the middle term with them, and factor by grouping.
What is the x method of factoring?
A way to find the two numbers for a trinomial. Write ac at the top of an X and b at the bottom, then find the two numbers for the sides that multiply to the top and add to the bottom. It is the same as the ac method and the diamond method.
Can you factor x² + 4?
Not over the real numbers. A sum of two squares never factors that way. Over the complex numbers it is (x − 2i)(x + 2i), and the calculator shows the complex roots ±2i.
Can it factor expressions with two variables?
Yes. It handles several letters, such as 4x² − 9y² = (2x − 3y)(2x + 3y) or ab + 3a + 2b + 6 = (a + 2)(b + 3), and draws a factor tree instead of a graph.
How do I solve an equation by factoring?
Move every term to one side so it equals zero, factor, then set each factor equal to zero. The calculator lists the roots under Real roots.
Why did the calculator not factor my quadratic?
Its discriminant, b² − 4ac, is not a perfect square, so it has no factors with rational coefficients. Use the quadratic formula to find its roots instead.

Revision cards

Say the answer first, then flip the card to check it.

Where to go next

  • Solve it

    Factoring Calculator

    Factorise expressions and quadratics with full working

    Open the tool
  • Learn it

    Algebra

    Master equations, inequalities and the language of abstract mathematics

    Start the course
  • Test it

    Pre-Algebra & Algebra 1

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Maths · AlgebraHow to factor a quadratic equation: 6 methods, examplesHow to factor a quadratic equation step by step: common factors, x² + bx + c, the ac method, difference of squares, perfect squares and solving.