Quadratic equation solver

The discriminant decides the form; real, repeated and complex roots with the vertex.

The sign of b² − 4ac decides the answer's shape — positive gives two distinct real roots, zero a repeated root, negative a conjugate pair. This does not apply the quadratic formula literally: when b is large and 4ac small, −b + √D subtracts two nearly equal numbers and loses precision, so the root whose signs do not cancel is computed first and the other follows from the product of roots.

Coefficients

What you enter is saved in this browser, so it is still here next time

Zero makes it linear.

Roots

Two distinct real roots

x = 3, 2

Discriminant b² − 4ac

1

Graph

Vertex x
2.5
Vertex y
-0.25
Sum of roots
5
Product of roots
6

A positive discriminant gives two real roots, zero a repeated root, negative a conjugate pair.

Computed in a numerically stable form rather than by the bare quadratic formula — more accurate when b is large and 4ac small.

Solving x² − 5x + 6

With the defaults a = 1, b = −5, c = 6, the discriminant is (−5)² − 4×1×6 = 1, positive, so two distinct real roots. The screen first forms q = −(b + √D with the sign of b)/2 = −(−5 − 1)/2 = 3, then takes one root as q/a = 3 and the other as c/q = 2. The vertex is x = −b/2a = 2.5, y = c − b²/4a = 6 − 6.25 = −0.25. The sum of roots, 5, equals −b/a and the product, 6, equals c/a — two lines that let you check the roots by hand.

What appears when the discriminant is negative

x² + 2x + 5 has discriminant 4 − 20 = −16, so no real root. The screen separates the real part −b/2a = −1 from the imaginary part √16/2a = 2 and writes x = −1 ± 2i. The vertex (−1, 4) sits above the x-axis, which tells you without a graph that the parabola never crosses it. Even with complex roots the sum −2 and product 5 are real: adding conjugates cancels the imaginary parts, multiplying them gives a sum of squares. The imaginary part is shown as an absolute value, without sign.

With a = 0 it is solved as linear

If a = 0 the equation is bx + c = 0, the single root is −c/b, and the screen says it is linear. If b is 0 as well it reports no root whatever c is — the identity 0 = 0 is not reported as every number, it is left as no root. The vertex, sum and product then show 0, but those are not meaningful values: with no parabola there is no vertex. An a that is merely small, like 0.0001, is still solved as a quadratic, and one root then becomes very large.

Display is rounded at six decimal places

Every value is written to at most six decimals. The roots of x² + 100,000,000x + 1 are −100,000,000 and −0.00000001; the textbook formula loses the small one to zero in the subtraction −b + √D, while this screen obtains it as c/q and gets −1×10⁻⁸ exactly. Rounded at six places, though, it shows on screen as −0. The calculation is right; the display has folded it. Coefficients accept decimals and any value within ±1 billion.

Common questions

QWhat does a complex root mean?

The parabola never crosses the x-axis. There is no real solution; over the complex numbers there are two conjugate roots of the form a ± bi, shown here with the real and imaginary parts separated.

QWhat if a is zero?

It is linear rather than quadratic, so there is one root (bx + c = 0). With b zero as well the equation is either impossible or an identity, and this reports no root.

QDoesn't the quadratic formula lose accuracy?

It can. When b is large and 4ac small, −b + √(b²−4ac) subtracts two nearly equal numbers and the significant digits vanish. So the root whose signs do not cancel is computed first, and the other comes from the relationship between roots and coefficients (their product is c/a).

Source last checked: 2026-08-22

This tool does not replace tax or investment advice; the result is for reference.