Quadratic Formula Calculator

Enter the coefficients of ax² + bx + c = 0 and get both roots, the discriminant, the vertex and a graph of the parabola, with every algebra step from the formula worked out and substituted with your numbers.

What you get
  • All three root casesTwo real roots, one repeated root, or a complex pair.
  • Every step shownDiscriminant, substituted formula, roots, vertex and checks.
  • Graph of the parabolaRoots and vertex marked on a scaled plot.

Coefficients

Results update as you type

x² - 5x + 6 = 0your equation right now
Decimals are welcome, and a can be any number except zero. If a is zero the equation becomes linear and this calculator will tell you so instead of pretending.

Runs entirely in your browser. Nothing you type is sent or saved

Quadratic formula guide

What a quadratic equation is

A quadratic equation is any equation that can be written in the standard form ax² + bx + c = 0, where a, b and c are known numbers and x is the unknown. The name comes from the Latin quadratus, meaning square, because the defining feature is the x² term. The coefficient a is called the quadratic coefficient, b the linear coefficient and c the constant. One restriction matters: a must not be zero, because with a = 0 the x² term vanishes and the equation collapses to the linear equation bx + c = 0, which a simple rearrangement solves.

Graphed, every quadratic equation is a parabola, a symmetric U-shaped curve. The solutions of the equation, its roots, are exactly the places where that parabola crosses the x axis, which is why solving and graphing are two views of the same question. The running example on this page is x² - 5x + 6 = 0, and every number quoted below can be checked against the calculator above.

The quadratic formula

One formula solves every quadratic equation, whatever its coefficients:

x = [ -b ± √(b² - 4ac) ] ÷ 2a

read it as two answers at once: once with the plus, once with the minus

For the example, a = 1, b = -5 and c = 6. The part under the square root is (-5)² - 4 × 1 × 6 = 25 - 24 = 1, so the formula gives x = (5 ± 1) ÷ 2, which is x = 3 or x = 2. Substitution confirms both: 3² - 5 × 3 + 6 = 9 - 15 + 6 = 0, and 4 - 10 + 6 = 0 for x = 2. Making this substitution a habit is the fastest way to trust an answer.

The discriminant decides the case

The expression under the square root, D = b² - 4ac, is called the discriminant, and it single-handedly determines what kind of answers exist:

  • D > 0: two different real roots. The parabola crosses the x axis twice. Example: x² - 5x + 6 has D = 1, giving roots 2 and 3.
  • D = 0: exactly one root, counted twice. The parabola touches the x axis at a single point, its vertex. Example: x² + 2x + 1 = (x + 1)² has D = 0 and the repeated root x = -1.
  • D < 0: two complex roots. The square root of a negative number is not a real number, so the parabola never reaches the x axis. Example: x² + 1 has D = -4 and the roots x = ±i, a conjugate pair 0 + i and 0 - i.
Before computing, compute D. The discriminant is cheap to calculate and tells you which case you are in, how many answers to expect, and whether the graph crosses, touches or floats above the axis. A mismatch between the case and your intuition usually means a sign slipped in one of the coefficients.

Where the formula comes from: completing the square

The formula is not magic; it is the result of completing the square, applied once and kept forever. Start from ax² + bx + c = 0 and divide by a. The plan is to rewrite the x part as a single squared term: x² + (b/a)x becomes (x + b/2a)² if you add and subtract the constant (b/2a)². Moving every constant to the right side isolates that perfect square:

(x + b/2a)² = (b² - 4ac) ÷ (4a²)

the completed-square form of the equation, just before the final square root

Taking the square root of both sides produces the ±, and subtracting b/2a from both sides isolates x, giving exactly the quadratic formula. Every step is reversible, which is why the formula never misses a solution. Completing the square is also worth knowing on its own: it converts any quadratic into vertex form, the form that makes the graph's turning point obvious.

The vertex and the graph

The vertex is the parabola's turning point, its lowest point when the parabola opens upward (a > 0) or its highest when it opens downward (a < 0). Its coordinates come straight from the coefficients: the x coordinate is -b ÷ 2a, which is also the axis of symmetry, the mirror line of the whole curve, and the y coordinate follows by substituting back. For the example, the vertex sits at x = 5 ÷ 2 = 2.5 and y = 6 - 25 ÷ 4 = -0.25, slightly below the x axis, which agrees with the two crossings at 2 and 3 on either side of it.

