Quadratic Formula Calculator

Enter the coefficients a, b and c of ax² + bx + c = 0 to find the solutions with the quadratic formula.

Negative numbers are allowed (for example, -5). Decimals are allowed (up to 6 decimal places).
Solutions —
Discriminant and solutions
Discriminant D = b² − 4ac—
x₁ (smaller)—
x₂ (larger)—

The values copied are the solutions with 15 significant digits (a fraction is copied as a decimal).

The quadratic formula and the discriminant

The solutions of a quadratic equation ax² + bx + c = 0 (with a ≠ 0) are

x = (−b ± √D) ÷ 2a, where the discriminant D = b² − 4ac.

The discriminant tells you how many real solutions there are.

Discriminant D Solutions
D > 0 Two real solutions
D = 0 One repeated real solution
D < 0 No real solutions (this calculator does not give complex solutions)

How the solutions are shown

When a is 0

If a = 0, the equation is not quadratic. For reference, the calculator solves the linear equation bx + c = 0:

b c Result
Not 0 (anything) x = −c ÷ b
0 0 Every x is a solution
0 Not 0 No x satisfies the equation (no solution)

Examples

Equation Discriminant D Solutions
x² − 5x + 6 = 0 1 2 and 3
2x² + 3x − 2 = 0 25 −2 and 1/2
x² − 2 = 0 8 ±1.414214 (rounded value)
x² + 2x + 1 = 0 0 −1 (repeated root)
x² + 1 = 0 −4 No real solutions

Notes

Frequently asked questions

What is the discriminant?

It is b² − 4ac. If it is positive, there are two real solutions; if it is 0, there is one repeated solution; if it is negative, there are no real solutions.

When are the solutions fractions?

When the discriminant is a perfect square. For example, 2x² + 3x − 2 = 0 has the discriminant 25 (a perfect square), and its solutions are −2 and 1/2.

What if there are no real solutions?

That happens when the discriminant is negative. There are no solutions among the real numbers (there are solutions among the complex numbers, but this calculator does not cover them).