Exact roots, worked line by line — including the equations that will not factor.
Calculator
Solve ax² + bx + c = 0
Exact roots first — a surd stays a surd.
Fractions like 3/4 are fine
Include the minus sign if there is one
Zero is allowed
x² − 5x + 6 = 0
x = 2 or x = 3
As decimals: 2 and 3
Discriminant b² − 4ac
1
Two rational roots
Vertex
(5/2, −1/4)
Opens upward — this is the minimum
Sum of roots (−b/a)
5
Vieta's first formula
Product of roots (c/a)
6
Vieta's second formula
Vertex form
(x − 5/2)² − 1/4
Completing the square gives this directly
Factored form
(x − 2)(x − 3)
Multiply it back out to check
Filled dots are the roots; the open dot is the vertex.
Working, one line at a time
1Identify a, b and ca = 1, b = −5, c = 6The sign belongs to the coefficient. In x² − 7x + 12, b is −7, not 7.
2Substitute into the formulax = (−(−5) ± √((−5)² − 4 × 1 × 6)) / (2 × 1)Write the brackets before evaluating anything — they are what keeps the signs right.
3Square b, and multiply out 4ac(−5)² = 25, 4 × 1 × 6 = 24A negative b squares to a POSITIVE number. This is the step that goes wrong most often.
4The discriminant, b² − 4ac25 − 24 = 1Two different real roots, both rational — so the quadratic factors over the rationals.
5Take the square root√1 = 1 exactlyA perfect square under the radical is what makes the roots rational — and it means the quadratic factors.
6Split the ±x = (5 − 1) / 2 and x = (5 + 1) / 2
7The two roots2 and 3
8Check with Vietasum = −b/a = 5, product = c/a = 6Add the two roots and multiply them. If either does not match, a sign went astray above.
Roots verified against Vieta’s formulas in exact arithmetic — no rounding anywhere above.
What this tool covers
The formula that always works, on the equations where it is the only thing that does — including the ones with irrational roots, the ones with no real roots at all, and the sign traps that make the rest of them go wrong.
Roots from a, b and c, or from an equation typed with terms on both sides
Exact answers — √2 rather than 1.414…, and a conjugate pair for a negative discriminant
The discriminant, and what its sign says about the roots before you find them
Vertex, axis of symmetry, factored form, and a check by Vieta’s formulas
Exact roots, surds kept as surds Every line of the working shown Complex roots, not “no solution” Free, no signup
Free, no signup — exact arithmetic, nothing rounded.
Updated 6 September 2026 · Works in any browser, no installation
The quadratic formula is x = (−b ± √(b² − 4ac)) ÷ 2a, and it solves every equation of the form ax² + bx + c = 0 with a ≠ 0 — including the ones that will not factor. For x² − 5x + 6 = 0 it gives x = 2 and x = 3; for x² + x − 1 = 0 it gives (−1 − √5)/2 and (−1 + √5)/2, which no amount of factoring would have found.
At a glance
Formula shown
x = (−b ± √(b² − 4ac)) / 2a. Discriminant Δ = b² − 4ac. Vertex at x = −b/2a. Sum of roots = −b/a, product = c/a.
Scenario support
Three coefficients, or a typed equation with terms on either side of the equals sign.
Educational estimate
Planning support from the values you enter — not professional advice.
One formula, and where it comes from
The roots
x = (−b ± √(b² − 4ac)) / 2a
Works for every a ≠ 0, factorable or not.
The discriminant
Δ = b² − 4ac
Its sign decides the roots before you find them.
The vertex
x = −b / 2a
Exactly halfway between the two roots.
The formula is not a rule handed down to be memorised — it is what you get when you complete the square on ax² + bx + c = 0 in general rather than on one particular equation. Divide through by a, move the constant across, add the square of half the x coefficient to both sides, and the left becomes a perfect square that can be square-rooted. The ± appears at exactly that step, because a positive number has two square roots and both of them are answers. The full derivation, one line at a time, is on the Completing the Square Calculator.
That origin explains the two things about the formula that look arbitrary. The 2a underneath is the a you divided by, brought back; and the b² − 4ac under the radical is what is left of the constant term after the square has been completed. It also explains why the vertex sits at −b/2a: that is the ±√… term set to zero, which is the midpoint of the two roots whether or not those roots are real.
Where the minus signs go wrong — nearly every time
The algebra in the formula is not what people get wrong. The signs are. Take x² − 7x + 12 = 0, where b is −7, and watch the two places it bites:
−b is +7, not −7. The formula asks for the negative of b, and b is already negative, so the two minuses cancel. Writing −7 there shifts both roots and usually produces two answers that are the negatives of the right ones — plausible enough to hand in.
(−7)² is +49, not −49. Squaring kills the sign. Typing -7^2 into a calculator gives −49 on most of them, because the exponent binds tighter than the minus. The brackets are not decoration.
Subtracting a negative 4ac adds. In 2x² + 5x − 3 = 0, 4ac is 4 × 2 × (−3) = −24, and b² − (−24) is 25 + 24 = 49. Dropping that bracket turns a discriminant of 49 into 1 and the roots into nonsense.
The working printed by the calculator above shows the substitution as its own line, brackets and all, before anything is evaluated. That is deliberate: the mistake is almost never in the arithmetic that follows, it is in the line where the numbers were written down.
One more, less common but harder to spot: the equation has to be in standard form first. If it reads x² = 5x − 6, then b is not 5 and c is not −6 — everything has to come to one side, giving x² − 5x + 6 = 0. The equation box on this calculator does that subtraction for you and shows you the standard form it ended up with.
What b² − 4ac tells you before you solve anything
The discriminant is the part under the radical, and its sign settles the whole character of the answer without finishing the calculation:
Δ > 0 and a perfect square — two rational roots, and the quadratic factors over the integers. x² − 5x + 6 = 0 has Δ = 1, and it factors as (x − 2)(x − 3).
Δ > 0 but not a perfect square — two real roots, both irrational, and no integer factorisation exists. x² + x − 1 = 0 has Δ = 5, and its roots (−1 − √5)/2 and (−1 + √5)/2 are the golden ratio and its conjugate.
Δ = 0 — one root, repeated. 4x² − 12x + 9 = 0 gives x = 3/2 twice, and the parabola touches the axis rather than crossing it. This is also exactly the condition for a perfect square trinomial.
Δ < 0 — no real roots. x² + 2x + 5 = 0 has Δ = −16, and the solutions are the conjugate pair −1 + 2i and −1 − 2i. “No solution” is only true if you have agreed in advance to stay inside the real numbers, and most courses have not.
Because the sign is what matters, it has to be decided exactly. A discriminant computed in floating point can come out as −0.0000000001 when the true value is zero, and the answer flips from a repeated real root to a complex pair on nothing but rounding error. This page holds every coefficient as an exact fraction and clears the denominators before testing the sign, so that particular failure cannot happen here. The Discriminant Calculator takes the same quantity further — into cubics, quartics, and the second-derivative test that shares the name in multivariable calculus.
√2 is the answer; 1.4142136 is a rounding of it
Most quadratic calculators report decimals, and for the majority of real equations that is the wrong output. The roots of x² + x − 1 = 0 are (−1 − √5)/2 and (−1 + √5)/2 — exact, finite to write, and the form every marking scheme expects. Their decimals, −1.618034 and 0.618034, are approximations that cannot be un-rounded.
Getting the exact form right means two separate pieces of care. The radical has to be simplified rather than left as it fell out: √8 is 2√2, and a page that prints √8 has done the algebra and stopped one step early. And the fraction has to reduce, which is where a common factor between −b, the surd part and 2a gets cancelled — 2x² + 5x − 3 = 0 produces 1/2 rather than an unreduced equivalent.
When the roots are rational, the exact answer buys something else: the factorisation. 2x² + 5x − 3 = 0 factors as (x + 3)(2x − 1), and you can read that straight off the roots, writing a root of p/q as the factor (qx − p) so the factors stay over the integers. That is the same object the Factoring Trinomials Calculator hunts for by trial, arrived at from the other end.
Checking the answer in your head
Two relations hold between the roots and the coefficients of any quadratic, and they are quick enough to run mentally on every answer:
The roots add to
−b / a
Twice the vertex’s x, which is why the vertex is the midpoint.
The roots multiply to
c / a
Catches a wrong sign that the sum alone can miss.
For x² − 5x + 6 = 0: the roots 2 and 3 add to 5 and multiply to 6, which is −b/a and c/a exactly. For 2x² + 5x − 3 = 0, with the fractional root, they add to −5/2 and multiply to −3/2. Both checks pass, and both would have failed if a sign had gone astray in the substitution.
The check works for irrational and complex roots too, and is often easier there than re-doing the surd arithmetic: the two conjugate roots’ irrational parts cancel in the sum and multiply to a rational in the product. It is the fastest way to know an answer is wrong without knowing what the right one is.
When factoring is faster, and when it cannot work at all
The formula always works, which is not the same as it always being the quickest route. Three methods solve a quadratic and they agree on the answer every time:
Factoring is fastest when it works and useless when it does not, and the discriminant tells you which in advance: it factors over the rationals precisely when Δ is a perfect square. Guessing at factors for x² + x − 1 = 0 is time spent on an equation that has none.
Completing the square is slower per equation but gives the vertex form for free, which is what you want if the question is about a maximum, a minimum, or a graph rather than about the roots.
The formula is the one to reach for when a and the coefficients are awkward, when the discriminant is not a square, or when you simply want the answer without deciding first which method suits.
A fourth case is worth naming because it looks like a quadratic and is not: if a is zero the x² term vanishes and the equation is linear, with one root at −c/b. Dividing by 2a would be dividing by zero. The calculator above detects that and solves the linear equation instead of refusing, because a reader who typed it needs the root.
On a Casio, a TI-84, and in a spreadsheet
Handheld calculators solve quadratics, and each hides it somewhere different:
Casio fx-991EX / fx-991ES PLUS. The polynomial solver is under MENU → Equation/Func, then Polynomial, then degree 2. Enter a, b and c; the classwiz models return exact surd roots, and older ES models return decimals unless the display is set to MathIO.
TI-84 Plus. There is no built-in quadratic solver on a stock unit — the usual routes are PlySmlt2 from the APPS menu, which does degree 2 and 3, or the graph’s 2nd → CALC → zero, which finds real roots one at a time and finds none at all when the discriminant is negative.
Excel or Google Sheets. With a in A1, b in B1 and c in C1, the two roots are =(-B1+SQRT(B1^2-4*A1*C1))/(2*A1) and the same with a minus. Both return #NUM! when the discriminant is negative, because SQRT has no complex mode; guard with =IF(B1^2-4*A1*C1<0,"complex",…) rather than letting the error propagate.
All three give decimals by default. That is the gap this page fills: the exact root is the answer, and the decimal is a convenience beside it. There is nothing to download and no account to create — the calculator runs entirely in your browser, on desktop or mobile, and the numbers you type are never sent anywhere.
Read the guide
The section above stops short of saying which method to reach for, because that question is bigger than this page. Factoring, Completing the Square, or the Quadratic Formula — Which to Use answers it with a decision rule you can run in seconds: evaluate the discriminant first, and let its shape choose the method before you commit to one. It works 2x² + 5x − 3 = 0 through all three routes side by side, so you can see exactly where they diverge and where they land on the same two roots.
Sources and methodology
The formula and Vieta’s relations are derived above rather than cited — they are theorems with proofs, not figures from a document, and asserting them on someone else’s authority would be the weaker claim. What is cited below is the part that belongs to somebody else: what a spreadsheet does with these formulas, and the standard reference definitions of the discriminant.
Method. Every number on this page — the calculator, the working, and each worked example in the prose above — comes from one engine, src/lib/quadratic-formula.ts, over the exact-rational core in src/lib/algebra/, so nothing here can disagree with the tool. Coefficients are held as BigInt fractions and the equation is cleared to integers before the discriminant’s sign is tested, which is why a repeated root is never misreported as a complex pair. That engine is verified on every change against 50 hand-written assertions — including an exhaustive sweep confirming that every factored form it prints multiplies back to the polynomial it came from. The count and the per-case breakdown are published on the formula verification page.
Related calculators
The rest of the quadratic toolkit:
Completing the SquareRewrite ax² + bx + c as a(x − h)² + k with every step shown, solve by the method, or find the constant that completes a square — all in exact fractions.
DiscriminantEvaluate b² − 4ac, the cubic and quartic discriminants, or D = f_xx·f_yy − (f_xy)² for the second-derivative test, in exact arithmetic so the sign is never a rounding artefact.
Factoring TrinomialsFactor a trinomial by the AC method with every factor pair of ac listed, the common factor taken out first, and the answer multiplied back out to check it.
ScientificTrigonometry, logarithms, powers, roots, and factorials with correct order of operations, memory registers, history, and keyboard entry.
Standard DeviationSample and population standard deviation, plus variance, mean, median, quartiles, z-scores, outliers, and confidence intervals.
PercentageSolve X% of Y, what percent X is of Y, reverse percentage, increase/decrease, discounts, and tax, tip, or commission.
This calculator solves quadratic equations in one variable and shows the working. The arithmetic is exact — coefficients are held as fractions rather than decimals, so the discriminant’s sign and any factorisation are decided without rounding. It is a study and checking aid, not a substitute for understanding the method: an answer copied without the steps is worth nothing in an exam, and the working is printed for exactly that reason. Where a quadratic models something physical — a trajectory, a break-even point, a dosage — the algebra here says nothing about whether the model is the right one or whether a negative root makes sense in that context.
Factoring, Completing the Square, or the Quadratic Formula — Which to Use
Three methods solve every quadratic and they always agree. Which one is actually fastest is settled by a single number you can check first: the discriminant.
Published the quadratic formula calculator: exact roots from three coefficients or a typed equation with terms on both sides, with the substitution written out before it is evaluated.
Roots are reported exactly — surds stay surds and a negative discriminant returns the complex conjugate pair rather than "no solution" — with the decimal shown beside them as a secondary readout.
Added to the Math category as the first tool in a new Algebra subcategory, alongside the discriminant, completing-the-square and factoring calculators published the same day.
Add this calculator to your site
Responsive embed — and private: nothing your visitors type leaves their browser.