Quadratic Equation Solver
Solve ax² + bx + c = 0: discriminant, real or complex roots with the formula written out, vertex and axis, the factored form when rational, vertex form.
Discriminant, both roots (real, repeated or a complex pair), the vertex and axis of symmetry, sum and product of the roots, the factored and vertex forms, and the working.
Example: x² − 3x + 2: D = 1, roots 1 and 2, (x − 1)(x − 2), vertex (1.5, −0.25); x² + 2x + 5: D = −16, roots −1 ± 2i; 4x² − 4x + 1 has the repeated root 0.5 and factors as (2x − 1)².
The formula,
done the stable way.
How the roots are computed, when the factored form appears, and what the vertex form says.
The roots
The discriminant D = b² − 4ac decides: two real roots, one repeated root, or a complex conjugate pair. Real roots are computed in the numerically stable way — q = −½(b + sign(b)·√D), x₁ = q/a, x₂ = c/q — which avoids subtracting two nearly equal numbers when b² ≫ 4ac. Complex roots are −b/2a ± i·√(−D)/2a, written as p ± qi.
Forms
The vertex is (−b/2a, c − b²/4a) and the axis of symmetry x = −b/2a; the vertex form a(x − h)² + k follows. The factored form is written only when both roots are rational with denominators up to 1 000 — (x + 2)(2x − 1) rather than a decimal approximation — and as a square for a repeated root. Sum and product of the roots are −b/a and c/a (Vieta).
Limits
Coefficients are double-precision numbers; rounding shows to the places you choose. a = 0 is refused as not quadratic. Nothing leaves the browser; the same four anonymous usage counts as the rest of the site apply.
SOURCES
- x = (−b ± √(b² − 4ac)) / 2a in the numerically stable form q = −½(b + sign(b)√D), x₁ = q/a, x₂ = c/q; vertex (−b/2a, c − b²/4a); factored form for rational roots
Last reviewed 21 September 2026. How results are checked: How we verify.