Quadratic Equation Solver

Enter the coefficients a, b and c of a quadratic ax² + bx + c = 0 and get the two roots, the discriminant, the vertex, the axis of symmetry and the y-intercept. Real or complex, exact fractions where possible, decimal where not, with the working laid out so you can audit every step.

Explain like I'm 5 (what even is this calculator?)

A quadratic is an equation that, when drawn, makes a U-shaped curve called a parabola. The roots are the points where that curve crosses the x-axis. This page takes the three numbers in front of the x², x and constant terms, runs them through the quadratic formula, and tells you where the curve crosses, where its bottom (or top) sits, and what it looks like in summary.

Solve

Browser-only. The numbers you enter are processed in your browser. Nothing is uploaded.

Equation: ax² + bx + c = 0

a must be non-zero. With a = 0 the equation is linear, not quadratic, and a different calculator is the right tool.

Enter coefficients and press Solve.

Prove it

Method: the quadratic formula x = (−b ± √(b² − 4ac)) / (2a). Vertex from h = −b / (2a) and k = c − b² / (4a). When the coefficients are integers and the discriminant is a perfect square, the roots are reduced to exact fractions using the Euclidean algorithm for the greatest common divisor.

Useful? Save this calculator: press Ctrl + D to bookmark it.

What the quadratic formula actually does

Every quadratic equation in the standard form ax² + bx + c = 0 has exactly two roots, counting multiplicity, somewhere in the complex numbers. The quadratic formula, x = (−b ± √(b² − 4ac)) / (2a), is a closed-form expression for both of them. Plug in the three coefficients, do the arithmetic, and you have your answer. There is no iteration, no guessing, no graphical estimation. The maths is the same whether the roots are nice integers or messy irrationals or a complex conjugate pair.

The expression under the square root, b² − 4ac, is called the discriminant. It carries enough information by itself to tell you what kind of roots you are dealing with. A positive discriminant gives two distinct real roots. A discriminant of exactly zero gives one repeated real root, where the parabola touches the x-axis at its vertex without crossing. A negative discriminant means the square root pulls in an imaginary unit, and the two roots come out as a complex conjugate pair: p + qi and p − qi.

When you actually need this

School and university coursework is the obvious one, but quadratics show up well beyond the textbook. Projectile motion under constant gravity is a quadratic in time. The break-even point of a business with linear cost growth and a saturating demand curve often resolves to a quadratic. Optimising a rectangular area constrained by a fixed perimeter is a quadratic in one of the side lengths. Anywhere a quantity depends on the square of another quantity, with a linear correction and a constant, you end up with a quadratic to solve.

Common mistakes the calculator helps you avoid

Sign errors on b. The minus sign in the −b at the front of the formula trips up an enormous number of students. If your equation reads x² − 3x + 2 = 0, then b is −3, not 3, and −b is +3. Type the coefficient with its sign exactly as it appears in the equation and the calculator handles the rest.

Putting the equation in the wrong form first. The formula assumes ax² + bx + c = 0, with everything on one side and zero on the other. If your equation looks like 2x² = 5x − 1, rearrange to 2x² − 5x + 1 = 0 before reading off a, b and c. The calculator does not parse equations, only coefficients.

Forgetting that a = 0 breaks everything. If a is zero, the formula divides by zero and the equation is no longer quadratic. The calculator validates this and tells you so rather than returning a misleading answer. With a = 0 you have a linear equation, bx + c = 0, and a single root x = −c / b.

Stopping at the discriminant. Knowing that the discriminant is positive is useful, but it is only a label. The roots themselves are what most problems actually need. The page shows the discriminant first, then the full working, then the roots in both exact and decimal form where exact is meaningful.

Edge cases worth knowing about

Pure quadratic, no linear term: if b = 0, the formula simplifies to x = ±√(−c / a). The roots are symmetric about zero and the vertex sits on the y-axis. The calculator handles this without any special case.

No constant term: if c = 0, one of the roots is always zero (factor out an x), and the other is −b / a. The discriminant is b², which is a perfect square as long as b is an integer, so the calculator returns both roots as exact fractions.

Decimal coefficients: the formula works with any real a, b, c. The exact-fraction reduction only kicks in when all three coefficients are whole numbers and the discriminant is a perfect square. Otherwise the roots are reported as decimals to a sensible precision.

Very large or very small coefficients: floating-point arithmetic limits the precision of the answer when coefficients span many orders of magnitude. For most schoolwork and undergraduate problems this is not an issue. If you are solving a quadratic for serious numerical work, use a library like NumPy or a CAS that handles arbitrary-precision arithmetic.

Related calculators

Quadratics are one closed-form formula. These cover the rest of the toolkit.

Frequently asked questions

What does the discriminant tell me?

The discriminant is b² − 4ac, the bit under the square root in the quadratic formula. Its sign tells you what kind of roots you have without solving the equation. Positive means two distinct real roots and the parabola crosses the x-axis twice. Zero means one repeated real root and the parabola just touches the x-axis at its vertex. Negative means two complex conjugate roots and the parabola never touches the x-axis at all.

Why does this calculator sometimes show roots as fractions?

When all three coefficients are whole numbers and the discriminant is a perfect square, the roots are rational and can be written exactly as a reduced fraction. The calculator simplifies using the greatest common divisor so you get 1/2 rather than 4/8. When the discriminant is not a perfect square the roots are irrational, so a decimal approximation is the honest answer and no fraction is shown.

What is the vertex and why is it useful?

The vertex (h, k) is the turning point of the parabola y = ax² + bx + c. It is the minimum point if a is positive (a smile) and the maximum if a is negative (a frown). The formulas are h = −b / (2a) and k = c − b² / (4a). The vertex sits on the axis of symmetry, x = h, the vertical line that mirrors the parabola onto itself.

What does p + qi mean for the complex roots?

When the discriminant is negative, the square root in the quadratic formula gives an imaginary number. The two roots come out as a complex conjugate pair: p + qi and p − qi, where p is the real part (−b / 2a) and q is the imaginary part (√|D| / 2a). The roots are mirror images across the real axis on the complex plane. They still satisfy the original equation; they just do not appear as crossings on the standard x-axis graph.

Does this calculator send my numbers anywhere?

No. Everything runs in your browser using vanilla JavaScript. The coefficients you type never leave your device. You can disconnect from the network and the solver still works.