Free tool
Quadratic Formula Calculator
Solve ax² + bx + c = 0 with the quadratic formula: real and complex roots, discriminant, vertex and every step shown. Exact for rational roots.
- Solutions (exact form)
- –
- Your equation
- –
- Discriminant b² − 4ac
- –
- What the discriminant says
- –
- x₁ as a decimal
- –
- x₂ as a decimal
- –
- Vertex of the parabola
- –
- Sum and product of the roots
- –
Step by step
Assumptions and limits
Every figure comes from the numbers you enter. Where a rule of thumb is used, it is labeled as one.
- The equation is ax² + bx + c = 0 with a not equal to 0. The roots are (−b ± √(b² − 4ac)) ÷ 2a.
- Coefficients are read as exact fractions, so D = b² − 4ac and rational roots are computed with no rounding.
- Irrational roots are shown as a simplified radical when all three coefficients are whole numbers, and as decimals rounded to eight places and marked ≈.
- Complex roots are shown in the form p ± qi, with i² = −1.
- The vertex is at x = −b ÷ 2a. The sum of the roots is −b ÷ a and the product is c ÷ a.
Runs entirely in your browser. Nothing you type or upload is sent to our servers.
How the quadratic formula solves an equation
A quadratic equation has a squared term, a linear term and a constant, and the calculator reads it in the form ax² + bx + c = 0. The quadratic formula turns the three coefficients directly into the solutions, so it works even when the equation cannot be factored by inspection. The key quantity is the discriminant, D = b² − 4ac. Compute it first: its sign tells you which kind of answer to expect before you do any more work.
The calculator reports D, names the case, then substitutes into the formula and simplifies the radical when it can. For rational roots the arithmetic is exact. For irrational roots you get both a radical and a rounded decimal.
Worked example 1: two whole-number roots
Solve x² − 3x + 2 = 0, so a = 1, b = −3 and c = 2.
- D = b² − 4ac = (−3)² − 4 × 1 × 2 = 9 − 8 = 1.
- D is positive, so there are two real roots. √1 = 1.
- x = (3 ± 1) ÷ 2, so x = 4 ÷ 2 = 2 or x = 2 ÷ 2 = 1.
- Check: 2² − 3 × 2 + 2 = 4 − 6 + 2 = 0, and 1² − 3 × 1 + 2 = 0.
Worked example 2: roots with a radical
Solve 2x² + 4x + 1 = 0, so a = 2, b = 4 and c = 1.
- D = 4² − 4 × 2 × 1 = 16 − 8 = 8.
- √8 = √(4 × 2) = 2√2.
- x = (−4 ± 2√2) ÷ 4. Divide the top and bottom by 2: x = (−2 ± √2) ÷ 2.
- As decimals, x ≈ −0.29289322 or x ≈ −1.70710678.
When D is negative, as in x² + 2x + 5 = 0 where D = 4 − 20 = −16, the roots are −1 ± 2i.
Common mistakes
- Sign errors with b. When b is negative, −b is positive. Keep b in parentheses when you square it: (−3)² = 9, not −9.
- Dividing only part of the numerator. The whole numerator, including the radical, is divided by 2a.
- Forgetting the equation must equal 0. Move every term to one side before reading off a, b and c.
Related calculators
Simplify any radical that appears in a root with the Square Root Calculator. If a solution is a decimal that you want as a fraction, use the Decimal to Fraction Calculator. For the sides of right triangles, which also lead to squared terms, see the Pythagorean Theorem Calculator.
Frequently asked questions
What is the quadratic formula?
For an equation ax² + bx + c = 0 with a not equal to 0, the solutions are x = (−b ± √(b² − 4ac)) ÷ 2a. The ± means you compute it twice, once with plus and once with minus, to get both roots. Enter the three coefficients and the calculator substitutes them and shows each step.
What is the discriminant and what does it tell me?
The discriminant is D = b² − 4ac, the part under the square root. If D is positive, there are two different real roots. If D is 0, there is one repeated real root. If D is negative, there are no real roots and the two solutions are complex numbers. For x² − 3x + 2 = 0, D = 9 − 8 = 1, so there are two real roots.
How are complex roots shown?
When D is negative, the square root of D is imaginary, so the roots take the form p ± qi, where i² = −1. For x² + 2x + 5 = 0, D = −16, the real part is −1 and the imaginary part is 4 ÷ 2 = 2, so the roots are −1 + 2i and −1 − 2i. They always come as a pair that differ only in the sign of the imaginary part.
Why do some answers show a radical instead of a decimal?
When D is positive but not a perfect square, the roots are irrational, so the exact answer contains a square root. For 2x² + 4x + 1 = 0, D = 8 and √8 = 2√2, which gives x = (−2 ± √2) ÷ 2. The calculator shows that exact form and also the decimals, which are rounded and marked with ≈.
Can the coefficients be fractions or decimals?
Yes. Type 0.5 or 1/2 in any box. The arithmetic is exact, so a = 1/2, b = 0, c = −2 gives D = 4 and roots 2 and −2 with no rounding. Exact radical form is shown for whole-number coefficients; for other inputs the radical is left as √D and the decimals are shown.
What if a is 0?
Then the equation is not quadratic. With a = 0 the equation bx + c = 0 is linear, with the single solution x = −c ÷ b, and the quadratic formula would divide by zero. The calculator asks for a nonzero a, and you can solve the linear equation by hand with that one division.
What are the vertex, sum and product shown below the roots?
The vertex of the parabola y = ax² + bx + c is at x = −b ÷ 2a, with y found by substituting. The sum of the two roots equals −b ÷ a and their product equals c ÷ a. For x² − 3x + 2, the sum is 3 and the product is 2, matching the roots 1 and 2. These make quick checks on your answer.
Is anything I type saved or sent anywhere?
No. The calculation runs in your browser, and nothing you enter is stored or sent to our servers. Only a count that the tool was used is recorded, without any numbers from the form.
Link to this tool
Found it useful? Copy a link for your page, newsletter or documentation.
Get new tools and guides by email
Optional. The tool above works without signing up.
More free tools
Browse all everyday calculators or the full list of free tools.
- Long Division CalculatorDivide whole numbers with a quotient and remainder or a decimal answer, with every written step of the long division shown. Big numbers supported.
- Circumference CalculatorFind the circumference, area, radius and diameter of a circle from any one of them, with exact answers in terms of π and the working shown.
- Slope Calculator: Slope, Equation & Angle from Two PointsEnter two points to get the slope as a decimal and a reduced fraction, the line equation in y = mx + b form, the angle, the distance and the midpoint, with working.
- Online Stopwatch with LapsA free online stopwatch accurate to hundredths of a second, with lap and split times that mark your fastest and slowest laps. Runs in your browser, no sign-up.
- Gravel CalculatorEstimate gravel in cubic yards, cubic meters and tons for a driveway, path or base layer, with the density you enter and an optional extra allowance.
- Mulch CalculatorFind how many cubic yards and bags of mulch a garden bed needs from its size and depth, plus how much area a cubic yard covers at that depth.