Quadratic Formula Calculator

Enter the three coefficients of a quadratic equation to get its roots in exact and decimal form, with the discriminant, the vertex of the parabola and the full working.

Your results

–

Save this calculation and come back to it any time. Members only — $5 every 3 months, ad-free.

Become a member

How to use the quadratic formula calculator

  1. Write your equation in the standard form ax² + bx + c = 0. Move every term to one side first, so 2x² = 4x + 3 becomes 2x² − 4x − 3 = 0.
  2. Enter a, the number in front of x². It can't be 0.
  3. Enter b, the number in front of x. Use 0 if there is no x term.
  4. Enter c, the constant. Use 0 if there is none.
  5. Read the roots at the top, then the discriminant, factored form, vertex and the numbered working underneath.

Decimals are fine. The calculator scales them to whole numbers behind the scenes, so 0.5x² + 1.5x + 0.5 = 0 still gets an exact answer.

The quadratic formula

x = (−b ± √(b² − 4ac)) / 2a Discriminant D = b² − 4ac Vertex (−b / 2a, c − b² / 4a)

The ± gives two answers: one with + and one with −. The part under the root, the discriminant, decides what kind of answers you get. When D is positive there are two real roots. When D is zero the two answers are the same number, a double root. When D is negative there are no real roots, and the formula gives two complex numbers that use i, the square root of −1.

If the coefficients are whole numbers and D is a perfect square, such as 1, 4, 9 or 49, the roots are fractions and the equation factors neatly. Otherwise the roots are irrational and the calculator simplifies the root, for example √40 = 2√10.

Worked example

The calculator opens with x² + 3x + 1 = 0, so a = 1, b = 3 and c = 1.

  1. Discriminant: D = 3² − 4 × 1 × 1 = 9 − 4 = 5.
  2. D is positive but not a perfect square, so there are two irrational roots.
  3. x = (−3 ± √5) / 2, which is the exact answer: (-3 ± √5)/2.
  4. √5 ≈ 2.236068, so x₁ = (−3 + 2.236068) / 2 ≈ −0.381966 and x₂ = (−3 − 2.236068) / 2 ≈ −2.618034.
  5. Vertex: x = −3 / 2 = −1.5 and y = 1 − 9/4 = −1.25, so the lowest point of the parabola is (−1.5, −1.25).

You can check the roots with Vieta's rules: they add up to −b/a = −3 and multiply to c/a = 1.

What the discriminant tells you

Discriminant Roots Graph of y = ax² + bx + c Example
Positive perfect square Two rational roots Crosses the x-axis twice x² + 5x + 6 = 0 gives −2 and −3
Positive, not a square Two irrational roots Crosses the x-axis twice x² + 3x + 1 = 0
Zero One double root Touches the x-axis at the vertex x² − 6x + 9 = 0 gives 3
Negative Two complex roots Never reaches the x-axis x² + 2x + 5 = 0 gives −1 ± 2i

Common mistakes

  • Dropping the sign of b. The formula starts with −b, so when b is −4, −b is +4.
  • Squaring a negative b without brackets. (−4)² is 16, not −16. The working shows the brackets for this reason.
  • Dividing only part of the top by 2a. The whole expression −b ± √D sits over 2a.
  • Not rearranging first. The formula only works once one side of the equation is 0.

Frequently asked questions

What if a is 0?

Then there is no x² term and the equation is linear, not quadratic. The calculator tells you the single answer, x = −c ÷ b, and asks for a nonzero a if you want to solve a quadratic.

Why does the answer have an i in it?

The discriminant is negative, so the formula asks for the square root of a negative number. No real number squares to a negative, so the roots are complex: a real part plus or minus a multiple of i, where i² = −1. The parabola never crosses the x-axis.

How do I know if a quadratic factors?

With whole-number coefficients, it factors over the rationals exactly when the discriminant is a perfect square. The calculator shows the factored form in that case, such as (x + 2)(x + 3) for x² + 5x + 6.

Is completing the square the same as the quadratic formula?

Yes, the formula is what you get by completing the square on ax² + bx + c = 0 in general. Completing the square by hand also gives the vertex form a(x − h)² + k, and the calculator shows that vertex (h, k) directly.

Related calculators

  • Factor Calculator — Every factor and factor pair of a whole number, with the count, the sum and prime, perfect or abundant checks.
  • Slope Calculator — Slope of a line from two points, or its equation from a point and a slope, with intercepts, angle and distance.
  • Root Calculator — Square roots, cube roots and any nth root, with the simplified radical form such as √72 = 6√2.
  • Exponent Calculator — Raise any number to any power, including negative and fractional exponents, or solve for the exponent or the base.

Results are calculated in your browser. Double-check anything important before you rely on it. See our disclaimer.