Menu

Quadratic Formula Calculator

Solve any quadratic equation with every step written out, exactly.

By Nethanel Bar, Co-founder & CEO

Last updated

Want to solve these without the calculator?

The Coddy math course teaches the method itself - you work each step on an interactive board and get told exactly where a move went wrong.

What the quadratic formula actually does

A quadratic equation is any equation you can write as ax² + bx + c = 0, where a is not zero. The quadratic formula, x = (-b ± √(b² - 4ac)) / 2a, solves every single one of them - which is unusual and worth appreciating. Factoring works only when the numbers happen to be friendly; completing the square works always but takes practice; the formula works always and takes only care.

The part doing the real work is under the square root. b² - 4ac is called the discriminant, and its sign decides the shape of the answer before you calculate anything else: positive means two roots, zero means one repeated root, negative means no real solution at all. Checking the discriminant first tells you what kind of answer to expect, which is the fastest way to catch an arithmetic slip later.

The formula is not a single move, and that is the most common misunderstanding about it. It is a short procedure: substitute, evaluate the discriminant, take the root, split the ±, then reduce each branch. This calculator walks all five so you can see which one you would have got wrong.

What to watch for in the steps

  • Every negative coefficient is substituted inside brackets. -b when b = -5 is -(-5) = 5, and losing that sign is the single most common mistake in the whole topic.
  • The discriminant is computed on its own line, before anything else. Its sign is the answer's shape.
  • √12 is simplified to 2√3 rather than left alone or turned into 3.464. An exact radical is the answer; a decimal is a measurement of it.
  • The ± is split explicitly into two cases. It is shorthand for two separate calculations, not an operation you can carry to the end.
  • When both roots are rational, the factored form is shown as a check - expanding it should return the equation you started with.
  • The formula is not a rule handed down from nowhere: it is completing the square, done once in general so nobody has to do it again. The derivation below is that one time.

How to solve a quadratic equation with the formula

  1. Enter the three coefficients

    Type a, b and c into the boxes. Whole numbers, decimals and fractions like 1/2 all work. A missing term means a coefficient of zero: for x² - 4 = 0, b is 0.

  2. Or paste the whole equation

    Type something like 2x^2 - 5x + 2 = 0 into the equation field and press Read it. Terms on both sides are collected onto the left automatically, so 3x^2 = 2x + 1 works too.

  3. Read the discriminant before the roots

    Step four gives you b² - 4ac. Note its sign and predict the shape of the answer - two roots, one, or none - before scrolling on.

  4. Compare your own working line by line

    If your answer disagreed, the useful question is not which number is right but which step diverged. Find that line and the mistake explains itself.

Where the quadratic formula comes from

The formula is not an axiom. It is what you get by completing the square on the general equation once, so that nobody has to do it again on their own numbers. Working through it a single time is the difference between remembering the formula and knowing it.

  1. Start from the general quadratic

    a x^2 + b x + c = 0

    a cannot be zero - without an x² term there is nothing quadratic to solve, and the 2a underneath would be zero too.

  2. Divide every term by a

    x^2 + (b/a) x + c/a = 0

    Completing the square needs a bare x², so the a has to come off the front. This is also the step that puts a into the denominator, where it stays for the rest of the derivation.

  3. Move the constant to the other side

    x^2 + (b/a) x = -c/a

  4. Add the square of half the x-coefficient to both sides

    x^2 + (b/a) x + b^2/(4a^2) = -c/a + b^2/(4a^2)

    Half of b/a is b/2a, and its square is b²/4a². This is the move the whole derivation turns on: it is exactly what the left side was missing to be a perfect square.

  5. Write the left side as a square, and the right over one denominator

    (x + b/(2a))^2 = (b^2 - 4ac)/(4a^2)

    There is the discriminant, b² - 4ac, arriving on its own before anyone gave it a name.

  6. Take the square root of both sides

    x + b/(2a) = ±sqrt(b^2 - 4ac)/(2a)

    Both signs, because both square to the same thing. The 2a comes out of √(4a²) as |2a|, and the ± in front absorbs the sign either way.

  7. Subtract b/2a and write it as a single fraction

    x = (-b ± sqrt(b^2 - 4ac))/(2a)

Nothing in those seven lines used a particular a, b or c, which is why the result holds for every quadratic there is. It is also why the discriminant decides the answer's shape: it is the number under the root, and if it is negative, step six has nowhere to go.

What the discriminant tells you

The value of b² - 4ac decides everything about the answer's shape before you take a single square root.

DiscriminantReal rootsThe graphExample
b² - 4ac > 0Two different real rootsCrosses the x-axis twicex² - 5x + 6 = 0 → x = 3, x = 2
b² - 4ac = 0One repeated rootTouches the x-axis oncex² - 4x + 4 = 0 → x = 2
b² - 4ac < 0No real solutionNever reaches the x-axisx² + 2x + 5 = 0
A perfect squareTwo rational rootsCrosses at two fractions or integers2x² - 5x + 2 = 0 → x = 2, x = 1/2
Positive, not a squareTwo irrational rootsCrosses at two radicalsx² - 4x + 1 = 0 → x = 2 ± √3

