Quadratic Formula Calculator

Solve ax² + bx + c = 0 and get the roots in exact form — simplified surds such as (−3 ± √17)/2, not rounded decimals. Complex roots are given in full, and every step is shown.

Whole numbers, decimals or fractions such as 1/2.

The formula

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

The formula works for any quadratic equation with a ≠ 0, including equations that do not factorise neatly.

Example with steps: x² + 3x − 2 = 0

  • Identify a = 1, b = 3, c = −2
  • Calculate the discriminant: 3² − 4(1)(−2) = 17
  • Substitute into the formula
  • Simplify to (-3 ± √17)/2
  • Show decimal approximations underneath

Why exact answers matter

For x² + 3x − 2 = 0, most calculators answer x = 0.5615528 and x = −3.5615528. Those are roundings. The actual roots are:

x = (−3 ± √17) / 2

If your homework asks for exact form, a decimal approximation does not meet that requirement. And if you carry a rounded value into further calculations, the rounding can affect the result.

Simplifying the surd

The square root√72 is not yet in simplified form. Pulling out the largest square factor gives 6√2, and the whole fraction is then reduced: (8 ± 2√2)/4 becomes (4 ± √2)/2. Both steps are shown, because simplified exact form is often required in algebra and schoolwork.

For more work with radicals and exponents, see the Square Root & Exponent Calculator.

What the discriminant tells you

The part under the root, b² − 4ac, decides what kind of answer you are going to get before you finish the calculation.

Reading the discriminant
DiscriminantRootsThe parabola
Positive, a perfect squareTwo rational rootsCrosses the x-axis twice; the roots can be written as fractions
Positive, not a perfect squareTwo irrational rootsCrosses the x-axis twice, at surd values
ZeroOne repeated rootTouches the x-axis at one point
NegativeTwo complex rootsNever touches the x-axis

Negative discriminants have answers too

“No real solutions” is true, and it is not the answer. For x² + 2x + 5 = 0 the roots are −1 ± 2i — a pair of complex conjugates, exactly as valid as any other pair. This calculator gives the complex roots instead of stopping at “no real solutions".

When it isn’t a quadratic

If a is zero there is no x² term, so the quadratic formula cannot be used at all — it would divide by zero. The equation is linear, with one solution.

Frequently asked questions

What is the quadratic formula?

x = (−b ± √(b² − 4ac)) ÷ 2a. It gives both solutions of ax² + bx + c = 0 for any quadratic, whether or not it factorises.

What does the discriminant tell me?

b² − 4ac tells you the kind of roots before you finish: positive means two real roots, zero means one repeated root, negative means two complex roots. If it is a positive perfect square, the roots are rational and the quadratic factorises.

How do I write the answer in exact form?

Keep the square root rather than evaluating it, simplify it by pulling out square factors, then reduce the whole fraction. For example √72 becomes 6√2, and (8 ± 2√2)/4 reduces to (4 ± √2)/2.

What if there are no real solutions?

There are still two solutions, they are just complex. A negative discriminant gives a conjugate pair such as −1 ± 2i, which this calculator shows in full.

Can a be zero?

Not for the quadratic formula, which divides by 2a. If a is zero the equation is linear rather than quadratic, and has a single solution found by rearranging bx + c = 0.