Math & Statistics

Factoring Calculator

Factor a polynomial completely over the rational numbers, with the method explained step by step: greatest common factor, trinomials, difference of squares, sum and difference of cubes, grouping and the rational root test. Switch to Integer mode for prime factorization.

Free, runs in your browserUpdated October 2026
What do you want to factor?
Type it expanded, using ^ for powers: 2x^3 + 4x^2 - 8x - 16. Fractions like 1/4 are fine.
Examples
Factored form
–
 –
 –
 –
 –
Steps

    Factoring calculator diagram: 6x² + 11x − 10 factored by the a × c method into (3x − 2)(2x + 5)
    How the Factoring Calculator works: Fully factored polynomials with every step, from trinomials to cubics.

    How to Use the Factoring Calculator

    How to use the factoring calculator: choose polynomial or integer, type the expression, try an example, read factors
    Numbered steps on the Factoring Calculator. Follow them in order.
    1. Choose Polynomial to factor an expression, or Integer for prime factorization.
    2. Type the polynomial in expanded form, using ^ for powers.
    3. Or tap an example such as a trinomial or difference of squares.
    4. Read the factored form, the rational roots and the numbered steps.

    Type a polynomial in expanded form, such as 6x^2 + 11x - 10, using ^ for powers. The factoring calculator rewrites it as a product of simpler polynomials and lists the steps, naming each technique it has used.

    Coefficients can be whole numbers, decimals or fractions, and any single letter can be the variable. The tool will factor completely over the rational numbers and also shows the real roots that each factor produces.

    Example buttons load a trinomial, a difference of squares, a sum of cubes, a grouping problem, a GCF case and a cubic. Switch to integer mode to factor a whole number into its primes instead.

    The Order to Try Factoring Methods

    Factoring is quickest when you test methods in a fixed order. The calculator follows the same checklist a teacher would, which makes its steps easy to copy onto homework or check against your own work.

    1. Take out the greatest common factor (GCF): 3x³ − 12x = 3x(x² − 4).
    2. Two terms: check for a difference of squares, a sum of cubes or a difference of cubes.
    3. Three terms: check for a perfect square trinomial, then use the ac method.
    4. Four terms: try factoring by grouping.
    5. Anything else: use the rational root test to find linear factors, then divide.
    6. Check every factor again until none can be factored further.

    Always start by removing the GCF, because it shrinks the numbers in every later step. For 3x³ − 12x, removing 3x leaves x² − 4, a difference of squares, so the full answer is 3x(x − 2)(x + 2).

    Keep checking every new factor until nothing more splits. For x⁴ − 16, the difference of squares gives (x² − 4)(x² + 4), and the first factor then splits again, giving the complete answer (x − 2)(x + 2)(x² + 4).

    Factoring Formulas for Special Patterns

    A handful of factoring formulas cover the special patterns. Recognizing them saves time, because a binomial or trinomial that matches one factors in a single step with no need to search through possible number pairs.

    a² − b² = (a − b)(a + b)
    a² + 2ab + b² = (a + b)²   a² − 2ab + b² = (a − b)²
    a³ + b³ = (a + b)(a² − ab + b²)
    a³ − b³ = (a − b)(a² + ab + b²)

    For a sum of cubes, 8x³ + 27 is (2x)³ + 3³, so it factors as (2x + 3)(4x² − 6x + 9). A difference of cubes works in exactly the same way: x³ − 8 becomes (x − 2)(x² + 2x + 4).

    A perfect square trinomial such as x² − 6x + 9 becomes (x − 3)². The calculator names each pattern in its steps, so you can see exactly which rule applied and practice spotting it yourself next time.

    Factoring Trinomials: The AC Method

    For ax² + bx + c, the ac method finds two numbers that multiply to a × c and add to b. Use them to split the middle term, then factor the resulting four terms by grouping them.

    • a × c = 6 × (−10) = −60. The numbers 15 and −4 multiply to −60 and add to 11.
    • Split the middle term: 6x² + 15x − 4x − 10.
    • Group: 3x(2x + 5) − 2(2x + 5).
    • Take out the common binomial: (3x − 2)(2x + 5).

    Worked example: 6x² + 11x − 10 factors neatly as (3x − 2)(2x + 5), with roots 2/3 and −5/2. Check by expanding: 6x² + 15x − 4x − 10 gives back the original trinomial exactly, which confirms the factorization is right.

    The method works for any leading coefficient. When a × c is positive, both numbers share a sign; when it is negative, they have opposite signs. That rule roughly halves the number of pairs worth trying.

    The Rational Root Test and Grouping

    When no special pattern fits, the rational root test lists every possible candidate root of a polynomial that has integer coefficients: ±p ÷ q, where p divides the constant term and q divides the leading coefficient.

    For the cubic x³ − 2x² − 5x + 6 the candidates are ±1, ±2, ±3 and ±6. Testing them shows 1, −2 and 3 are roots, so it factors into linear factors as (x + 2)(x − 1)(x − 3).

    Four terms often yield to grouping. For 2x³ + 4x² − 8x − 16, remove the GCF of 2, group into x²(x + 2) − 4(x + 2), and finish with 2(x − 2)(x + 2)². Synthetic division speeds up dividing by hand.

    When a Polynomial Cannot Be Factored

    Some polynomials are simply prime over the rationals. The calculator marks x² + x + 1 as one that cannot be factored, because its discriminant, b² − 4ac, is negative and it has no real roots at all.

    A quadratic like x² − 2 has irrational roots, ±√2, so it stays whole over the rationals, and the calculator shows its approximate roots instead. A sum of squares such as x² + 4 needs complex numbers.

    Surprises can happen at a higher degree. x⁴ + 4 has no real roots yet factors as (x² − 2x + 2)(x² + 2x + 2), which the calculator finds by searching for quadratic factors as well as linear ones.

    Prime Factorization of a Number

    In integer mode the calculator gives the prime factorization, the number of divisors, the sum of divisors and a full list of factors. It also tells you whether the number itself is prime or composite.

    By hand, trial division, which also reveals factor pairs, divides by the smallest prime that fits, then repeats on the quotient. For 360 that gives 2³ × 3² × 5, with 24 divisors whose sum is 1,170.

    Large numbers need faster methods. The tool combines probabilistic prime testing with Pollard's rho, so 600851475143 splits instantly into 71 × 839 × 1,471 × 6,857. The OpenStax prime factorization lesson teaches the manual method step by step.

    What the Calculator Does Not Do

    Results are always exact, and polynomials factor over the rational numbers, which is exactly what most algebra courses mean by factor completely, as in the OpenStax College Algebra chapter on factoring polynomials and special products.

    Only one variable is supported, and the input must be expanded, without brackets. From degree 6 upward, factors of degree 3 or higher that have no rational roots are not searched for by the tool.

    Integer mode handles numbers up to about 40 digits, unless they have two very large prime factors, which take too long. Decimals such as 12.5 are rejected, while negative integers get a factor of −1.

    Frequently asked questions

    How do I factor a trinomial?

    For ax² + bx + c, find two numbers that multiply to a × c and add to b, split the middle term with them, and factor by grouping. For x² − 5x + 6 the numbers are −2 and −3, giving (x − 3)(x − 2).

    What does it mean to factor completely?

    It means writing the expression as a product where no factor can be factored any further using whole-number or fraction coefficients. For example, x⁴ − 16 factors completely as (x − 2)(x + 2)(x² + 4).

    Why can x² + 4 not be factored?

    A sum of two squares has no real factors, because x² + 4 = 0 has no real solutions. It only factors using complex numbers, as (x − 2i)(x + 2i), which most algebra courses do not require.

    What is the first step in factoring any polynomial?

    Take out the greatest common factor. It makes every later step simpler and is easy to forget. For 3x³ − 12x, removing 3x first leaves the simpler difference of squares x² − 4.

    How do I find the prime factorization of a number?

    Keep dividing by the smallest prime that divides evenly until the quotient is 1. For 84: 84 ÷ 2 = 42, 42 ÷ 2 = 21, 21 ÷ 3 = 7, so 84 = 2² × 3 × 7.

    Can all trinomials be factored?

    No. Over the rationals, ax² + bx + c factors only when the discriminant b² − 4ac is a perfect square. Otherwise the roots are irrational or complex, and the calculator reports the trinomial as prime.