onlinecalculator.me

Free online quadratic equation solver

A quadratic equation has the form ax² + bx + c = 0. This solver finds all roots using the quadratic formula and tells you whether they are real, repeated, or complex.

Solving: x² − 5x + 6 = 0
Roots
Discriminant (b² − 4ac)
About this calculator

How to use

  1. Enter a, b, and c — the coefficients of your equation in the form ax² + bx + c = 0.
  2. The solver updates the equation preview and computes roots immediately.
  3. Read the discriminant and roots below the form.

The quadratic formula

x = (-b ± sqrt(b² - 4ac)) / (2a)

Variables:

  • a — coefficient of x² (must be non-zero)
  • b — coefficient of x
  • c — constant term
  • Δ (discriminant) = b² − 4ac

Solution types

DiscriminantRoots
Δ > 0Two distinct real roots
Δ = 0One repeated real root
Δ < 0Two complex conjugate roots

Worked examples

Two real roots: x² − 5x + 6 = 0 (a=1, b=−5, c=6) Δ = 25 − 24 = 1 → x₁ = 3, x₂ = 2

One real root: x² − 4x + 4 = 0 (a=1, b=−4, c=4) Δ = 16 − 16 = 0 → x = 2

Complex roots: x² + x + 1 = 0 (a=1, b=1, c=1) Δ = 1 − 4 = −3 → x = −0.5 ± 0.866025i

Notes

  • Results are rounded to six decimal places to avoid floating-point noise.
  • Complex roots always come in conjugate pairs (a + bi and a − bi).
  • If a = 0, the equation degenerates to a linear equation; use the constant and b values to solve it directly: x = −c / b.
What is the quadratic formula?
x = (−b ± √(b² − 4ac)) / (2a). The ± gives two solutions. When the discriminant b² − 4ac is negative, the roots are complex numbers.
What does the discriminant tell you?
If b² − 4ac > 0 there are two distinct real roots; = 0 gives one repeated real root; < 0 gives two complex conjugate roots.
What happens when a = 0?
The equation becomes linear (bx + c = 0), not quadratic. The solver flags this and prompts you to enter a ≠ 0.
How are complex roots displayed?
Complex roots are written as x = realPart ± imagPart·i. Both roots share the same real part and imaginary parts of opposite sign.
Can I solve equations with negative coefficients?
Yes. Enter negative values for a, b, or c directly. The formula handles all sign combinations.