๐ฅ Quadratic Formula Calculator (Real and Complex Roots)
By ToolNimba Editorial Team ยท Updated 2026-06-25
Solve ax2 + bx + c = 0 with the quadratic formula. Enter the coefficients and read the roots, discriminant, vertex and axis of symmetry instantly.
Enter coefficients a, b and c to solve the equation.
This quadratic formula calculator solves any equation of the form ax squared plus bx plus c equals zero. Type in the three coefficients a, b and c and it returns the roots, whether they are real or complex, along with the discriminant, the vertex of the parabola and its axis of symmetry. Everything runs in your browser at full floating-point precision, so the answers are exact and nothing is sent anywhere.
What is the Quadratic Formula Calculator?
Every quadratic equation can be written as a x^2 + b x + c = 0, where a is not zero. The quadratic formula, x = (-b plus or minus the square root of (b^2 - 4ac)) divided by 2a, gives both solutions directly from the three coefficients. It works for any quadratic, which is what makes it the most reliable method when factoring is awkward or impossible.
The expression under the square root, b^2 - 4ac, is called the discriminant and it controls everything about the answer. When the discriminant is positive the square root is a real number, so you get two different real roots and the parabola crosses the x axis twice. When the discriminant is exactly zero the square root vanishes, leaving a single repeated root where the parabola just touches the x axis. When the discriminant is negative the square root of a negative number is imaginary, so the two roots are complex conjugates of the form p + qi and p - qi.
Beyond the roots, the same coefficients describe the shape of the parabola. The axis of symmetry is the vertical line x = -b / 2a, and the vertex (the highest or lowest point) sits at (-b / 2a, c - b^2 / 4a). The sign of a tells you which way the parabola opens: positive a opens upward with a minimum at the vertex, negative a opens downward with a maximum. This calculator reports all of these together so you can see the full picture in one place.
A special case worth knowing is a = 0. When a is zero the x squared term disappears and the equation is no longer quadratic, it is linear: b x + c = 0, whose single solution is x = -c / b. If both a and b are zero the equation collapses to c = 0, which has no solution when c is non-zero and infinitely many when c is also zero. This tool detects that case and explains it rather than dividing by zero.
When to use it
- Solving algebra and precalculus homework where you must find the roots of a quadratic equation.
- Checking your factoring or completing-the-square work against an independent method.
- Finding where a projectile or thrown object hits the ground from its height equation.
- Locating the vertex and axis of symmetry to sketch a parabola accurately.
- Confirming whether an equation has real or complex roots before continuing a larger problem.
- Computing break-even points or optimisation turning points that reduce to a quadratic.
How to use the Quadratic Formula Calculator
- Enter the coefficient a (the number in front of x squared); it must not be zero for a true quadratic.
- Enter the coefficient b (the number in front of x) and c (the constant term).
- Read the two roots, which appear as real numbers or as complex conjugates p + qi when the discriminant is negative.
- Check the discriminant, vertex and axis of symmetry below the roots, then use Copy to grab the full result.
Formula & method
Worked examples
Solve x^2 - 3x + 2 = 0, so a = 1, b = -3, c = 2.
- Discriminant D = (-3)^2 - 4(1)(2) = 9 - 8 = 1, which is positive, so expect two real roots.
- Square root of D = 1.
- x1 = (-(-3) + 1) / (2 * 1) = (3 + 1) / 2 = 2.
- x2 = (-(-3) - 1) / (2 * 1) = (3 - 1) / 2 = 1.
Result: Two real roots: x = 2 and x = 1. Vertex at (1.5, -0.25), axis of symmetry x = 1.5.
Solve x^2 + 2x + 5 = 0, so a = 1, b = 2, c = 5.
- Discriminant D = 2^2 - 4(1)(5) = 4 - 20 = -16, which is negative, so the roots are complex.
- Real part = -b / 2a = -2 / 2 = -1.
- Imaginary part = square root of 16 / 2 = 4 / 2 = 2.
- Write the conjugate pair using the real and imaginary parts.
Result: Two complex roots: x = -1 + 2i and x = -1 - 2i.
What the discriminant D = b^2 - 4ac tells you
| Discriminant value | Number of roots | Type of roots | Parabola and the x axis |
|---|---|---|---|
| D > 0 | Two | Distinct real | Crosses the x axis at two points |
| D = 0 | One (repeated) | Real double root | Touches the x axis at one point |
| D < 0 | Two | Complex conjugates | Does not touch the x axis |
Sample equations and their solutions
| Equation | a, b, c | Discriminant | Roots |
|---|---|---|---|
| x^2 - 3x + 2 = 0 | 1, -3, 2 | 1 | x = 2, x = 1 |
| x^2 - 4x + 4 = 0 | 1, -4, 4 | 0 | x = 2 (repeated) |
| x^2 + 2x + 5 = 0 | 1, 2, 5 | -16 | x = -1 + 2i, x = -1 - 2i |
| 2x^2 - 3x - 2 = 0 | 2, -3, -2 | 25 | x = 2, x = -0.5 |
Common mistakes to avoid
- Dropping the sign on b. The formula begins with minus b, so if b is negative you end up adding. For b = -3, the term -b is +3. Forgetting this flips the sign of your roots.
- Squaring b incorrectly. b^2 is always non-negative because squaring a negative gives a positive. (-3)^2 is 9, not -9. A wrong sign here corrupts the entire discriminant.
- Dividing only part of the numerator by 2a. The whole expression -b plus or minus the root is divided by 2a, not just the square root. Keep the numerator together, for example (3 + 1) / 2, before dividing.
- Treating a negative discriminant as an error. A negative discriminant does not mean there is no answer. It means the two roots are complex conjugates of the form p + qi, which this calculator computes for you.
Glossary
- Quadratic equation
- An equation of the form a x^2 + b x + c = 0 where a is not zero. Its graph is a parabola.
- Coefficient
- A number multiplying a term. Here a multiplies x squared, b multiplies x, and c is the constant.
- Discriminant
- The value b^2 - 4ac under the square root. Its sign decides whether the roots are real or complex.
- Root (or solution)
- A value of x that makes the equation equal zero. A quadratic has two roots, counting multiplicity.
- Complex conjugate
- A pair of numbers p + qi and p - qi that differ only in the sign of their imaginary part.
- Vertex
- The turning point of the parabola, its lowest point when a is positive or highest when a is negative.
Frequently asked questions
What is the quadratic formula?
The quadratic formula is x = (-b plus or minus the square root of (b^2 - 4ac)) divided by 2a. It gives both solutions of a x^2 + b x + c = 0 directly from the coefficients a, b and c, and it works for every quadratic equation.
How do I find the discriminant?
Compute b^2 - 4ac. This single number determines the roots: positive means two real roots, zero means one repeated real root, and negative means two complex conjugate roots. This calculator shows the discriminant alongside the answers.
What happens when the discriminant is negative?
A negative discriminant gives two complex roots of the form p + qi and p - qi, where p = -b / 2a is the real part and q = the square root of the absolute discriminant divided by 2a is the imaginary part. The calculator displays both conjugates.
Can this calculator solve an equation when a is 0?
Yes. If a is 0 the equation is not quadratic but linear, b x + c = 0, with the single solution x = -c / b. If both a and b are 0 the tool reports either no solution or infinitely many, depending on c.
How do I find the vertex and axis of symmetry?
The axis of symmetry is the line x = -b / 2a, and the vertex sits at (-b / 2a, c - b^2 / 4a). The vertex is the minimum when a is positive and the maximum when a is negative. Both are shown below the roots.
Is the quadratic formula always better than factoring?
The quadratic formula always works, even when an equation will not factor neatly or has complex roots, so it is the most reliable method. Factoring can be faster for simple integer cases, but the formula never fails, which is why it is the safe default.