Factor quadratic calculator
Enter a, b and c and get the quadratic factored into two binomials: x² − 5x + 6 becomes (x − 2)(x − 3). When no rational factors exist, the result says so plainly. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A
- 1
- B
- -5
- C
- 6
- Polynomial
- x^2 - 5*x + 6
- Discriminant
- 1
- Content
- 1
- Factored form
- (x - 2)(x - 3)
Factoring a quadratic polynomial means rewriting a times x squared plus b times x plus c as a product of two degree-one binomials whenever that product exists with rational coefficients. This calculator takes three finite numbers a, b, and c, rejects a zero leading coefficient so the input stays genuinely quadratic, and either returns an explicit factorization such as content times open parenthesis p x plus q close parenthesis times open parenthesis r x plus s close parenthesis, or reports that the quadratic is irreducible over the rationals. Irreducibility over the rationals is decided exactly: after clearing denominators the discriminant of the integer model must be a perfect square, which is equivalent to the existence of rational roots and of rational binomial factors. Classic classroom checks include x squared minus five x plus six becoming open parenthesis x minus two close parenthesis open parenthesis x minus three close parenthesis, six x squared plus five x plus one becoming open parenthesis two x plus one close parenthesis open parenthesis three x plus one close parenthesis, and x squared plus one remaining irreducible over Q even though it factors over the complexes.
How rational factoring of ax² + bx + c works
A second-degree polynomial with rational coefficients factors non-trivially over the rationals if and only if it has a rational root, which for degree two is equivalent to its discriminant being the square of a rational number. In practice the calculator first recovers exact fractions for a, b, and c from ordinary finite inputs using continued-fraction approximation so that textbook decimals and integers stay exact, then multiplies through by the least common multiple of the denominators to obtain an integer model A x squared plus B x plus C.
Factoring that integer quadratic is performed by searching divisor pairs: the leading coefficient A splits as p times r and the constant term C splits as q times s so that the cross identity p s plus q r equals B. When such integers exist, the original polynomial is recovered as a rational content scale times the product of the two binomials p x plus q and r x plus s.
When no such pair exists, the discriminant of the integer model is not a perfect square and the response marks the quadratic irreducible over the rationals. This is stricter than factoring over the reals: x squared minus two is irreducible here even though it factors with square roots, because those factors are not rational.
Complex factorizations such as x squared plus one equals open parenthesis x minus i close parenthesis open parenthesis x plus i close parenthesis are also out of scope; students who need roots in re or im form should use a quadratic formula solver instead. Coefficients must be finite; infinity and NaN are rejected. The special case a approximately zero is rejected with invalid input because division of degree would drop and the problem would no longer be quadratic.
Where quadratic factoring shows up in real work
Secondary-school and college algebra courses constantly assign factor-by-grouping, AC-method, and reverse-FOIL drills; a single trusted oracle that returns binomial factors or an honest irreducible flag speeds grading and demo setup without inventing irrational or complex factors that the rubric does not allow. Programming contest warm-ups and interview screens often hide a factorable quadratic inside integer Diophantine constraints, and engineers need the integer binomial form rather than floating roots that round poorly.
Symbolic pre-processing in calculators and CAS front-ends uses rational factoring as a cheap first pass before invoking heavier algorithms for higher degree. Physics and finance notebooks sometimes need to rewrite a quadratic cost or constraint into linear factors before applying partial fractions or sign-chart analysis, and refusing a equals zero avoids mislabeling a linear model as quadratic. If you later need closed-form complex roots, cubic factorizations, or factoring over finite fields, treat those as separate search intents and landings rather than overloading this rational binomial factoring page.
What you can do with it
Homework and exam answer keys
Generate exact binomial factors or an irreducible-over-Q flag for textbook ax²+bx+c sets so teachers and auto-graders share one ground truth.
AC-method and reverse-FOIL drills
Check classroom factoring steps against divisor-pair factorizations with integer content, including repeated factors and non-monic leading coefficients.
Preprocessing before partial fractions
Rewrite rational quadratics into linear factors over Q when possible before sign charts, partial fractions, or integer constraint solves.
FAQ
When is a quadratic factorable over the rationals?
When its discriminant is the square of a rational (equivalently, when it has a rational root). This tool then returns two binomials with rational or integer coefficients and an optional content scale.
What happens if a is zero?
Factoring a quadratic requires a non-zero quadratic coefficient; a linear binomial bx + c is a different problem.
Is x² − 2 factorable here?
No. It factors over the reals with √2, but not over the rationals, so the response sets irreducible to true. That matches standard algebra curricula.
How is this different from a quadratic formula solver?
A formula solver returns roots (possibly complex). This calculator returns binomial factors over Q or reports irreducible over Q. Different search intent, different landing.
What does it cost?
The browser tool is free and runs locally.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/algebra/factor-quadratic \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":1,"b":-5,"c":6}'const res = await fetch("https://api.kit.forhosting.com/algebra/factor-quadratic", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": 1,
"b": -5,
"c": 6
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/factor-quadratic",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": 1,
"b": -5,
"c": 6
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/factor-quadratic", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":1,"b":-5,"c":6}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":1,"b":-5,"c":6}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/factor-quadratic", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a": 1,
"b": -5,
"c": 6
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.factor_quadratic",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The free browser tool and the paid API share one pure deterministic function, so homework demos, answer keys, and automated pipelines never diverge on the same coefficients.
How rational factoring of ax² + bx + c works
The entire path is deterministic with no random seeds, clocks, or network calls, so identical coefficients always produce identical JSON.
What you send and what you get back
Send three finite numbers under the fields a, b, and c representing the coefficients of a x squared plus b x plus c. All three fields are required. Classic textbook checks: a equals one, b equals negative five, c equals six yields open parenthesis x minus two close parenthesis open parenthesis x minus three close parenthesis; a equals six, b equals five, c equals one yields open parenthesis two x plus one close parenthesis open parenthesis three x plus one close parenthesis; a equals one, b equals zero, c equals one is irreducible over the rationals; a equals two, b equals four, c equals two yields two times open parenthesis x plus one close parenthesis squared in product form. Missing fields, non-numeric strings, NaN, and Infinity fail with invalid_input and are not charged. When a is zero or extremely close to zero the request fails with a clear message that factoring a quadratic requires a nonzero quadratic term, so clients can switch to a linear tool rather than guessing. On success the response echoes cleaned coefficients, a printable polynomial string, the discriminant, boolean flags factorable and irreducible, and when factorization exists a content scale, an array factors of two objects each with coeff_x, const, and a binomial string, plus a compact factored_form string suitable for display. A cleared_integer object shows the integer coefficients A, B, C and the denominator scale used for exact arithmetic, which is useful when debugging fractional inputs. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.
Where quadratic factoring shows up in real work
Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.