Quadratic Formula Calculator
Solve a quadratic equation ax² + bx + c = 0 with the quadratic formula. Returns both roots x₁ and x₂, a single repeated root, or the complex pair when no real solution exists.
Last updated: September 2026
Roots (x₁, x₂)
x₁ = -2, x₂ = -3
Formula below · 3 sources (mathworld.wolfram.com, khanacademy.org, Wikipedia) · Updated Sep 2026
Compare with similar
About this calculator
A quadratic equation has the form ax² + bx + c = 0, where a, b, and c are coefficients and a ≠ 0. The quadratic formula gives its solutions: x = (−b ± √(b² − 4ac)) / (2a). This calculator returns both roots: x₁ = (−b + √(b² − 4ac)) / (2a) with the plus sign and x₂ = (−b − √(b² − 4ac)) / (2a) with the minus sign. The expression under the root, b² − 4ac, is called the discriminant, and it determines the nature of the solutions. If the discriminant is positive, there are two distinct real roots; if it is exactly zero, there is one repeated real root, shown once; and if it is negative, there are no real solutions and the calculator gives the complex pair p ± qi, where p = −b/(2a) and q = √(4ac − b²)/|2a|. Geometrically, the real roots are the x-values where the parabola y = ax² + bx + c crosses the x-axis, so a positive discriminant means two crossings, zero means the vertex just touches the axis, and negative means the parabola never reaches it. Edge cases: if a = 0 the equation is linear, not quadratic, and dividing by 2a would fail, so the calculator reports the linear root x = −c/b instead (or that there is no equation in x when b is also 0). A quick check on any answer: the two roots sum to −b/a and multiply to c/a.
How to use
Example 1 — solve x² − 5x + 6 = 0. Enter a = 1, b = −5, c = 6. The discriminant is (−5)² − 4(1)(6) = 25 − 24 = 1, which is positive, so there are two real roots. x₁ = (5 + √1) / 2 = 6 / 2 = 3 and x₂ = (5 − 1) / 2 = 2, so the calculator shows x₁ = 3, x₂ = 2. Verify: (x − 2)(x − 3) = x² − 5x + 6, with roots summing to 5 and multiplying to 6. Example 2 — solve x² + 2x + 5 = 0. Enter a = 1, b = 2, c = 5. The discriminant is 2² − 4(1)(5) = 4 − 20 = −16, which is negative, so the calculator returns 'No real solutions (complex roots -1 ± 2i)'. Verify: the parabola opens upward with its vertex above the x-axis, so it never crosses, confirming the roots are complex rather than real.
Frequently asked questions
What is the discriminant and what does it tell me?
The discriminant is the quantity b² − 4ac found under the square root in the quadratic formula, and it reveals how many real solutions the equation has before you finish solving. If it is positive, the equation has two distinct real roots; if it equals zero, there is exactly one real root (a repeated root where the parabola touches the x-axis at its vertex); and if it is negative, there are no real roots because you cannot take the real square root of a negative number. In that last case this calculator says 'No real solutions' and gives the two complex roots instead. Checking the discriminant first is a fast way to understand the solution before computing the actual values. It is one of the most useful quick checks in all of algebra.
Why do I sometimes see only one root?
When the discriminant b² − 4ac is exactly zero, both roots of the quadratic formula are the same number, so the calculator shows it once and marks it as a repeated root: x² − 4x + 4 = 0 gives x = 2 (repeated root). Otherwise it always lists both roots, x₁ from the plus sign of ± and x₂ from the minus sign, or the complex pair when the discriminant is negative. If a = 0 the equation is linear and has a single root x = −c/b, which the calculator reports with a note that the equation is not quadratic.
What happens if the coefficient a is zero?
If a = 0, the equation is not actually quadratic — it reduces to the linear equation bx + c = 0, whose single solution is x = −c/b. The quadratic formula cannot be used because it divides by 2a. Instead of failing, this calculator says the equation is not quadratic and gives the linear root x = −c/b; if b is also 0 there is no x term left to solve for, and it says so. This is a common setup error: always confirm there is a genuine x² term before applying the quadratic formula.
How do I find complex roots when there is no real solution?
When the discriminant is negative, the roots are complex numbers involving the imaginary unit i, where i² = −1. They are x = (−b ± √(|discriminant|) · i) / (2a). For example, x² + 2x + 5 = 0 has discriminant −16, so the roots are (−2 ± 4i) / 2 = −1 ± 2i. This calculator computes them for you: it reports 'No real solutions' together with the complex pair, here 'complex roots -1 ± 2i'. The real part is −b/(2a) and the imaginary part is √(|discriminant|)/|2a|.
When should I NOT use the quadratic formula?
Do not use it when a = 0, because the equation is linear, not quadratic, and the formula breaks down. While the formula always works for genuine quadratics, simpler methods are sometimes faster: easily factorable equations can be solved by inspection, and equations of the form x² = k are solved by taking square roots directly. For equations of higher degree (cubics, quartics), the quadratic formula does not apply at all. Finally, watch your signs when entering b and c, as a sign error is the most common cause of a wrong answer.
Related calculators
Sources & references
Think a result is wrong? Report a problem with this calculator.