Worked examples

Two whole-number roots: x² - 5x + 6 = 0

plain
a = 1, b = -5, c = 6

The discriminant is (-5)² - 4(1)(6) = 25 - 24 = 1. Its square root is exactly 1, so the roots are (5 + 1)/2 = 3 and (5 - 1)/2 = 2. Because the discriminant is a perfect square, both roots are rational and the equation also factors as (x - 3)(x - 2) = 0. This is the case where factoring would have been quicker.

A fractional root: 2x² - 5x + 2 = 0

plain
a = 2, b = -5, c = 2

The discriminant is 25 - 16 = 9, so √9 = 3 and the roots are (5 + 3)/4 = 2 and (5 - 3)/4 = 1/2. Notice that the second root stays as 1/2 and is never shown as 0.5 - a fraction is the exact value, and the decimal is an approximation of it that happens to be short.

Irrational roots: x² - 4x + 1 = 0

plain
a = 1, b = -4, c = 1

The discriminant is 16 - 4 = 12, which is not a perfect square. √12 simplifies to 2√3, so the roots are (4 ± 2√3)/2 = 2 ± √3. This is where most calculators start printing 3.7320508 and stop being useful: 2 + √3 is the answer, and any decimal is a rounding of it.

No real solution: x² + 2x + 5 = 0

plain
a = 1, b = 2, c = 5

The discriminant is 4 - 20 = -16. No real number squares to a negative, so the equation has no real solution and the derivation stops there. The parabola sits entirely above the x-axis. If your course has reached complex numbers the roots are -1 ± 2i, but whether that counts as an answer depends on which number system you have been taught to work in.

Common mistakes

  • Losing the sign on -b. If b = -5 then -b = +5. Substituting -5 instead is the mistake that produces a plausible but wrong pair of roots.
  • Forgetting that a can be negative. In -x² + 2x = 0, a is -1, and the 2a in the denominator is -2.
  • Dividing only part of the numerator. In (4 ± 2√3)/2 both the 4 and the 2√3 are divided by 2. Halving just the 4 is a very common slip.
  • Carrying the ± to the end and treating it as one answer. It stands for two separate calculations that have to be finished separately.
  • Reaching for the formula when a = 0. That equation is linear, and the formula divides by 2a - which is zero.
  • Stopping at x = (5 + 1)/2. That is not an answer yet, it is arithmetic waiting to be done.

Quadratic formula FAQ

What is the quadratic formula?
x = (-b ± √(b² - 4ac)) / 2a. It gives the solutions to any equation of the form ax² + bx + c = 0 where a is not zero. It is derived by completing the square on the general equation, which is why it works universally rather than only on convenient numbers.
How is the quadratic formula derived?
By completing the square on ax² + bx + c = 0. Divide through by a, move the constant across, add (b/2a)² to both sides so the left is a perfect square, take the square root of both sides - which is where the ± enters - and subtract b/2a. The seven lines are set out above. Nothing in them depends on the particular numbers, which is why the result holds for every quadratic.
Why does the quadratic formula have a ± in it?
Because the derivation takes the square root of both sides, and a positive number has two square roots: 3 and -3 both square to 9. Both have to be carried forward, so the ± is shorthand for two separate calculations - and it is the reason a quadratic usually has two solutions rather than one.
Is this calculator free, and are the steps free?
Both are free, with no sign-up. That is worth stating plainly because the two best-known step-by-step math sites show you the answer and then ask for a subscription to see how it was reached. The whole point of this page is that the working is the useful part.
Why does it show 2 + √3 instead of 3.732?
Because 2 + √3 is the answer and 3.732 is a rounding of it. If your homework asks for an exact value, a decimal will be marked wrong. The approximation is shown underneath for when you need to sanity-check a graph or a measurement.
What does it mean when the discriminant is negative?
It means the equation has no real solution: the parabola never crosses the x-axis. In courses that have introduced complex numbers there are still two solutions, written a ± bi, but until then "no real solution" is the complete and correct answer.
Should I use the quadratic formula or factoring?
Factor first if you can spot the factors within a few seconds - it is faster and less error-prone. Use the formula when the numbers do not cooperate, when the coefficient of x² is not 1, or when you suspect the roots are irrational. The formula never fails; factoring only works on equations that were built to be factorable.
Can it handle fractions and decimals as coefficients?
Yes. Enter fractions as 1/2 or 3/4 and decimals as 0.5. Decimals are converted to exact fractions internally, so 0.1 behaves as one tenth rather than as the binary approximation a floating-point calculator would use.
How do I get the equation into ax² + bx + c = 0 form?
Move every term to one side so the other side is zero, then collect like terms. For 3x² = 2x + 1, subtract 2x and 1 from both sides to get 3x² - 2x - 1 = 0. The equation field on this page does that rearrangement for you if you paste the original.

More math tools

Coddy programming languages illustration

Learn math with Coddy

GET STARTED