Quadratic Formula Calculator

Enter the coefficients a, b, and c of your quadratic equation and get both roots instantly — real, repeated, or complex — along with the discriminant that tells you which case you're in.

Put this calculator on your website — free

Copy one snippet and give your visitors a working Quadratic Formula Calculator.

How the quadratic formula calculator works

A quadratic equation ax² + bx + c = 0 describes a parabola, and its solutions are the x-values where that parabola crosses zero. The quadratic formula finds them directly from the three coefficients — no factoring, no guessing. The key quantity is the discriminant, b² − 4ac: its sign decides whether you get two real roots, one repeated root, or a pair of complex conjugates.

The formula

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

a, b, and c are the coefficients of x², x, and the constant term. The expression under the square root, b² − 4ac, is the discriminant. The ± gives one root with plus and one with minus.

Worked example

Solve x² − 5x + 6 = 0 (a = 1, b = −5, c = 6):

Discriminant = (−5)² − 4 × 1 × 6 = 25 − 24 = 1

x = (5 ± √1) ÷ 2 = (5 ± 1) ÷ 2, so x = 3 or x = 2. Check: 3² − 5×3 + 6 = 0. ✓

Now try x² + 2x + 5 = 0: the discriminant is 4 − 20 = −16, which is negative, so the roots are complex: x = (−2 ± √(−16)) ÷ 2 = −1 ± 2i.

Read the discriminant before you solve

Computing b² − 4ac first takes ten seconds and tells you what kind of answer to expect — a habit that catches sign errors before they cost you a whole problem. Positive: the parabola crosses the x-axis twice. Zero: it just kisses the axis at its vertex (one repeated root). Negative: it never touches, and the roots live in the complex plane. And watch the a = 0 trap: without an x² term the equation is linear, not quadratic, and blindly applying the formula divides by zero. This calculator spots that case and solves bx + c = 0 instead.

Frequently asked questions

What is the quadratic formula?

For any equation ax² + bx + c = 0 with a ≠ 0, the solutions are x = (−b ± √(b² − 4ac)) ÷ (2a). The ± means there are generally two roots: one using plus, one using minus. It works for every quadratic, even when factoring is hopeless.

What does the discriminant tell me?

The discriminant is the part under the square root: b² − 4ac. If it's positive, the equation has two distinct real roots. If it's exactly zero, there's one repeated root. If it's negative, the roots are a pair of complex conjugates of the form p ± qi.

What happens if a = 0?

Then the x² term vanishes and the equation isn't quadratic at all — it's the linear equation bx + c = 0, which has the single solution x = −c/b (as long as b ≠ 0). This calculator detects that case and solves the linear equation for you instead of failing.

Can a quadratic equation have no solution?

It always has solutions if you allow complex numbers — a degree-2 polynomial has exactly 2 roots counting multiplicity. If you only accept real numbers, then a negative discriminant means no real solutions: the parabola never crosses the x-axis.

How do I check that a root is correct?

Substitute it back into ax² + bx + c and confirm you get 0. For example, plugging x = 3 into x² − 5x + 6 gives 9 − 15 + 6 = 0. You can also sanity-check with Vieta's formulas: the two roots should sum to −b/a and multiply to c/a.

Related calculators