Maths & numbers

Quadratic equation solver

Solve ax² + bx + c = 0, including complex roots.

Quadratic equation solver
Esc to restore

Your inputs

Results update as you type. Larger files run when you press Update result.

Your result

Your result will appear here.

More actions

Your inputs stay in this browser. Nothing is uploaded, and nothing is saved unless you choose “Save result”.

A clear answer. Here’s how.

Uses the quadratic formula, with scaling and a cancellation-resistant calculation for distinct real roots. The coefficient a must be non-zero. Extremely small or large coefficients may exceed floating-point precision.

How this is checked

4 reference checks passed These 4 cases were run when this page was built, on 3 December 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.

See the checks and where each expected answer comes from
  1. Case 1

    Inputs
    a (coefficient of x²) 1b (coefficient of x) -5c (constant) 6
    Expected, and what Toolmoz gave
    x1 expected 2, Toolmoz 1.9999999999999991x2 expected 3, Toolmoz 3.0000000000000013
    Where the expected answer comes from
    Factorise x² − 5x + 6 = (x − 2)(x − 3)
    Allowed difference
    ±1e-12
  2. Case 2

    Inputs
    a (coefficient of x²) 2b (coefficient of x) -3c (constant) -2
    Expected, and what Toolmoz gave
    x1 expected -0.5, Toolmoz -0.49999999999999994x2 expected 2, Toolmoz 2.0000000000000004
    Where the expected answer comes from
    x = (3 ± √(9 + 16)) ÷ 4 = (3 ± 5) ÷ 4, so −1/2 and 2; the roots are listed in ascending order
    Allowed difference
    ±1e-12
  3. Case 3

    Inputs
    a (coefficient of x²) 1b (coefficient of x) 2c (constant) 1
    Expected, and what Toolmoz gave
    x1 expected -1, Toolmoz -1
    Where the expected answer comes from
    x² + 2x + 1 = (x + 1)², a repeated root at −1 because the discriminant 4 − 4 is zero
    Allowed difference
    exact
  4. Case 4

    Inputs
    a (coefficient of x²) 1b (coefficient of x) 2c (constant) 5
    Expected, and what Toolmoz gave
    text expected x = -1 ± 2i, Toolmoz x = -1 ± 2i
    Where the expected answer comes from
    Discriminant 4 − 20 = −16, so x = (−2 ± 4i) ÷ 2 = −1 ± 2i
    Allowed difference
    exact

What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

a (coefficient of x²)
1
b (coefficient of x)
-5
c (constant)
6

Example result

x1
2
x2
3

Two distinct real roots.