Quadratic Formula Calculator

Enter the coefficients a, b and c. The roots, the vertex and the graph of the parabola update as you type.

The quadratic formula

Any equation of the form ax² + bx + c = 0 with a ≠ 0 is a quadratic equation. Its solutions (roots) are given by the quadratic formula:

x = (−b ± √(b² − 4ac)) / 2a

The expression under the square root, D = b² − 4ac, is called the discriminant, and its sign tells you what kind of roots to expect before you calculate them:

DiscriminantRootsGraph
D > 0two different real rootscrosses the x-axis twice
D = 0one repeated real roottouches the x-axis at the vertex
D < 0two complex conjugate rootsnever meets the x-axis

When D is a perfect square and a, b, c are integers, the roots are rational and the polynomial can be factored over the integers. Otherwise the calculator shows the exact root in simplified radical form, such as x = 1 ± √3, together with its decimal value.

Vertex, axis and the shape of the parabola

The graph of y = ax² + bx + c is a parabola. It opens upward when a > 0 (the vertex is the lowest point) and downward when a < 0 (the vertex is the highest point). The vertex sits on the axis of symmetry:

h = −b / 2a, k = c − b² / 4a

so the equation can be rewritten in vertex form y = a(x − h)² + k. The y-intercept is simply (0, c).

Two handy checks come from Vieta's formulas: the roots always add up to −b/a and multiply to c/a. If your roots do not satisfy these, something went wrong.

For very lopsided coefficients (for example b = 108 and a = c = 1) the textbook formula loses accuracy, because it subtracts two nearly equal numbers. This calculator uses the numerically stable variant q = −(b + sign(b)·√D)/2, x₁ = q/a, x₂ = c/q, which gives full precision for both roots.

Worked example

Solve 2x² − 4x − 6 = 0 (the calculator's default).

  1. Coefficients: a = 2, b = −4, c = −6.
  2. Discriminant: D = (−4)² − 4·2·(−6) = 16 + 48 = 64. It is positive, so there are two real roots, and because 64 = 8² they are rational.
  3. Formula: x = (4 ± 8) / 4, so x₁ = −4/4 = −1 and x₂ = 12/4 = 3.
  4. Factored form: 2(x + 1)(x − 3).
  5. Vertex: h = 4/4 = 1, k = −6 − 16/8 = −8, so the vertex is (1, −8) and the parabola opens upward.

Check with Vieta: −1 + 3 = 2 = −b/a and −1 × 3 = −3 = c/a.

If a turns out to be 0 the equation is linear, bx + c = 0, with the single solution x = −c/b — that case is not a quadratic and the calculator asks for a non-zero a.

Frequently asked questions

What does a negative discriminant mean?

There are no real solutions: the parabola never crosses the x-axis. The two solutions are complex numbers of the form p ± qi, where i = √−1.

Can I enter decimals or negative coefficients?

Yes. Any real a, b and c work, as long as a is not zero. Factoring over the integers is shown only when all three coefficients are whole numbers and the roots are rational.

Is completing the square different from the quadratic formula?

No — the quadratic formula is what you get by completing the square on ax² + bx + c = 0 in general. Both give the same roots; the vertex form shown above is the completed-square form.

Why does the calculator show a repeated root?

When D = 0 both roots coincide, x = −b/2a. The polynomial is then a perfect square, for example x² + 2x + 1 = (x + 1)², and the parabola just touches the x-axis.

Last reviewed: