Quadratic equation solver

The two solutions and the written working, ready to copy into your notebook.

x² − 5x + 6 = 0

Recalculates as you type; with a = 0 it becomes a linear equation.

The two solutions x₁3 x₂2
Discriminant (Δ)
1
Vertex
(2.5, −0.25)
Factorisation
(x − 3)(x − 2)

Step by step

Δ = b² − 4ac = (−5)² − 4·1·6 = 25 − 24 = 1

x = (5 ± √1) / 2·1 = (5 ± 1) / 2

x₁ = 3x₂ = 2

Check: x₁ + x₂ = 5 = −b/a · x₁ · x₂ = 6 = c/a

Try it with:

100% private — the maths happens on your device. The numbers you type are not sent to any server.

Pure arithmetic: there are no rates here that expire and no tables that go stale. The solutions are worked out with the numerically stable form of the quadratic formula — the one that does not lose digits when b² is far larger than 4ac — and rounded to ten significant figures when displayed, never before the calculation. When the coefficients are whole numbers the exact solution is shown too, which is the one you write in an exam.

The parabola, and where the solutions are

The solutions are not a number that falls out of a formula: they are the points where the curve crosses the X axis. Seeing it drawn is what explains all three cases at once.

The parabola crosses the X axis at x₁ = 3 and x₂ = 2: those two crossings are the solutions. The vertex, the lowest point of the curve, is at (2.5, −0.25).

How to solve a quadratic equation, and where it usually goes wrong

A quadratic equation is anything that can be written as ax² + bx + c = 0 with a ≠ 0. The formula that solves all of them is the same one everybody memorises: x = (−b ± √(b² − 4ac)) / 2a. Everything interesting is hiding under that square root.

The discriminant decides everything before you start

That expression under the root, Δ = b² − 4ac, is the discriminant, and it tells you how many solutions there are without working any of them out:

Δ > 0 — two different real solutions. The ± genuinely splits into two, and the parabola crosses the X axis at two points. Δ = 0 — one double solution. The root is zero, so the ± adds and subtracts nothing and both answers collapse into the same one; the parabola touches the axis without crossing it. Δ < 0 — no real solutions, because no real number squared gives a negative. The parabola passes entirely above or entirely below the axis. There are still two complex conjugate solutions, and this page shows them.

When a = 0 it is not a mistake, it is a different equation

Plenty of solvers refuse to answer when a = 0. There is nothing to refuse: the x² term disappears and what is left is bx + c = 0, a linear equation solved directly as x = −c/b. Its graph is a straight line rather than a parabola, and it has exactly one solution. If b is zero too, there is no x left anywhere: the equation either states something false (no solution) or something trivially true, 0 = 0 (infinitely many solutions).

The answer your calculator gets wrong

This one is worth knowing about, because it is invisible. Take x² + 100000000x + 1 = 0. The discriminant is 10¹⁶ − 4, and its square root is almost exactly 100000000. So working out the smaller root with the textbook formula means computing −100000000 + 99999999.99999998: two numbers that agree to fifteen digits. Subtracting them cancels every significant figure and leaves only rounding noise.

The classic formula returns −7.450580597e−9 for that root. The true value is −1e−8 — a 25% error, with no warning of any kind. Push b up to 10⁹ and it returns a flat 0, which cannot possibly be right: put x = 0 into the equation and it claims 1 = 0.

This page avoids it by never performing that subtraction. It computes q = −(b + sign(b)·√Δ)/2, where the two terms always share a sign and therefore always add, then takes x₁ = q/a and gets the second root from x₂ = c/q, which follows from x₁·x₂ = c/a and does not inherit the first one's error. It is algebraically the same formula — the working shown on screen is still the textbook one, because on paper there is no floating point to worry about.

Exact answers beat decimals

When the coefficients are whole numbers, a decimal is not really the answer. √2 = 1.414213562… never terminates, and 1/3 = 0.333… does not either. Writing the rounded decimal in an exam usually loses marks; writing x = (3 ± √41) / 4 does not. So whenever a, b and c are integers this page also gives the exact form, with the surd simplified (√72 becomes 6√2) and the fraction reduced.

Check your answer for free with Vieta

There is no need to redo the whole thing to know whether you got it right. For any quadratic, the two roots must satisfy x₁ + x₂ = −b/a and x₁ · x₂ = c/a. For x² − 5x + 6 that means the roots add to 5 and multiply to 6, which 3 and 2 do. If either check fails, there is a mistake somewhere. This page runs both and prints them under the working.

What this calculator does not do

It solves one quadratic in one unknown. It does not handle systems of equations, cubics, inequalities, or equations that need rearranging first — if you have 2x² = 3x − 5, move everything to one side to get 2x² − 3x + 5 = 0 and then enter the coefficients. It does not do symbolic algebra with letters in place of numbers either.

On rounding: figures are cut to ten significant figures when displayed, never before the calculation. That is what turns floating point's 2.9999999999999996 into the 3 you should be reading, without touching a single sum.

Frequently asked questions

What is the quadratic formula?

x = (−b ± √(b² − 4ac)) / 2a. It solves any equation of the form ax² + bx + c = 0, as long as a is not zero. The part under the root, b² − 4ac, is the discriminant, and it alone decides how many solutions there are.

What does the discriminant tell you?

How many real solutions the equation has, before you work any of them out. If Δ > 0 there are two different real solutions and the parabola crosses the X axis twice. If Δ = 0 there is one double solution and the parabola just touches the axis. If Δ < 0 there are no real solutions and the parabola never reaches the axis, though there are two complex conjugate ones.

What happens if a = 0?

It stops being a quadratic equation and becomes a linear one: bx + c = 0, solved directly as x = −c/b. This calculator does not treat it as an error — it solves it and says so. If b is also zero there is no x left at all: the equation is either false (no solution) or trivially true (infinitely many solutions).

Why do you show the answer as a surd and not just a decimal?

Because with whole-number coefficients a decimal is not the solution, it is a rounded photograph of it. √2 never ends and neither does 1/3. When the coefficients are integers this page also shows the exact form — simplified surd and reduced fraction — which is what a marker expects to see in an exam.

Why does this give a different answer from my calculator?

Because of how the formula is computed, not because of the maths. When b² is far larger than 4ac, √Δ is almost exactly |b|, and the textbook formula ends up subtracting two nearly identical numbers — which destroys the significant digits. This page uses the algebraically identical but numerically stable form, so the smaller root comes out right. For x² + 100000000x + 1 = 0 the classic formula gives −7.45e−9 and the correct answer is −1e−8.

How do you factorise a quadratic from its roots?

Once you know x₁ and x₂, the expression factorises as a(x − x₁)(x − x₂). For x² − 5x + 6 the roots are 3 and 2, so it factorises as (x − 3)(x − 2). If the discriminant is negative there are no real factors.

What is Vieta's check?

A free way to verify your answer without redoing the work: the two roots must add up to −b/a and multiply to c/a. If either fails, something went wrong. This page runs the check for you and shows both numbers under the working.

Do you store what I type?

No. Every calculation happens inside your own browser. The coefficients you type never leave your device: there is no server to receive them and no database to keep them.