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

LOCAL & PRIVATE

Your result will appear here.

Your inputs stay in this browser. Nothing is uploaded or saved.

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.

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.