🔻Quadratic Formula Calculator

Enter a, b, c for the discriminant, roots, vertex, factored form and a check

How to use the quadratic formula calculator

Enter the three coefficients of ax² + bx + c = 0 to get the discriminant D = b² − 4ac and both roots. A positive D gives two distinct real roots, D = 0 gives a repeated root, and a negative D gives a pair of complex conjugates. Because D almost never lands exactly on zero in floating point, a repeated root is declared when |D| < 1e-9 and that threshold is stated in the note.

The roots are not computed straight from the textbook formula. When b is large and 4ac is small, −b + √D subtracts two nearly equal numbers and most significant digits disappear. This tool therefore computes q = −(b + sign(b)√D)/2 first and then takes x₁ = q/a and x₂ = c/q. With a = 1, b = 100000000 and c = 1, for instance, the small root near −1e-8 keeps its significant digits.

Alongside the roots you get the sum −b/a and product c/a, the vertex coordinates, the factored form when the roots are real, and the value of the original expression evaluated at each root. The closer that check is to zero, the more accurate the result. Roots and coordinates are shown to 8 significant digits. Entering a = 0 switches to the linear case, and cubic or higher equations are not supported.

Frequently Asked Questions

What is the quadratic formula?

x = (−b ± √(b² − 4ac)) / 2a. To keep precision when b is large, this tool first computes q = −(b + sign(b)√D)/2 and then x₁ = q/a and x₂ = c/q.

Does a negative discriminant mean there are no roots?

There are none over the reals, but there are two over the complex numbers. Both are shown as the conjugate pair p ± qi.

What happens if I enter a = 0?

It is no longer a quadratic, so the tool solves the linear equation bx + c = 0 instead. If b is also 0 it reports no solution or every real number, depending on c.