1. Home
  2. Everyday math
  3. Quadratic Formula Calculator
Everyday math

Quadratic Formula Calculator

Solve ax² + bx + c = 0 for real or complex roots, with the discriminant and vertex.

Your numbers

Results update as you type. Nothing you enter is sent anywhere.

Result

x = -1 or x = 2.5

Discriminant b² − 4ac = 49 > 0: two real roots. Vertex (0.75, -6.125); axis of symmetry x = 0.75; the parabola opens upward.

Formula used

x = (−b ± √(b² − 4ac)) ÷ 2a, computed as q = −½(b + sign(b)√D), x₁ = q/a, x₂ = c/q to avoid cancellation

This calculator solves any quadratic equation written as ax² + bx + c = 0. Enter the three coefficients and it returns both roots, real or complex,, the discriminant and the vertex, using a form of the formula that stays accurate when the roots differ greatly in size.

How to use the Quadratic Formula calculator

  1. Rearrange your equation so one side is 0, then read off a (the x² coefficient), b (the x coefficient) and c (the constant).
  2. Enter them in Coefficient a (x²), Coefficient b (x) and Constant c. A missing term has coefficient 0.
  3. Read the roots: two real values, one repeated value, or a complex pair written p ± qi.
  4. Check the detail line for the discriminant, the vertex, the axis of symmetry and whether the parabola opens up or down.

How the quadratic formula calculation works

Formulax = (−b ± √(b² − 4ac)) ÷ 2a, computed as q = −½(b + sign(b)√D), x₁ = q/a, x₂ = c/q to avoid cancellation

What the discriminant tells you

The roots are x = (−b ± √D) ÷ 2a, where D = b² − 4ac is the discriminant (DLMF equation 1.11.11). The sign of D decides what kind of answer you get before any square root is taken.

If D is positive there are two different real roots, and the parabola crosses the x-axis twice. If D is 0 the two roots merge into one repeated root, which sits exactly at the vertex. If D is negative there are no real roots: the parabola never touches the x-axis, and the roots are complex conjugates p ± qi with p = −b/(2a) and q = √(−D)/(2|a|).

Coefficient a cannot be 0. With no x² term the equation is linear, bx + c = 0, and the calculator says so rather than dividing by zero.

Why the calculator avoids the textbook form

Typed straight into a computer, the textbook formula can lose most of its accuracy. When b² is far larger than 4ac, √D is almost equal to |b|, and one of the two roots comes from subtracting two nearly equal numbers. Goldberg's well-known paper on floating-point arithmetic uses this formula to illustrate catastrophic cancellation.

The calculator instead computes q = −½(b + sign(b)√D), which adds two numbers of the same sign and so never cancels. The roots are then q/a and c/q; the second follows from the fact that the product of the roots equals c/a. For x² + 100,000,000x + 1 = 0 this gives the small root as −1 × 10⁻⁸, where the textbook form can lose most of its digits in ordinary double-precision arithmetic.

Worked examples

Solving 2x² − 3x − 5 = 0

Coefficient a (x²): 2 · Coefficient b (x): -3 · Constant c: -5

  1. D = (−3)² − 4 × 2 × (−5) = 9 + 40 = 49, which is positive, so there are two real roots.
  2. √49 = 7, so x = (3 ± 7) ÷ 4.
  3. x = 10 ÷ 4 = 2.5 or x = −4 ÷ 4 = −1.
  4. Vertex: x = 3 ÷ 4 = 0.75 and y = −49 ÷ 8 = −6.125.

Result: x = -1 or x = 2.5

A parabola that never crosses the axis: x² + 2x + 5 = 0

Coefficient a (x²): 1 · Coefficient b (x): 2 · Constant c: 5

  1. D = 2² − 4 × 1 × 5 = 4 − 20 = −16, so the roots are complex.
  2. p = −2 ÷ 2 = −1 and q = √16 ÷ 2 = 2.
  3. So x = −1 ± 2i: a conjugate pair with real part −1 and imaginary part ±2.

Result: x = -1 ± 2i

Assumptions and limits

Coefficient a must not be 0. Complex roots are shown as p ± qi. Results are rounded for display only.

Formula and worked examples last checked November 20, 2026. Spotted a problem? Report an error.

Frequently asked questions

What is the quadratic formula?

For ax² + bx + c = 0 with a ≠ 0, x = (−b ± √(b² − 4ac)) ÷ 2a. The ± gives the two roots. For x² + x − 6 = 0 it gives (−1 ± 5) ÷ 2, so x = 2 or x = −3.

What does it mean when the discriminant is negative?

The equation has no real solutions, and its graph stays entirely above or below the x-axis. The two solutions are complex numbers of the form p ± qi, where i = √−1, and the calculator shows them in that form.

How do I enter an equation like x² = 9 or 3x² + 4x = 0?

Move everything to one side first. x² = 9 becomes x² − 9 = 0, so a = 1, b = 0 and c = −9 (roots −3 and 3). For 3x² + 4x = 0 enter c = 0; one root is always 0 in that case.

What does the vertex tell me?

It is the highest or lowest point of the parabola. If a is positive the parabola opens upward and the vertex is a minimum; if a is negative it is a maximum.

Sources