Skip to content
CalcTide logo
Education & Math

Quadratic Formula Calculator

For x^2 - 3x + 2 = 0, the roots are x = 2 and x = 1. This quadratic formula calculator solves any equation in the form ax^2 + bx + c = 0. Enter the three coefficients a, b, and c to get both roots, the discriminant, and whether the answers are real or complex. The value of a must be nonzero, otherwise the equation is linear rather than quadratic.

Education & MathBy

Quick answer

A quadratic equation has the form ax^2 + bx + c = 0, where a is not zero.

What this tells you

  • A quadratic equation has the form ax^2 + bx + c = 0, where a is not zero.
  • The quadratic formula finds both roots using the coefficients a, b, and c.
  • The discriminant b^2 - 4ac tells you whether the roots are real or complex.
  • Numeric roots are rounded to 4 decimal places, and complex roots are shown as a + bi.

How to Use

  1. 1Enter the coefficient a, the number in front of x squared, and keep it nonzero.
  2. 2Enter the coefficient b, the number in front of x.
  3. 3Enter the constant term c.
  4. 4Click Calculate to see both roots, the discriminant, and the nature of the solutions.

How It Works

Formula

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

The quadratic formula gives both roots of ax^2 + bx + c = 0. The part under the square root, b^2 - 4ac, is the discriminant. When it is positive there are two real roots, when it is zero there is one repeated real root, and when it is negative the two roots are complex conjugates.

Calculation note: values are processed in the order shown above, using the current input units.

Worked Examples

Two distinct real roots

A1
B-3
C2
Resultx = 2 and x = 1

The discriminant is (-3)^2 - 4(1)(2) = 1, which is positive, so there are two real roots. The formula gives (3 + 1) / 2 = 2 and (3 - 1) / 2 = 1.

One repeated root

A1
B-2
C1
Resultx = 1 (repeated)

The discriminant is (-2)^2 - 4(1)(1) = 0, so the square root term vanishes and both roots collapse to -(-2) / 2 = 1.

Complex roots

A1
B0
C1
Resultx = 0 + 1i and x = 0 - 1i

The discriminant is 0 - 4(1)(1) = -4, which is negative, so the roots are complex. The real part is 0 and the imaginary part is sqrt(4) / 2 = 1, giving 0 + 1i and 0 - 1i.

Discriminant and the Nature of the Roots

How the sign of b^2 - 4ac decides what kind of roots you get.

DiscriminantRoots
Greater than 0Two distinct real roots
Equal to 0One repeated real root
Less than 0Two complex conjugate roots

Reading the roots and discriminant

Put the equation in standard form before choosing coefficients. Terms may need to move across the equals sign, which changes their signs. Combine like terms first. In 2x squared + 5 = 3x, standard form is 2x squared - 3x + 5 = 0, so a is 2, b is -3, and c is 5.

A positive discriminant produces two distinct real numbers. A zero discriminant produces the same real root twice, which is also called a repeated or double root. A negative discriminant produces two complex conjugates. Their real parts match and their imaginary parts have opposite signs, so coefficients from a real quadratic still come in a paired pattern.

The roots are x-intercepts only when they are real and the equation is viewed as the graph y = ax squared + bx + c. Two real roots mean two x-intercepts. A repeated root touches the axis once at the vertex. Complex roots solve the algebraic equation but do not appear as x-intercepts on a standard real coordinate graph.

The calculator rounds the discriminant and numeric root components to four decimal places. A displayed value such as 1.4142 is an approximation to an irrational number, not its exact form. Substitute a rounded root back into the equation and the result may be close to zero rather than exactly zero. Keep more precision or use symbolic algebra when an assignment requires radicals or exact fractions.

Very large coefficients or a discriminant close to zero can expose floating-point limits. The implementation compares the computed discriminant directly with zero. A value that is theoretically zero may be represented as a tiny positive or negative number after decimal input arithmetic, which can change the reported branch. Scaling coefficients or using an exact symbolic method can help with sensitive cases.

The usual formula can also lose numerical accuracy for one root when b squared is much larger than 4ac because subtracting nearly equal values discards significant digits. This calculator applies the familiar textbook formula, not a specialized stable numerical algorithm. Use higher-precision software for scientific or engineering calculations where small root errors matter.

Convert a quadratic to vertex form

Common mistakes

  • Getting the sign of b wrong. The formula uses -b, so a negative b becomes positive, and for x^2 - 3x + 2 the -b term is +3, not -3.
  • Dividing only part of the expression by 2a. The whole numerator -b +/- sqrt(b^2 - 4ac) is divided by 2a, not just the square root term.
  • Ignoring complex roots when the discriminant is negative. A negative discriminant still has two roots, but they are complex numbers of the form a + bi rather than real numbers.
  • Reading a rounded decimal as an exact radical or fraction.
  • Entering an equation before moving every term to one side so the other side equals zero.
  • Dropping a zero coefficient, such as forgetting that x squared plus 2 equals zero has b = 0.

Embed this calculator on your site

Drop this single line where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use with attribution.

<script src="https://calctide.com/embed.js" data-tool="quadratic-formula-calculator" async></script>

Preview the embed at /embed/quadratic-formula-calculator/.

Frequently Asked Questions

The quadratic formula is x = (-b +/- sqrt(b^2 - 4ac)) / 2a, and it solves any equation written as ax^2 + bx + c = 0. You plug in the three coefficients a, b, and c, then evaluate the two values created by the plus and minus signs.
Write the equation as ax^2 + bx + c = 0, then substitute a, b, and c into the quadratic formula. For x^2 - 3x + 2 = 0 the coefficients are a = 1, b = -3, and c = 2, which gives the roots x = 2 and x = 1.
The discriminant is the part of the quadratic formula under the square root, b^2 - 4ac. It tells you the nature of the roots, since a positive value gives two real roots, zero gives one repeated root, and a negative value gives two complex roots.
A negative discriminant means the equation has two complex roots instead of real ones. The roots are complex conjugates of the form a + bi, where the real part is -b / 2a and the imaginary part is sqrt(-discriminant) / 2a.
No, the coefficient a cannot be zero, because that removes the x squared term and leaves the linear equation bx + c = 0. A quadratic equation requires a nonzero a, so this calculator returns no result when a is zero.
The roots of x^2 - 5x + 6 = 0 are x = 3 and x = 2. The discriminant is (-5)^2 - 4(1)(6) = 1, so the formula gives (5 + 1) / 2 = 3 and (5 - 1) / 2 = 2.
The calculator rounds roots to four decimal places and does not simplify radicals or fractions. An answer key may show an exact form such as square root of 2 while this tool shows 1.4142.
Real roots are the x-values where the graph crosses or touches the x-axis. Complex roots solve the equation but do not appear as intercepts on a real x-y graph.
Enter zero for that coefficient. For x squared + 4 = 0, use a = 1, b = 0, and c = 4. Only a cannot be zero in this calculator.
Yes. The fields accept finite decimals. Results near a repeated root may be sensitive to floating-point rounding, so use exact symbolic work when the distinction matters.
No. If a is zero, the x-squared term disappears and the equation is linear. This implementation returns no result for that input.
It estimates quadratic formula calculator outputs using the visible inputs and formula assumptions on this page.

Explore More in Education & Math