Factoring calculator

Type a polynomial in x with whole-number coefficients, such as 2x^3 - 12x^2 + 22x - 12, or a product like (x+1)(x-2). The tool takes out the common factor and finds every rational root.

Whole-number coefficients, degree up to 12, coefficients up to 1,000,000. Use + - * ^ and brackets: x^2 - 5x + 6, (x+1)(x-2). Factors are found over the integers; see the notes for what is not covered.
Factored form2(x - 1)(x - 2)(x - 3)
Expanded form
2x^3 - 12x^2 + 22x - 12
Rational roots
1, 2, 3
Step 1
Take out the common factor 2
Step 2
x = 1 makes the polynomial 0, so (x - 1) is a factor
Step 3
x = 2 makes the polynomial 0, so (x - 2) is a factor
Step 4
x = 3 makes the polynomial 0, so (x - 3) is a factor

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Type the polynomial. Implicit multiplication works: 2x^2, 3(x+1).
  2. Read the factored form, the roots and the numbered steps.
  3. Compare the expanded form with what you typed to be sure it was read as you meant.

How it works

By the rational root theorem, any rational root p/q of an integer polynomial has p dividing the constant term and q dividing the leading coefficient. For every candidate the exact value q^n · P(p/q) is computed in integers; a zero means (qx − p) divides the polynomial, and the division is exact by Gauss’s lemma. The step repeats for multiple roots.

Worked example

2x³ − 12x² + 22x − 12. The common factor is 2, leaving x³ − 6x² + 11x − 6. The constant −6 has divisors 1, 2, 3, 6; x = 1, 2 and 3 are roots, so the result is 2(x − 1)(x − 2)(x − 3).

Tips

  • Typing a product such as (x+1)(x-2) shows its expansion, handy for checking homework.
  • If the leftover factor is quadratic, the quadratic equation solver gives its irrational or complex roots.

Frequently asked questions

How does it find the factors?

It removes the greatest common divisor of the coefficients, then any power of x, then tests every rational number p/q where p divides the constant term and q divides the leading coefficient. Each root p/q gives a factor (qx − p), exactly, using big-integer arithmetic.

What is not covered?

Only factoring over the integers (rational roots). It does not find irrational or complex roots, and it does not look for products of higher-degree factors. It handles one variable only. A quadratic such as x² − 2 is reported as irreducible over the integers although its roots are ±√2.

Does it do difference of squares and perfect squares?

Yes, as a consequence of finding rational roots: x² − 9 becomes (x + 3)(x − 3) and x² + 6x + 9 becomes (x + 3)². Sums of squares like x² + 1 have no real roots and stay as they are.

Why is a minus sign put in front?

The leading coefficient of the linear factors is kept positive, so a negative leading coefficient is carried by the common factor: −x² + 1 becomes −(x + 1)(x − 1).

More in Math

All tools in this category: Math ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.