Quadratic Formula

Solves ax² + bx + c = 0 directly from the coefficients a, b and c.

x = (−b ± √(b² − 4ac)) ÷ 2a

D = b² − 4ac is the discriminant: D > 0 gives two real roots, D = 0 one repeated root, D < 0 no real roots.

The roots are the x-coordinates where the parabola y = ax² + bx + c crosses the x-axis.

Calculator

Change a value and the result and picture update instantly.

Result

Discriminant D1
Root x₁2
Root x₂1

Animated picture

The picture follows your values. Some points and shapes can be dragged.

Use in game development

Solve a quadratic to find when a bullet hits a moving target, or where a ray hits a sphere in ray tracing.

Code example (JavaScript)

const D = b*b - 4*a*c;
if (D >= 0) { const t = (-b - Math.sqrt(D)) / (2*a); }

What the symbols mean

SymbolMeaning
aCoefficient a
bCoefficient b
cCoefficient c
DDiscriminant D
x1Root x₁
x2Root x₂

More formulas in this category

Frequently asked questions

What is the formula for Quadratic Formula?
The formula for Quadratic Formula is x = (−b ± √(b² − 4ac)) ÷ 2a. Solves ax² + bx + c = 0 directly from the coefficients a, b and c.

Math Formula Quiz Numbers, Algebra & Functions

Sources

Checked: 2026-11-29