Quadratic Formula Calculator

Solve ax² + bx + c = 0 instantly — real and complex roots, full working, parabola diagram.

Free quadratic formula calculator. Enter a, b, c and get both roots (real or complex), the discriminant, step-by-step working and a live parabola SVG diagram — all computed locally in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is the quadratic formula?

The quadratic formula solves any equation of the form ax-squared + bx + c = 0. The roots are x = (-b plus-or-minus sqrt(b-squared minus 4ac)) divided by (2a). The expression b-squared minus 4ac is called the discriminant and controls how many real solutions exist.

The quadratic formula is one of the most fundamental results in algebra. Given any equation of the form ax² + bx + c = 0 (where a is non-zero), it produces the roots — the values of x that make the equation true — without requiring factorisation or completing the square. This calculator solves the equation the moment you finish typing, shows the discriminant, walks through every arithmetic step and draws a live parabola so you can see exactly where the roots sit on the curve.

How it works

The calculator evaluates the quadratic formula directly:

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

The term inside the square root, D = b² − 4ac, is the discriminant, and its sign determines the character of the roots:

  • D > 0 — two distinct real roots, placed symmetrically about the axis of symmetry x = -b/(2a).
  • D = 0 — one repeated real root at x = -b/(2a); the parabola just touches the x-axis.
  • D < 0 — two complex conjugate roots of the form p ± qi, where p = -b/(2a) and q = sqrt(-D)/(2a); the parabola does not cross the x-axis at all.

The parabola diagram is drawn from scratch in SVG using the vertex form y = a(x − h)² + k, where h = -b/(2a) and k = c − b²/(4a). It adapts its x-range automatically so the vertex and roots (when real) are always visible.

Worked example

Solve x² − 3x + 2 = 0 (a = 1, b = -3, c = 2).

  1. Compute the discriminant: D = (-3)² − 4·1·2 = 9 − 8 = 1
  2. Since D > 0, there are two distinct real roots.
  3. x = (−(−3) ± √1) / (2·1) = (3 ± 1) / 2
  4. x₁ = (3 + 1) / 2 = 2, x₂ = (3 − 1) / 2 = 1

Verification using Vieta’s formulas: sum = 2 + 1 = 3 = −b/a = 3/1 ✓ and product = 2 × 1 = 2 = c/a = 2/1 ✓.

The parabola y = x² − 3x + 2 opens upward, crosses the x-axis at x = 1 and x = 2, with its vertex at (1.5, −0.25).

Formula note

The quadratic formula is derived by completing the square:

  1. Divide through by a to get x² + (b/a)x + (c/a) = 0
  2. Move the constant: x² + (b/a)x = −c/a
  3. Add (b/(2a))² to both sides: (x + b/(2a))² = (b² − 4ac) / (4a²)
  4. Take the square root and rearrange to reach the standard form.

This derivation explains why the axis of symmetry is always at x = −b/(2a) and why the discriminant b² − 4ac controls the nature of the roots — it is the value under the square root, and its sign determines whether that square root is real or imaginary.

Every calculation runs entirely in your browser. Nothing is sent to a server.