Quadratic equation solver

The discriminant decides everything: positive gives two real roots, zero gives one, negative gives a complex pair.

First root
3
= Exact Quadratic equation
Second root
2
Discriminant
1 Two distinct real roots
Vertex x, and the real part of complex roots
2.5
Imaginary part of the complex roots
0.5
Vertex y
-0.25
Sum of the roots
5
Product of the roots
6
Show the working
  1. a = 1
  2. b = -5
  3. c = 6
  4. Discriminant = -5^2 - 4*1*6 = 1
  5. has_real = 1 >= 0 ? 1 : 0 = 1
  6. root_disc = sqrt(abs(1)) = 1
  7. First root = 1 != 0 && 1 >= 0 ? (--5 + 1) / (2*1) : 0 = 3
  8. Second root = 1 != 0 && 1 >= 0 ? (--5 - 1) / (2*1) : 0 = 2
  9. Vertex x, and the real part of complex roots = 1 != 0 ? --5 / (2*1) : 0 = 2.5
  10. Imaginary part of the complex roots = 1 != 0 ? 1 / (2*1) : 0 = 0.5
  11. Vertex y = 1 != 0 ? 6 - -5^2/(4*1) : 0 = -0.25
  12. Sum of the roots = 1 != 0 ? --5/1 : 0 = 5
  13. Product of the roots = 1 != 0 ? 6/1 : 0 = 6

Values are shown to six significant figures here; the arithmetic itself runs on exact fractions and is only rounded where a number is printed.

Scenarios & local history

Compare a saved scenario

Recent calculations

    The formula

    • x = (-b +/- sqrt(b^2 - 4ac)) / 2a
    • discriminant D = b^2 - 4ac
    • vertex at x = -b/2a, y = c - b^2/4a
    • sum of roots = -b/a, product of roots = c/a

    When the discriminant is a perfect square the roots are exact rationals and appear as such, with no rounding at all.

    When it is negative the two root fields read zero and the complex pair is real part plus or minus imaginary part.

    Related calculators

    Settings

    Theme

    System follows your operating system and changes with it.

    Text size
    High contrast

    Maximises text and border contrast and removes the grid background.

    Graph-paper background

    Round to
    Notation
    Thousands separators
    Decimal mark
    Nearest fraction

    Shows the result as the nearest tape-measure fraction, with the error it costs.


    Accessibility & interaction
    Reduce motion Stops interface animations even when the operating system does not.
    Underline links Keeps links visually distinct without relying on colour.
    Larger touch targets Makes buttons and form controls easier to tap.
    Shorter reading lines Limits article width for easier scanning.
    Monochrome display Removes colour as an information cue.
    Always-visible focus Makes the keyboard focus ring persistent and stronger.
    Verbose screen-reader results Announces the complete conversion equation.
    Sticky action bars Keeps converter and calculator actions within reach.
    Select values on focus Replaces a value immediately when you start typing.
    Left-handed mobile layout Moves key mobile actions toward the left thumb.

    Your data

    Settings, recent conversions and favourites live in this browser only. Nothing is sent anywhere.

    Offline library