Skip to content
Zesona
Quadratic Equation SolverLocal

Quadratic Equation Solver

Solve ax^2 + bx + c = 0 with an exact discriminant, giving exact rational roots where they exist and complex roots where they do not.

  • Free
  • No sign-up
  • Runs in your browser

Input

Runs in your browser

A whole number, a decimal, or a fraction such as 3/4. Arithmetic is exact, so fractions stay exact.

A whole number, a decimal, or a fraction such as 3/4. Arithmetic is exact, so fractions stay exact.

A whole number, a decimal, or a fraction such as 3/4. Arithmetic is exact, so fractions stay exact.

How many digits to show when the answer is irrational. An exact answer ignores this.

Try an example

Ready

Everything happens on this device. No upload, no account, no network request.

How to use this tool

  1. 1

    Enter the three coefficients.

  2. 2

    The discriminant decides the shape of the answer, and is computed exactly before any root is taken.

  3. 3

    A negative discriminant gives two complex roots, which are shown rather than refused.

Questions about Quadratic Equation Solver

Why are the roots sometimes exact and sometimes not?

Because the discriminant b^2 - 4ac is computed exactly, and when it is a perfect square the roots are rational. x^2 - 5x + 6 has discriminant 1, so the roots are exactly 2 and 3 - not 2.0000000000000004. When the discriminant is not a perfect square the roots are irrational and are shown to a stated number of digits.

What does a negative discriminant mean?

That the parabola never crosses the x-axis, so there are no real roots. There are still exactly two roots over the complex numbers, and they are shown as a conjugate pair. "No real solutions" is a fact about the real numbers, not a failure of the problem, so refusing to answer would be withholding the result.

How can I check the roots?

They should sum to -b/a and multiply to c/a - Vieta’s formulas. Both are shown alongside, and both are exact even when the roots themselves are irrational, which makes them a genuinely useful check.

What if a is zero?

Then it is not a quadratic but a linear equation, with at most one root. It is solved as one, and a note says so rather than dividing by zero in the quadratic formula.

Is my data sent anywhere?

No. This runs as JavaScript in your browser tab: there is no network request carrying your numbers, nothing reaches a server log, and it keeps working with your connection off. You can confirm it in the browser’s network panel.

Other tools you might reach for next.