Quadratic Regression Calculator: Fit y = ax² + bx + c Free

This free quadratic regression calculator fits the parabola y = ax² + bx + c to your data and returns the equation, R² and adjusted R², the vertex, the x-intercepts, a chart and predictions. Enter your X and Y values below.

ŷ = ax2 + bx + c
a (x² term)—
b (x term)—
c (constant)—
R²—
Adjusted R²—
Vertex—
x-intercepts—
RMSE—
Show fitted values and residuals
xyŷ (fitted)residual
Example data loaded. Press Run regression.

What is a quadratic regression calculator?

A quadratic regression calculator finds the parabola \( y = ax^2 + bx + c \) that best fits your data by least squares. Use it when a scatter plot rises and then falls (or falls and then rises): the height of a thrown ball, profit as price increases, crop yield against fertiliser, or the U-shaped error curve you meet when tuning a model. A straight line cannot bend, so it misses exactly the turning point you usually care about.

Enter your X and Y values above and press Run regression. The calculator returns the equation, the three coefficients, R² and adjusted R², the vertex (the maximum or minimum), the x-intercepts, the RMSE, a chart, a residual table and a prediction box. It all runs in your browser.

quadratic regression calculator scatter plot with the fitted parabola through the data points

The quadratic regression formula

Quadratic regression is still a linear model: it is linear in the unknown coefficients a, b and c, even though the curve is bent. That means the same least-squares idea behind the linear regression calculator applies. Minimising the sum of squared errors \( \sum (y_i – ax_i^2 – bx_i – c)^2 \) leads to three normal equations:

\[ \begin{bmatrix} \sum x^4 & \sum x^3 & \sum x^2 \\ \sum x^3 & \sum x^2 & \sum x \\ \sum x^2 & \sum x & n \end{bmatrix} \begin{bmatrix} a \\ b \\ c \end{bmatrix} = \begin{bmatrix} \sum x^2 y \\ \sum x y \\ \sum y \end{bmatrix} \]

The quadratic regression calculator solves this 3×3 system with Gaussian elimination, the same technique as our system of linear equations calculator. In matrix form the answer is \( \beta = (X^T X)^{-1} X^T y \), which you can reproduce step by step with the matrix inverse calculator. To keep the arithmetic accurate with large x values, the calculator centres x on its mean before solving and converts the coefficients back afterwards.

How to use the quadratic regression calculator

  1. Enter X values, separated by commas, spaces or new lines. You need at least three different x values.
  2. Enter Y values in the same order.
  3. Press Run regression and read the equation and R².
  4. Read the vertex. If a is negative, the vertex is the maximum; if a is positive, it is the minimum.
  5. Check the residuals in the table. Random scatter around zero means the parabola fits; a wave pattern means you need a different shape.

Worked example: the path of a thrown ball

The example data records a ball’s height (metres) every half second. The quadratic regression calculator gives \( \hat y = -4.90x^2 + 19.63x + 2.05 \), with R² of 0.999. The coefficient on \( x^2 \) is close to \( -g/2 \approx -4.9 \), half the acceleration due to gravity, so the fit recovers real physics from noisy measurements. The vertex at \( x \approx 2.0 \) s gives the maximum height of about 21.7 m, and the positive x-intercept, near 4.1 s, is when the ball lands.

The vertex comes from setting the derivative to zero: \( \frac{dy}{dx} = 2ax + b = 0 \Rightarrow x = -\frac{b}{2a} \). You can check derivatives like this with our derivative calculator.

R², adjusted R² and RMSE

R² is the share of the variation in y that the parabola explains. Adding the \( x^2 \) term can never lower R² compared with a straight line, so a higher number alone does not prove the curve is better. Adjusted R² charges a penalty for the extra coefficient; if it barely improves over a linear fit, keep the simpler model. RMSE is the typical size of an error in the units of y; see root mean squared error and mean squared error for how these losses are used to train models.

Quadratic vs linear vs exponential regression

Shape of your scatter plotModelCalculator
Rises then falls, or falls then rises\( y = ax^2 + bx + c \)Quadratic regression calculator (this page)
Constant amount of change\( y = a + bx \)Linear regression calculator
Grows by a constant percentage\( y = a e^{bx} \)Exponential regression calculator
Rises fast, then levels off\( y = a + b \ln x \)Logarithmic regression calculator

Quadratic regression in machine learning

Adding \( x^2 \) as a new column and fitting an ordinary linear regression is called polynomial regression, and creating such columns is a classic feature engineering move (scikit-learn calls it PolynomialFeatures). Degree 2 is often the sweet spot. Push the degree much higher and the curve starts chasing noise, the textbook case of overfitting. The standard defences are to choose the degree with cross-validation and to shrink the coefficients with L1 or L2 regularisation. Read more about the method in polynomial regression on Wikipedia.

Frequently asked questions

What is the quadratic regression equation? It is \( y = ax^2 + bx + c \). The quadratic regression calculator estimates a, b and c by least squares.

How many points do I need? At least three points with different x values; with exactly three, the parabola passes through all of them and R² = 1. Use more points for a meaningful fit.

How do I find the maximum or minimum? The vertex is at \( x = -b/(2a) \). A negative a gives a maximum; a positive a gives a minimum. The calculator shows it directly.

Is quadratic regression linear regression? Yes, in the statistical sense: the model is linear in its coefficients, so it is solved with the same least-squares normal equations.

When should I not use a quadratic model? When the data grows faster and faster without turning (use exponential), or when it flattens without coming back down (use logarithmic).

Scroll to Top