Skip to content
UnitFormula

The quadratic formula solves any equation of the form ax² + bx + c = 0: x = (−b ± √(b² − 4ac)) ÷ (2a). The ± gives the two roots. For x² − 5x + 6 = 0 (a=1, b=−5, c=6), that's (5 ± √1) ÷ 2 = 3 and 2. The part under the root, b² − 4ac, is the discriminant, and its sign tells you how many real roots exist.

Quadratic Formula Calculator — solve ax² + bx + c = 0

1x² + -5x + 6 = 0.

First root (+√)3
Second root (−√)
2
Discriminant (b² − 4ac)
1

Quick examples

How it's calculated

  1. x = (−b ± √(b² − 4ac)) ÷ 2ax=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
    a
    = 1
    b
    = -5
    c
    = 6
    3
First root (+√)3

How it works

A quadratic equation has the form ax² + bx + c = 0, where a ≠ 0. The quadratic formula gives its solutions (roots) directly from the three coefficients:

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

The ± is why there are usually two roots — one using +√, one using −√. The expression under the square root, b² − 4ac, is called the discriminant, and its sign decides everything:

  • positive → two distinct real roots;
  • zero → one repeated real root (the ± adds nothing);
  • negative → no real roots (the roots are complex).

Worked example

Solve x² − 5x + 6 = 0, so a = 1, b = −5, c = 6. First the discriminant:

b² − 4ac = (−5)² − 4(1)(6) = 25 − 24 = 1

Positive, so two real roots. Now the formula:

x = (−(−5) ± √1) ÷ (2 × 1) = (5 ± 1) ÷ 2 = 3 and 2

You can check by factoring: x² − 5x + 6 = (x − 3)(x − 2). Other cases: x² − 4x + 4 = 0 has discriminant 0 and a single repeated root x = 2; x² − 9 = 0 has roots +3 and −3.

Frequently asked questions

How do I use the quadratic formula?

Identify a, b and c from ax² + bx + c = 0, then substitute into x = (−b ± √(b² − 4ac)) ÷ (2a). Compute the discriminant b² − 4ac first, take its square root, then work out the two values using + and −. Watch the signs — a negative b becomes positive as −b.

What is the discriminant and why does it matter?

The discriminant is b² − 4ac, the part under the square root. It tells you the nature of the roots without solving fully: positive means two different real roots, zero means one repeated root, and negative means no real roots (two complex ones). It's the quickest way to know what kind of answer to expect.

What if there are no real roots?

When the discriminant is negative, the square root of a negative number isn't real, so the equation has no real solutions — its parabola never crosses the x-axis. The roots are a pair of complex numbers instead. This calculator reports the discriminant so you can see why, and leaves the real roots blank.

What if a = 0?

Then it isn't a quadratic at all — the x² term vanishes and you're left with the linear equation bx + c = 0, solved by x = −c ÷ b. The quadratic formula divides by 2a, so a = 0 has no meaning here; enter a non-zero a.

Can I always factor instead of using the formula?

Only when the roots are "nice". Factoring is quick when a quadratic has simple whole or rational roots, but many quadratics — like x² − 2 = 0, with roots ±√2 — don't factor over the integers. The quadratic formula always works, factorable or not, which is why it's the general method.

How does the formula relate to the parabola's graph?

The roots are exactly where the parabola y = ax² + bx + c crosses the x-axis. Two real roots means two crossings, a zero discriminant means the vertex just touches the axis (one crossing), and a negative discriminant means the parabola stays entirely above or below it. The roots' midpoint, −b ÷ 2a, is the axis of symmetry.

How we know this is right

Last reviewed
Aug 4, 2026
Precision
Rounded to 4 decimal places.
Read our methodology

Sources