Cubic equation solver
Enter the four coefficients to get all three roots. Useful for high school and university students and for engineers checking work.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter coefficient a, coefficient b, coefficient c and coefficient d.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
Substitute x = t - b/3a to get the depressed cubic t³ + pt + q = 0, then use Cardano's formula for one real root or the trigonometric form for three real roots. Discriminant Δ = 18abcd - 4b³d + b²c² - 4ac³ - 27a²d².
Example
Inputs: Coefficient a = 1, Coefficient b = -6, Coefficient c = 11, Coefficient d = -6. Result: Roots: x1 = 3, x2 = 2, x3 = 1; Root type: Three distinct real roots; Discriminant Δ: 4.
Limits and caveats
- Roots are rounded to 10 significant digits; roots that are extremely close may show as a repeated root.
- a must be non-zero.
Questions about this tool
Does every cubic have a real root?
Yes. A cubic curve always crosses the x axis at least once.
What does the discriminant sign tell me?
Positive means three distinct real roots, zero means a repeated root, negative means one real and two complex roots.
How do I enter x³ = 8?
Rewrite it as x³ - 8 = 0: a = 1, b = 0, c = 0, d = -8. The real root is 2.
