FreeNo signup

Quadratic Formula Calculator

Solve ax² + bx + c = 0. Calculate the discriminant and real or complex roots, with linear equations supported when a is zero.

First root
3
Second root
2
Discriminant D
1

How the calculation works

D = b² − 4ac. For D ≥ 0, x = (−b ± √D)/(2a). For D < 0, the complex roots are −b/(2a) ± i√(−D)/(2|a|).

Inputs

  • Coefficient a
  • Coefficient b
  • Coefficient c

Calculation details

Include the sign of each coefficient. For example, x² − 5x + 6 = 0 has coefficients 1, −5, 6 and roots 2 and 3.

When a = 0, the equation becomes bx + c = 0. If b is also zero, it is either true for every x or has no solutions. Two distinct roots use a stable evaluation that reduces cancellation error.

Updated: 2026-10-02