Home / Quadratic Formula Calculator

Quadratic Formula Calculator

Enter the coefficients a, b and c for ax squared plus bx plus c equals 0. The calculator returns the discriminant and both roots, real or complex, with the steps.

Coefficients

Equation solved: a x squared + b x + c = 0.

Roots

x values--
Discriminant--
Type--
Enter a, b and c to see the steps.

How It's Calculated

Any quadratic equation can be written as a x squared plus b x plus c equals 0, with a not equal to zero. Rather than guessing at factors, the quadratic formula gives both solutions directly from the three coefficients.

x = ( -b ± sqrt(b² - 4ac) ) / 2a

The piece under the radical, b squared minus 4ac, is called the discriminant, and its sign alone tells you what kind of answer to expect before you even finish the arithmetic. A positive discriminant means two distinct real roots. A discriminant of exactly zero means the parabola just touches the x-axis at one repeated root. A negative discriminant means the parabola never crosses the x-axis at all, so the two roots are a conjugate pair of complex numbers.

Worked Example: x squared - 3x + 2 = 0

Step 1. Identify a = 1, b = -3, c = 2.
Step 2. Discriminant = (-3)² - 4(1)(2) = 9 - 8 = 1. It is positive, so expect two real roots.
Step 3. sqrt(1) = 1.
Step 4. x = (3 ± 1) / 2, giving x = 2 and x = 1.

Common Mistakes to Avoid

The sign in front of b trips up more people than the rest of the formula combined: the formula uses negative b, so if b is already negative in your equation, the two negatives cancel and you add a positive number under the fraction bar. Another common error is forgetting the plus-or-minus and reporting only one root, which throws away exactly half the answer. When a equals zero, the equation is not quadratic at all; it collapses to a linear equation bx + c = 0, and this calculator switches to that simpler case automatically rather than dividing by zero.

For a fuller derivation by completing the square, see Wolfram MathWorld's page on the quadratic formula.

Keep going with algebra

Once you have the roots, factoring or a quick slope check often comes next.

Quick answers

Quadratic formula: common questions

What is the quadratic formula?

x = (-b plus or minus sqrt(b^2 - 4ac)) / 2a. It solves any equation in the form ax^2 + bx + c = 0 once you know a, b and c.

What does the discriminant tell you?

The discriminant is b^2 - 4ac. Positive gives two real roots, zero gives one repeated root, and negative gives a pair of complex roots.

How do you get complex roots?

When b^2 - 4ac is negative, the square root is imaginary. The roots take the form p plus or minus qi, which this tool reports automatically.

What if a equals zero?

Then the equation is not quadratic but linear: bx + c = 0, which solves to x = -c / b. The tool handles this case too.

Marcus Vance
About the author
Marcus Vance
Contributing Writer, Technology & Data, Encore Editorial

Marcus Vance spent a decade building data pipelines and testing calculation logic before he started writing about the math behind the tools. On MathCalcTools he checks every formula against the source math, then writes out the steps so a reader can follow the same path a calculator takes.