Quadratic Regression Calculator
Paste x,y point pairs to fit the quadratic y = a + bx + cx². The result gives all three coefficients, R², a curve over the data, and a fitted value and residual for each point. Three points with distinct x values determine a parabola exactly; four or more points allow residuals to show how well the quadratic model fits. The vertex is labelled as inside or outside the supplied x range. Copy the full report; the calculation stays in this browser.
x 1 2 3 4 5 6y 3.2 5.1 9.4 15.2 23.5 33.1y = 2.950000 - 0.798214 x + 0.973214 x^2R^2 = 0.999843 n = 6residuals +0.0750 -0.1464 +0.0857 -0.1286 +0.2107 -0.0964vertex x = 0.410092 y = 2.786329 (outside the x range)
- a
- b
- c
- R²
6 points, least squares parabola y = 2.950000 - 0.798214 x + 0.973214 x^2, R² 0.999843, residual standard error 0.186764, fitted over x 1 to 6.
A comma, a space or a tab separates the x from the y, so two columns copied from a spreadsheet paste straight in. Bracketed pairs work too, and so do two labelled rows, the x values over the y values. Up to 5,000 points at a time, and three different x values are the fewest a parabola can be fitted to. Nothing you type leaves this browser.
Residuals
Each row is one of your points, the value the fitted curve gives at that x, and the gap between them. The residuals of a least squares fit with a constant term add up to zero, so this column is worth reading for its pattern rather than for its total: a long run of residuals with the same sign is a parabola describing something that is not one.
| x | y | Fitted | Residual |
|---|---|---|---|
| 1 | 3.2 | 3.125 | +0.075 |
| 2 | 5.1 | 5.246429 | -0.146429 |
| 3 | 9.4 | 9.314286 | +0.085714 |
| 4 | 15.2 | 15.328571 | -0.128571 |
| 5 | 23.5 | 23.289286 | +0.210714 |
| 6 | 33.1 | 33.196429 | -0.096429 |
Three cases, worked
Every line below is computed by the code that answers the calculator above, so an example and the tool cannot disagree.
Common questions
- How do I enter my data?
- One point per row, with a comma, a space or a tab between the x and the y, so two columns copied out of a spreadsheet paste in as they are. Bracketed pairs such as (0,1) (1,4) (2,9) work on a single row, and so does the shape the tool itself prints: a row of x values labelled x, with a row of y values labelled y underneath it. Up to 5,000 points and 200,000 characters at a time. A row that does not hold exactly two numbers is named by its row number rather than dropped quietly, and because the comma separates x from y, a thousands comma inside a number is reported instead of being read as two values.
- What do a, b and c mean on this page?
- They are the three coefficients of y = a + bx + cx², in that order: a is the constant, the height of the curve at x = 0, b is the linear term, and c is the quadratic term, which is what makes the fit a curve rather than a line. The sign of c is the direction the parabola opens: positive opens upward, negative opens downward. On the six points the page opens with, the fit is y = 2.950000 - 0.798214 x + 0.973214 x², so c is positive and the curve opens upward.
- Why do three points always give R² of 1?
- Because three coefficients fitted to three points is not a fit at all, it is a solve. Any three points with three different x values lie exactly on one parabola, the residuals are zero and R² is 1 whatever the three points are, so that figure is arithmetic rather than evidence. Enter x 0, 1, 2 with y 1, 4, 9 and you get a = 1, b = 2, c = 1 with R² 1, which is correct and tells you nothing about whether a parabola suits your data. The tool prints a line saying so: a fourth row is the first one that can disagree with the curve.
- Why does it refuse when my x values repeat?
- A parabola has three coefficients, so pinning one down needs at least three different x values. Repeated x values are fine, and common in measured data, as long as three distinct ones remain: six rows at x of 1, 1, 2, 2, 3, 3 fit without complaint. Two distinct x values do not, because an endless family of parabolas passes through two columns of points equally well, which is what rank deficient means, and the tool names that rather than returning one of them. Every x identical is refused too, and the message names the shared value.
- What does R² tell me about a curve fit, and what does it not?
- Read the residual column alongside R². Curved runs of positive and negative residuals can reveal a shape the fitted parabola misses even when R² is close to 1. The worked x-cubed example above shows this pattern; a high value alone does not establish that the model suits the data or predicts outside the measured range.
- Why does another quadratic regression calculator give me different coefficients?
- Check that both tools fit y = a + bx + cx² and report coefficients in the same order. If the data match, large or tightly spaced x values can expose numerical differences. The centred-and-scaled example above compares the raw normal equations with this page's Householder QR fit.
- Where is the vertex, and can I use it?
- The vertex line appears in the result preview and in the copied report, computed in the same centred frame as the fit rather than as -b divided by 2c on the raw coefficients, and the line says whether it falls inside the x values you supplied. On the six points the page opens with it sits at x = 0.410092, y = 2.786329, which is outside the range 1 to 6, and that is exactly the case to be careful with: the curve is a description of the points you measured, so a minimum the data never reached is an extrapolation, not a finding. When the fit has no curvature left to speak of, the tool reports a straight line and no vertex instead of a turning point quadrillions away.
- What is the residual standard error underneath the readout?
- It is the square root of the sum of the squared residuals divided by n minus 3, so it is roughly the typical size of a residual, in the units of y. Three coefficients use up three rows, which is why the divisor is n minus 3 rather than n minus 2 as it is for a straight line. On the six points the page opens with it is 0.186764. It needs a row to spare, so it is shown from four points upwards and left out at three, where the curve passes exactly through every point and nothing is left over.
- Is there a limit on how many points I can fit?
- Five thousand points in one go, and 200,000 characters in one paste. Those are readability limits rather than compute limits: the residual table draws the first 100 rows and says how many it did not draw, the scatter thins itself past 1,000 points and says how many it left out, and the Copy button carries every row regardless. There is no account, no sign-up and nothing gated behind one.
- Does my data leave the browser?
- No. The fit, the residuals, the vertex, the plot and the copied report are all produced on this page, and nothing is uploaded or sent to analytics. The only copy kept anywhere is the draft this browser remembers, so your points are still in the box when you come back. You can clear this site's saved data in your browser settings to forget it.
- How do I calculate quadratic regression in Excel?
- For numeric x values in A2:A6 and y values in B2:B6, current Excel versions can use =LINEST(B2:B6,A2:A6^{1,2},TRUE,FALSE). The two predictor columns are x and x². LINEST returns their coefficients in reverse column order followed by the constant: c, b, a for the equation y = a + bx + cx² used here. At least three distinct x values are needed. The formula fits the same model; displayed digits can differ because the numerical methods differ.
- Is the vertex the same as a vertex-form equation?
- The report gives the vertex coordinates when the fitted curve has meaningful curvature. For vertex (h,k), its equivalent form is y = c(x - h)² + k, with c from the coefficient readout. The page displays the coefficients and vertex separately; it does not print a completed vertex-form expression or solve for the curve's roots.
Least squares by QR decomposition on centred and scaled x rather than by inverting the normal equations, which is what keeps the coefficients stable when the x values are large or bunched together. Every residual is listed beside its point. R² describes how well this curve fits these points and says nothing about points outside their range.