Solve quadratic equations (ax² + bx + c = 0)

Solve a quadratic equation and report real or complex roots from its discriminant.

freeworks offlinenothing uploaded
ToolQuadratic Solver
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

The discriminant b²−4ac determines the case: positive gives two real roots, zero gives a repeated root, and negative gives a conjugate complex pair. Roots use the quadratic formula and are rounded for display.

  • a must be nonzero.
  • Coefficients are parsed from the supplied three-number expression.

Worked example

Solve x^2 - 5x + 6 = 0
Find the roots of x^2 - 5x + 6 = 0
Input
											1, -5, 6
										
Output
												Equation: 1x² + -5x + 6 = 0
Discriminant: 1
Two real roots:
x₁ = 3
x₂ = 2
											

When to use this

Math lessons find parabola intercepts, projectile equations find times, and engineering models test real solutions.

Edge cases

  • a = 0 is rejected as a linear equation.
  • A negative discriminant has complex rather than real roots.
  • Very large coefficients can lose precision when squared.