Quadratic Calculator

A negative discriminant is a normal, valid result, not an error: it means the equation has no real roots, only a pair of complex ones, shown here rather than hidden.

This free quadratic formula calculator solves ax² + bx + c = 0 for x. Enter the three coefficients and see the discriminant and both roots instantly, including complex roots when the discriminant is negative. Nothing you enter is sent anywhere or stored.

How to Use It

  1. Enter the coefficients a, b, and c from your equation, ax² + bx + c = 0.
  2. The discriminant and roots update instantly as you type.
  3. A negative discriminant shows complex roots instead of real ones, not an error.

How It Works

The quadratic formula solves any equation of the form ax² + bx + c = 0 directly from its three coefficients. The first step is the discriminant, b² minus 4ac, which determines how many real solutions exist before the rest of the formula is even applied: positive means two distinct real roots, zero means one repeated real root, and negative means no real roots, only a pair of complex ones.

Formula

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

A worked example: for x² − 5x + 6 = 0 (a=1, b=−5, c=6), the discriminant is 25 minus 24, or 1, a positive number, so there are two real roots: x = 3 and x = 2. For x² − 4x + 4 = 0 (a=1, b=−4, c=4), the discriminant is exactly 0, giving one repeated root, x = 2. For x² + x + 1 = 0 (a=1, b=1, c=1), the discriminant is 1 minus 4, or −3, a negative number, so the two roots are complex: x = −0.5 ± 0.866i.

Everything runs client-side in your browser. Nothing you enter is sent anywhere or stored.

Frequently Asked Questions

Why can't "a" be zero?

If a is zero, the ax² term disappears entirely and the equation becomes bx + c = 0, a linear equation with at most one solution, not a quadratic one. The quadratic formula also divides by 2a, which is undefined at zero, so a must be a non-zero number for this formula to apply at all.

What does the discriminant tell you?

The discriminant (b² minus 4ac) determines how many real roots the equation has before you even compute them. A positive discriminant means two distinct real roots, zero means exactly one repeated real root, and a negative discriminant means no real roots at all, only a pair of complex ones. Calculating it first is what lets this tool know which case applies.

What does a negative discriminant actually mean?

It means the parabola described by the equation never crosses the x-axis, so there is no real number that solves it. That does not mean there is no answer: the equation still has two solutions, they are just complex numbers (a real part plus an imaginary part), shown here rather than reported as an error.

What is a real-world use for solving a quadratic equation?

A very common one is projectile motion: an object's height over time under gravity follows a quadratic equation, and solving it tells you when the object hits the ground. It also shows up constantly in algebra and physics coursework any time a problem asks for the roots, zeros, or x-intercepts of a quadratic expression.

Why are the results rounded, and can the roots be exact whole numbers?

Results are rounded to 4 decimal places since most quadratic equations don't have whole-number roots. When they do (like x squared minus 5x plus 6, with roots 3 and 2), the rounding has no visible effect and the answer displays as a clean whole number.

Further Reading