Audited 25 May 2026·Last updated 28 Oct 2026·5 citations·Tier 1·0 uses

Discriminant Calculator

Find b² − 4ac for any quadratic ax² + bx + c and see whether it has two real roots, one repeated root or a pair of complex roots, before solving it.

Discriminant Calculator

Leading coefficient; must be non-zero
Linear coefficient
Constant term
Discriminant
1
The value of b² − 4ac, a pure number in the same terms as your coefficients; its sign decides what kind of roots the quadratic has.
Root Nature
0

Background.

Before you solve a quadratic, it helps to know what kind of answer is waiting. Will the parabola cross the x-axis twice, graze it once, or miss it altogether? The discriminant, b² − 4ac, settles that from the three coefficients alone, with no square roots and no factoring.

It is the part of the quadratic formula that sits under the radical: x = (−b ± √(b² − 4ac)) ÷ 2a. A positive value has a real square root, so the ± produces two different real roots. Zero makes the square root vanish and both branches land on the same number, −b ÷ 2a. A negative value has no real square root, and the two roots become complex numbers, conjugates of each other. For x² − 7x + 10 = 0 the discriminant is 49 − 40 = 9, positive, so two real roots; they turn out to be 2 and 5.

The number carries more than its sign. Its square root, divided by |a|, is the distance between the two real roots. With whole-number coefficients, a perfect-square discriminant such as 9 means the roots are rational and the quadratic factors neatly over the integers, while a positive non-square such as 8 means the roots involve a surd. Divided by −4a, it gives the height of the parabola's vertex above or below the axis.

That is why it turns up in so many problems that never ask for the roots themselves: whether a thrown ball reaches a given height, what value of a parameter gives equal roots, whether a damped spring oscillates or settles. Enter a, b and c; you get the discriminant and a code for the kind of roots it implies. To find the roots, take the same coefficients to the quadratic formula calculator.

What is discriminant calculator?

For a quadratic equation ax² + bx + c = 0 with a ≠ 0, the discriminant is D = b² − 4ac. Its sign sorts the roots into three cases. D > 0: two distinct real roots. D = 0: one real root of multiplicity two, often called a repeated or double root, where the quadratic is a perfect square a(x − r)². D < 0: no real roots, but two complex conjugate roots of the form p ± qi.

The name says what it does: it discriminates between those three behaviours. The same idea extends to every polynomial. A polynomial's discriminant is an expression in its coefficients that equals zero exactly when the polynomial has a repeated root, and the quadratic's is the only one short enough to memorise. For the cubic ax³ + bx² + cx + d it is already b²c² − 4ac³ − 4b³d − 27a²d² + 18abcd.

The discriminant ignores the scale of the equation in one useful way. Multiply every coefficient by the same non-zero number k and D is multiplied by k², which can never change its sign, so 2x² − 14x + 20 = 0 has the same kind of roots as x² − 7x + 10 = 0.

How to use this calculator.

  1. Rearrange the equation so one side is zero and the terms run ax² + bx + c. For 3x² = 5x − 2, that means 3x² − 5x + 2 = 0, so a = 3, b = −5 and c = 2.
  2. Enter a, b and c, including their signs; a missing term has a coefficient of 0, and a bare x² has a = 1. Coefficient a cannot be zero, because then the equation is linear and has no discriminant.
  3. Read the discriminant, then the root-nature code beside it: 0 for two distinct real roots, 1 for one repeated real root, 2 for a pair of complex conjugate roots.
  4. If the coefficients are whole numbers and D is a perfect square, expect rational roots and try factoring; otherwise go straight to the quadratic formula, which needs √D.

The formula.

D = b² − 4ac

The formula comes from completing the square. Divide ax² + bx + c = 0 by a, move c/a across, and add (b/2a)² to both sides: (x + b/2a)² = (b² − 4ac) ÷ 4a². The left side is a square, so it can be zero or positive but never negative for real x. The right side has denominator 4a², which is always positive, so the sign of the whole right side is the sign of b² − 4ac. If it is positive, x + b/2a can be either of two square roots and there are two real solutions; if it is zero, only x = −b/2a works; if it is negative, no real x does.

The same rearrangement shows what the size of D means. The two roots are −b/2a ± √D/2a, so they sit symmetrically either side of x = −b/2a, at a distance √D/2|a| each way, and their difference is √D/|a|. Writing the quadratic in vertex form, a(x + b/2a)² − D/4a, shows that the vertex height is k = −D/4a. For an upward-opening parabola (a > 0), a positive D puts the vertex below the axis, so the curve must cross it twice.

A third route explains why D detects repeated roots in particular. A repeated root of f(x) = ax² + bx + c is also a root of its derivative, f′(x) = 2ax + b, which is zero only at x = −b/2a. Substituting that value gives f(−b/2a) = −D/4a, which is zero exactly when D is. The resultant of f and f′, the general algebraic test for a shared root, works out to −a(b² − 4ac).

When b is even, a shortcut saves arithmetic: writing b = 2h, D/4 = h² − ac. For x² − 6x + 5, h = −3 and h² − ac = 9 − 5 = 4, so D = 16.

Two points about the output. Decimal coefficients are handled as typed, so 0.1x² + 0.3x + 0.225 gives a discriminant of exactly 0 rather than a tiny binary-arithmetic leftover. And any discriminant whose size is below 10⁻⁹ is classified as a repeated root: x² + 1 × 10⁻¹⁰ has D = −4 × 10⁻¹⁰, strictly negative, yet is coded 1. For coefficients that small, rescale the equation first.

A worked example.

Example