Three further check values come free. The y-intercept is simply c, because x = 0 kills the other terms. The two roots always sum to -b ÷ a (here 5, and indeed 2 + 3 = 5) and multiply to c ÷ a (here 6, and 2 × 3 = 6). These are Vieta's formulas, and they make excellent quick sanity checks on any computed pair of roots.

Using the calculator well

  • Write the equation in standard form first: everything on one side and zero on the other, ordered as ax² + bx + c. An equation like 3x² = 6x - 2 must be rearranged to 3x² - 6x + 2 = 0 before a = 3, b = -6, c = 2 are read off.
  • a must be nonzero: the calculator explains when a = 0 makes the equation linear rather than quadratic, since guessing a formula answer for a linear equation hides its true, simpler structure.
  • Decimals and negatives are fine, in any coefficient. Signs are the most common source of trouble, so double-check that a minus traveled with its number.
  • Read the discriminant before the roots: it tells you whether to expect two answers, one or a complex pair, so a surprise in the results is caught early.
  • Check by substitution: put each root back into the original equation. The calculator's sum and product checks automate the same idea for the pair.

A short history of the quadratic

Quadratics are ancient. Babylonian clay tablets from around 2000 BC contain worked recipes for problems we would now write as quadratic equations, complete with the equivalent of the positive root, though the Babylonians had no negative numbers and no algebraic notation. Greek geometers solved them with ruler-and-compass constructions instead.

The algebraic treatment arrived with the Persian mathematician al-Khwarizmi, whose book Al-jabr, written around 825 AD, classified quadratics into types and gave step-by-step solving rules, a word from whose title gives us "algebra" itself. Because negative coefficients were still avoided, his single method appeared as many separate cases. European mathematicians of the sixteenth and seventeenth centuries, working after the acceptance of negative numbers, condensed everything into the single formula used today, and René Descartes' coordinate geometry then connected each equation to its parabola, uniting the algebraic and graphical views this calculator presents side by side.

Common questions

If a is zero, the x² term disappears and the equation becomes bx + c = 0, a linear equation with the single solution x = -c/b. The quadratic formula would still run, but it would divide by 2a = 0, which is undefined. This is why the calculator refuses a = 0 and points out that your equation is actually linear and much simpler to solve.

It means no real-number solution exists: no value of x makes the equation true, and the parabola never touches the x axis. The complete answer uses complex numbers, a conjugate pair written as real part plus and minus imaginary part, and the calculator reports it in that form. In many applied problems a negative discriminant is meaningful in itself, often signaling that an event never happens.

The two roots are interchangeable as solutions: both make the equation true, and nothing labels one more correct than the other. Conventionally the calculator reports the plus root first. If a word problem context picks one (a length cannot be negative, for example), filter the pair by that requirement rather than by the formula's ordering.

Your discriminant is exactly zero, which happens when the equation is a perfect square, like x² + 2x + 1 = (x + 1)². The parabola sits exactly on the x axis at its vertex, so the plus and minus branches of the formula produce the same number. The single root is reported as a repeated root, and it equals -b/2a, the vertex position.

Yes, and it is often the safer choice. Factoring is fast when the numbers cooperate, as with x² - 5x + 6 = (x - 2)(x - 3), but it stalls on equations like 2x² - 4x - 6 with non-obvious factors. The formula works for every quadratic, so using it costs nothing except a moment longer, and its discriminant also tells you whether factoring with whole numbers is even possible.

The vertex is the turning point of the parabola: the minimum value when a is positive and the maximum when a is negative. It answers optimization questions directly, such as the launch height of a projectile or the price that maximizes revenue, at x = -b/2a. The roots tell you where the curve crosses zero; the vertex tells you where it turns around.

Two fast checks. Substitution: put each root back into the original equation and confirm it balances, as 2² - 5 × 2 + 6 = 0 does. Vieta's checks: the roots must sum to -b/a and multiply to c/a, here 5 and 6, which the results panel computes for you. If either check fails, a coefficient was probably entered with the wrong sign.

No. Every calculation runs in your browser. Nothing is stored or transmitted.

Every root, every step, every time.

Browse all math calculators