Factoring Calculator

Type a polynomial such as x^2 - 5x + 6, or a whole number such as 360, and this factors it completely. Every step is named the way you were taught it, the method is explained rather than hidden, and the answer is always checked by multiplying it back out.

One variable. Write powers as x^2 or paste x², either works.
Put this calculator on your website for free

Copy one snippet and give your visitors a working Factoring Calculator.

Which method applies, and how to tell

Almost every factoring problem you will be set is one of five shapes. The hard part is not the working, it is recognising which shape you are looking at, so start by counting the terms.

What you seeWhat it isWhat to do
Anything at allCommon factorCheck this first, every time
Two terms, a minus, both squaresDifference of squaresa² − b² = (a − b)(a + b)
Two terms, both cubesSum or difference of cubesa³ ± b³ = (a ± b)(a² ∓ ab + b²)
Three termsTrinomialThe AC method
Four termsGroupingSplit into pairs, factor each

The first row is the one people skip and it is the one that costs marks. Pulling out a common factor makes everything after it smaller, and a problem that looks impossible often becomes a standard one the moment you do.

The AC method, which is the one worth learning properly

For a trinomial ax² + bx + c, multiply a × c, then find two numbers that multiply to that product and add to b. Take 2x² + 7x + 3:

That last step is the whole point of the method. When the same bracket comes out of both pairs, you are finished, and if it does not, you have either made an arithmetic slip or the polynomial does not factor.

Some things genuinely do not factor

This matters more than it sounds. x² + 1 does not factor. Neither does x² − x − 1, even though it looks like an ordinary trinomial. They are irreducible over the rationals, which means there is no way to write them as a product of polynomials with whole number coefficients.

Plenty of tools will hand you brackets anyway, full of decimals like (x − 1.618)(x + 0.618). Those are approximations to the roots, not a factorisation, and if you write them down as an answer it will be marked wrong. This page tells you when something will not factor, because that is the answer.

How the calculator actually does it

Underneath the named patterns sits one general tool: the rational root theorem. For a polynomial with whole number coefficients, any rational root written in lowest terms as p/q must have p dividing the constant term and q dividing the leading coefficient.

That turns an infinite search into a short list. For x³ − 6x² + 11x − 6, the constant is 6 and the leading coefficient is 1, so the only candidates are ±1, ±2, ±3 and ±6. Testing them finds 1, 2 and 3, and the polynomial is (x − 1)(x − 2)(x − 3).

Each root found peels off a factor by synthetic division, and the process repeats on what is left until nothing more divides. When the list runs out with nothing found, the polynomial is irreducible, and that conclusion is a proof rather than a guess.

Always multiply it back out

This page checks every answer by multiplying the factors back together and comparing to what you typed. It costs nothing and it is the reason you can trust the result.

Do the same by hand. Factoring goes wrong through sign errors far more often than through method errors, and expanding the brackets catches a sign error in about ten seconds. If it does not multiply back to what you started with, something is wrong, and you have found it before your teacher did.

Numbers factor too

Enter a whole number instead and you get its prime factorisation, which is the same idea applied to arithmetic: break it down until every piece is something that cannot be broken further. 360 becomes 2³ × 3² × 5.

Both kinds of factorisation are unique. For numbers that is the fundamental theorem of arithmetic, and it is the reason the answer above is the answer rather than an answer. Two people factoring the same thing correctly will always agree, which is not true of most things in mathematics.

Use it to check yourself, not to replace yourself

The steps above are named the way your teacher names them for a reason. An exam asks for the working, not the answer, so the useful way to use this page is to factor the thing yourself first and then see whether the method you picked was the one that applied.

If your answer and this one disagree, expand both. One of them will fail to multiply back, and finding out which is a better lesson than either answer on its own.

For the greatest common factor of several numbers the GCF calculator shows both standard methods, and once something is factored, solving for x is usually the next step, since a product equals zero exactly when one of its factors does.

Frequently asked questions

How do you factor a polynomial?

Take out any common factor first, then look at how many terms are left. Two terms is usually a difference of squares or cubes. Three terms is a trinomial, where you multiply the first and last coefficients and look for two numbers that multiply to that and add to the middle one. Four terms usually means grouping. This page checks each of those in turn and tells you which one applied.

What is the AC method?

For a trinomial written as ax squared plus bx plus c, multiply a by c, then find two numbers that multiply to that product and add to b. Those two numbers split the middle term into two, which turns three terms into four, and then you factor by grouping. It is the reliable version of guess and check.

What if the polynomial will not factor?

Then this page says so, which is a real answer rather than a failure. A polynomial like x squared plus 1, or x squared minus x minus 1, is irreducible over the rational numbers. Any calculator that hands you brackets for those is giving you decimal approximations dressed up as factors, and your teacher will notice.

How does the calculator find the factors?

Underneath the named patterns it uses the rational root theorem. For a polynomial with whole number coefficients, any rational root has a numerator that divides the constant term and a denominator that divides the leading coefficient, so there is only a finite list of candidates. It tries them all, and every root found peels off a factor before it repeats on what is left.

What is the difference between factoring and prime factorisation?

They are the same idea applied to different objects. Prime factorisation breaks a whole number into primes, and factoring breaks a polynomial into polynomials that cannot be broken further. Both are unique, both stop at things that cannot be split, and this page does whichever one your input calls for.

How do I recognise a difference of squares?

Two terms, a minus between them, and both terms are perfect squares. It factors as a minus b times a plus b, every time, with no working needed. It is the single most useful pattern to know on sight, and it is worth learning that a sum of squares does not factor the same way.

Can it factor with two variables?

No, and it says so rather than guessing. Factoring in several variables is a genuinely harder problem, and giving you a confident wrong answer would be worse than telling you the honest limit.

Why does the calculator multiply the answer back out?

Because that is the check, and it costs nothing. If the factors multiply back to what you started with, the factorisation is right. It is also the check worth doing by hand, since it catches a sign error immediately, which is the most common mistake in this whole topic.

Related calculators