Take x² − 7x + 10 = 0, so a = 1, b = −7 and c = 10. Squaring b gives (−7)² = 49; the product 4ac is 4 × 1 × 10 = 40; and the discriminant is 49 − 40 = 9. Because 9 is greater than zero, the root-nature code is 0: two distinct real roots. The value says more. Nine is a perfect square and the coefficients are whole numbers, so the roots are rational and the quadratic should factor, and it does: (x − 2)(x − 5). The quadratic formula agrees, x = (7 ± √9) ÷ 2 = (7 ± 3) ÷ 2, giving 5 and 2. The gap between them is √9 ÷ 1 = 3, as the root-spacing rule predicts, and they sit either side of x = 7 ÷ 2 = 3.5, where the vertex is. The vertex height is −D/4a = −9 ÷ 4 = −2.25; checking directly, 3.5² − 7 × 3.5 + 10 = 12.25 − 24.5 + 10 = −2.25. So the parabola dips 2.25 units below the axis and comes back up. Raise c by 2.25 to 12.25 and the vertex rises exactly to the axis, the discriminant becomes 49 − 49 = 0, and the two roots merge at 3.5; any larger c lifts the whole curve clear of the axis.

a1
b-7
c10

Frequently asked questions.

Why is the root nature shown as 0, 1 or 2 instead of words?
It is a numeric code for the three cases. 0 means the discriminant is positive and there are two distinct real roots; 1 means it is zero, or within 10⁻⁹ of zero, and there is one repeated real root; 2 means it is negative and the roots are a complex conjugate pair. The code carries no other meaning, so 2 is not "more" than 0.
Can I get the actual roots from the discriminant?
Almost: you also need −b/2a, the midpoint of the roots. The roots are −b/2a ± √D/2a, so once D is known, finding them is one square root and two additions. For x² − 7x + 10 the midpoint is 3.5 and √9/2 = 1.5, giving 2 and 5. The quadratic formula calculator does this directly.
If the discriminant is negative, does the equation have no solution?
It has no real solution, but it does have two complex ones: −b/2a ± i√(−D)/2a, where i² = −1. For x² − 7x + 13 = 0, D = 49 − 52 = −3, so the roots are 3.5 ± 0.866i. Graphically, the parabola never touches the x-axis, so a question that needs a real crossing has no answer.
How do I find the value of k that gives equal roots?
Write the discriminant in terms of k and set it to zero. For x² + kx + 9 = 0, D = k² − 4 × 1 × 9 = k² − 36, which is zero when k = 6 or k = −6. Setting D > 0 or D < 0 instead gives the values of k for two real roots or for complex roots.
How does the discriminant relate to the vertex of the parabola?
The vertex height is k = −D/4a. For an upward-opening parabola, a positive D means the vertex is below the x-axis, zero means it sits on the axis, and negative means it is above. For x² − 7x + 10, −9/4 puts the vertex 2.25 below the axis at x = 3.5. For a downward-opening parabola the picture flips, but the root conclusions do not.
Why can't the leading coefficient a be zero?
With a = 0 the x² term disappears and the equation becomes bx + c = 0, a straight line with the single solution x = −c/b, provided b is not zero. There is no second root to classify, and the formula's −b/2a would mean dividing by zero, so a must be non-zero for the discriminant to apply.
Does multiplying the whole equation by a number change the discriminant?
It changes the value but never the verdict. Multiplying a, b and c by k multiplies D by k², which is positive. Doubling x² − 7x + 10 = 0 to 2x² − 14x + 20 = 0 turns D = 9 into 196 − 160 = 36, four times as large, with the same two roots, 2 and 5.
How does the discriminant help with a quadratic inequality?
It tells you how many places the expression can change sign. For x² − 5x + 6 > 0, D = 25 − 24 = 1, so there are two crossing points, x = 2 and x = 3. The parabola opens upward, so the expression is positive outside them: x < 2 or x > 3. With D < 0 and a > 0 it is positive everywhere.
Where does the discriminant show up outside algebra class?
Anywhere a quadratic decides whether something can happen. A ball thrown up at 15 m/s from 2 m has height 2 + 15t − 4.905t², taking g as 9.81 m/s². Asking whether it reaches 14 m gives 4.905t² − 15t + 12 = 0, with D = 225 − 235.44 = −10.44, so it never does; its peak is about 13.47 m.
What does the discriminant say about a damped spring or circuit?
For a mass on a spring with damping, m·x″ + c·x′ + k·x = 0, the characteristic equation ms² + cs + k = 0 has discriminant c² − 4mk. Positive means overdamped, with no oscillation; zero means critically damped; negative means underdamped, oscillating as it settles. A 1 kg mass on a 100 N/m spring is critically damped at c = 20 N·s/m.

References& sources.

  1. [1]Stewart, J. (2015). Calculus: Early Transcendentals, 8th ed. Cengage Learning. ISBN 978-1285741550.
  2. [2]NIST Digital Library of Mathematical Functions (2024). "Elementary Algebra." §1.11. https://dlmf.nist.gov/1.11
  3. [3]Strang, G. (2016). Introduction to Linear Algebra, 5th ed. Wellesley-Cambridge Press. ISBN 978-0980232776.
  4. [4]Boyce, W.E. and DiPrima, R.C. (2017). Elementary Differential Equations and Boundary Value Problems, 11th ed. Wiley. ISBN 978-1119382874.
  5. [5]Dummit, D.S. and Foote, R.M. (2004). Abstract Algebra, 3rd ed. Wiley. ISBN 978-0471433347.

How this page was produced

Published by
Quanta Calculator
Primary sources
5 cited below
Method
D = b² − 4ac
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon