Skip to the calculator
SwiftSums
Math & statistics

Quadratic Equation Calculator. Real or complex.

Roots of ax² + bx + c = 0 from its three coefficients, including complex roots when the discriminant is negative.

Live calculation

What are the roots?

Coefficients of ax² + bx + c = 0
Roots x₁ = 2, x₂ = 1
Discriminant (D)
1
Case
Two distinct real roots

Your figures are kept on this device only.

How it works

Every quadratic ax² + bx + c = 0 is solved with the quadratic formula, but which kind of roots you get depends entirely on the discriminant D = b² − 4ac. If D is positive, the square root is a real number and you get two distinct real roots. If D is exactly zero, the ± term vanishes and both roots collapse into one repeated value. If D is negative, the square root of a negative number is imaginary, so the two roots form a complex conjugate pair instead of real numbers.

D = b² − 4ac
D > 0: x = (−b ± √D) ÷ 2a — two real roots
D = 0: x = −b ÷ 2a — one repeated root
D < 0: x = (−b ± i√|D|) ÷ 2a — two complex roots

Worked examples

Two real roots, then a case with a negative discriminant.

Two real roots: a = 1, b = −3, c = 2
  1. D = b² − 4ac = 9 − 8 = 1, which is greater than zero.
  2. x = (3 ± 1) ÷ 2.

x = 2 or x = 1.

Complex roots: a = 1, b = 2, c = 5
  1. D = b² − 4ac = 4 − 20 = −16, which is less than zero.
  2. x = (−2 ± i√16) ÷ 2 = (−2 ± 4i) ÷ 2.

x = −1 ± 2i.

Common questions

What does the discriminant tell you?

The sign of D = b² − 4ac tells you the nature of the roots before you even solve for them: positive means two distinct real roots, zero means exactly one repeated real root, and negative means the roots are a complex conjugate pair rather than real numbers.

What does a complex root actually mean graphically?

It means the parabola y = ax² + bx + c never crosses the x-axis — it stays entirely above or entirely below it. Complex roots are still mathematically valid solutions to the equation, just not points where the graph touches zero.

Why must a not be zero?

If a = 0, the x² term disappears and the equation is no longer quadratic — it becomes linear (bx + c = 0), which has at most one root and isn't solved by the quadratic formula at all.