Quadratic Formula Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Introduction to the quadratic formula

This quadratic formula calculator is designed for equations in the standard form ax^2 + bx + c = 0. Enter the coefficients a, b, and c, and the calculator returns the roots of x together with a discriminant check so you can see whether the answer set is real, repeated, or complex.

Quadratic equations are the algebraic shape behind many curved relationships. In classwork they are often the first equations that require more than simple factoring, and in applications they often describe parabolic motion or curved cost and revenue lines. This calculator is useful because the quadratic formula works for every equation with a ≠ 0, even when the roots are awkward, irrational, or not factorable over the integers.

If a = 0, the equation is no longer quadratic. The calculator then treats it as a linear equation when b ≠ 0. If both a and b are zero, the result depends on c: there is no solution when c ≠ 0, and every real number works when c = 0.

How to use the quadratic formula calculator

  1. Rewrite your equation in the form ax^2 + bx + c = 0, moving every term to one side.
  2. Enter the numerical values of a, b, and c. Negative numbers and decimals are accepted.
  3. Select Solve equation to calculate the roots.
  4. Read the result area to see whether the solutions are two real roots, one repeated root, a complex pair, or a linear fallback.

Tip: if your original equation is not already equal to zero, isolate it first. For example, 2x^2 = 8x - 6 becomes 2x^2 - 8x + 6 = 0, so a = 2, b = -8, c = 6.

Another common situation is when the equation is written with a leading negative or with terms out of order, such as -x^2 + 5 = 2x. Bring everything to one side and reorder by powers of x: -x^2 - 2x + 5 = 0. In that case a = -1, b = -2, and c = 5. The calculator accepts negative a values; the formula still works.

Formula and assumptions for the quadratic formula calculator

For a true quadratic equation with a ≠ 0, this calculator uses the standard quadratic formula:

x = (-b ± √(b² − 4ac)) / (2a)

The expression inside the square root is the discriminant: Δ = b² − 4ac. The discriminant determines the type of solutions:

  • Δ > 0: two distinct real roots.
  • Δ = 0: one repeated real root (a “double root”).
  • Δ < 0: two complex roots (a conjugate pair).

If a = 0, the equation becomes linear: bx + c = 0. In that case, the solution is x = -c / b when b ≠ 0. If a = 0 and b = 0, then the equation is either inconsistent (c ≠ 0, no solution) or true for all real numbers (c = 0, infinitely many solutions).

Interpretation note: the calculator reports numeric approximations. When the discriminant is negative, the square root involves √(-Δ), which produces an imaginary component. The calculator displays complex roots in the standard p ± qi form, where i is the imaginary unit satisfying i² = -1.

Worked examples for the quadratic formula calculator

The examples below mirror the kinds of inputs this quadratic formula calculator handles: one equation factors cleanly, one touches the x-axis once, and one produces a complex conjugate pair. You can copy the coefficients directly into the form.

Example 1: a quadratic with two real roots

Solve x^2 − 3x + 2 = 0. Here a = 1, b = -3, c = 2.

  • Compute the discriminant: Δ = b² − 4ac = (-3)² − 4(1)(2) = 9 − 8 = 1.
  • Since Δ > 0, there are two real roots.
  • Compute the roots: x = (3 ± √1) / 2, so x = (3 + 1)/2 = 2 and x = (3 − 1)/2 = 1.

If you enter a = 1, b = -3, c = 2 in the calculator, you should see two real roots close to 2.000000 and 1.000000.

Example 2: a repeated root at the x-axis

Solve 2x^2 + 8x + 8 = 0. Here a = 2, b = 8, c = 8.

  • Discriminant: Δ = 8² − 4(2)(8) = 64 − 64 = 0.
  • Since Δ = 0, there is exactly one real solution, but it occurs twice (a double root).
  • Root: x = -b/(2a) = -8/(4) = -2.

In graphing terms, a double root means the parabola touches the x-axis at one point and turns around there instead of crossing it.

Example 3: a negative discriminant and complex roots

Solve x^2 + 2x + 5 = 0. Here a = 1, b = 2, c = 5.

  • Discriminant: Δ = 2² − 4(1)(5) = 4 − 20 = -16.
  • Since Δ < 0, the solutions are complex.
  • Real part: -b/(2a) = -2/2 = -1.
  • Imaginary magnitude: √(-Δ)/(2a) = √16/2 = 4/2 = 2.
  • Roots: x = -1 ± 2i.

Complex roots often appear in control theory, signal processing, and any setting where oscillations are modeled. Even if a real-world variable cannot be complex, complex roots can still be meaningful in intermediate calculations.

Common coefficient mistakes (and how to avoid them)

