Code tool

Quadratic Equation Solver

Enter finite coefficients a, b, and c locally in your browser to see roots and the discriminant.

In-browser processingNo account requiredPrivacy details ↗

For a ≠ 0: ax² + bx + c = a(x + b/(2a))² + c − b²/(4a). Setting this expression to zero gives an equivalent equation. Displayed coefficients are rounded.

Displayed values are rounded; JavaScript number precision applies.

Enter coefficients to begin.

A QUICK WALKTHROUGH

How to use this tool

  1. Enter a, b, and c.
  2. Choose the displayed decimal places.
  3. Review real roots, complex roots, or the degenerate result.

Completing the square

For a ≠ 0: ax² + bx + c = a(x + b/(2a))² + c − b²/(4a). Setting this expression to zero gives an equivalent equation. Displayed coefficients are rounded. OpenStax: https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-5-quadratic-equations

Degenerate cases

When a=0, the tool solves the resulting linear equation. When b is also zero, it reports no solution or that every real number is a solution.

Rounding and precision

Calculations use JavaScript number arithmetic, and displayed values are rounded to the selected decimal places. Floating-point precision limits significant digits for extreme values.

GOOD TO KNOW

Common questions

Can I enter decimal coefficients?

Yes, as long as all three coefficients are finite numbers.