Most wrong answers in a quadratic formula calculator come from copying the coefficients incorrectly, not from the formula itself. Use these quick checks before you calculate.

  • Forgetting to move all terms to one side: If your equation is x^2 + 4x = 1, rewrite it as x^2 + 4x - 1 = 0. Here c is -1, not 1.
  • Dropping a negative sign: If you have x^2 - (3x - 2) = 0, distribute the minus: x^2 - 3x + 2 = 0. That makes b = -3 and c = 2.
  • Misreading the middle term: In x^2 - x + 6 = 0, the coefficient b is -1, not 1.
  • Using fractions: If your equation is (1/2)x^2 + (3/4)x - 2 = 0, you can enter decimals (a = 0.5, b = 0.75, c = -2) or multiply the entire equation by 4 to clear denominators: 2x^2 + 3x - 8 = 0. Both approaches produce the same roots.

A quick check is to plug your computed root back into the original equation. If the left-hand side is close to zero, allowing for rounding, your coefficients and arithmetic are consistent.

Understanding the output

The result area of this quadratic formula calculator uses short messages so you can identify the type of root quickly:

  • Two real roots: You will see two numbers. Either order is fine; both satisfy the equation.
  • One repeated real root: You will see a single number. Algebraically it counts as two identical solutions.
  • Complex roots: You will see two values in p ± qi form. They are conjugates, meaning the real part is the same and the imaginary parts have opposite signs.
  • Linear solution: If a = 0 and b ≠ 0, the calculator solves bx + c = 0.
  • No solution / all real numbers: If a = 0 and b = 0, the equation reduces to c = 0 (always true) or c ≠ 0 (never true).

The calculator rounds displayed values to six decimal places for readability. Exact answers may be repeating decimals or irrational numbers, so the display is usually an approximation rather than a symbolic result. If you need to inspect how a root behaves under scaling, remember that multiplying a, b, and c by the same nonzero factor leaves the roots unchanged.

Limitations and notes

A few numerical details are worth keeping in mind when you use this quadratic formula calculator:

  • Rounding: Results are displayed to 6 decimal places. Exact values may be repeating decimals or irrational numbers.
  • Very large or very small numbers: JavaScript uses floating-point arithmetic. Extremely large coefficients can lead to rounding error.
  • Equality checks: The calculator classifies the discriminant using comparisons to 0. For values extremely close to 0, floating-point precision may affect whether it is treated as zero.
  • Complex roots format: Complex solutions are shown in a ± bi form. The calculator does not simplify radicals or express results in exact symbolic form.
  • Not a graphing tool: This page computes roots only; it does not plot the parabola or show step-by-step factoring.

For best results, enter coefficients exactly as they appear in standard form and double-check the signs before you solve. If you are working from a word problem, make sure the equation you build matches the situation before interpreting the roots. When the equation models a real quantity such as time or distance, remember that not every mathematical root is physically meaningful; you may need to discard negative time values or other impossible solutions.

Frequently asked questions about the quadratic formula calculator

Does the quadratic formula always work?

Yes, for any quadratic equation with a ≠ 0. This calculator uses the quadratic formula rather than factoring, so it still produces answers when the roots are awkward or when the quadratic does not factor nicely. If a = 0, the equation is no longer quadratic, and the calculator switches to the linear solution when possible.

Why do I get complex roots when I expected real ones?

Complex roots appear when the discriminant is negative. If you expected real roots, re-check the coefficients you entered, especially the sign of c after moving every term to one side. It is also worth confirming that b and c were not swapped while you were copying the equation into the calculator.

What does a repeated root mean?

A repeated root happens when Δ = 0. In the quadratic formula calculator, that means the parabola meets the x-axis at exactly one point. In factoring terms, the quadratic can be written as a(x - r)^2, where r is the repeated root.

Can I enter integers, decimals, or negative numbers?

Yes. The inputs accept real numbers that your browser can parse as numeric values, including negative values and decimals. If you have fractions, you can convert them to decimals or multiply the entire equation by a common denominator to clear them before you solve. Either approach gives the same roots.

How can I verify the answer?

Substitute each reported root back into ax^2 + bx + c. For a correct root, the result should be very close to zero. Small nonzero values can occur because the calculator rounds its displayed answers to six decimal places, especially when coefficients are large or when the discriminant is close to zero.

Enter coefficients

Use the standard form ax^2 + bx + c = 0. Decimals are allowed. If a = 0, the calculator will solve the linear equation bx + c = 0 when possible.

Enter coefficients and calculate.

Embed this calculator

Copy and paste the HTML below to add the Quadratic Formula Calculator for ax² + bx + c = 0 — Real, Repeated, or Complex Roots to your website.