Polynomial Regression Calculator

Intercept (a)—
Coefficient b (of x)—
Coefficient c (of x²)—
R-squared (R²)—

How Polynomial Regression Calculator is calculated: y = a + bx + cx², fitted by least squares through the normal equations

What is a Polynomial Regression Calculator?

The Polynomial Regression Calculator is a free online tool that fits a quadratic curve to a set of paired numbers, so you can model a relationship that bends instead of running straight. Statistics, science and business students use it when their data curves upward or downward and a straight line keeps missing the pattern. Instead of solving the three normal equations by hand, which means working out eight separate sums and then a 3-by-3 system, you type your x values in the first box and your y values in the second, separated by commas, spaces or new lines and the calculator returns the three coefficients a, b and c of the fitted curve y = a + bx + cx², plus R², which says how much of the variation the curve explains straight away.

The working idea is simple. the calculator uses least squares: of all the parabolas you could draw through your points, it picks the one where the squared vertical gaps between the points and the curve add up to the smallest total Those gaps are squared so that positive and negative misses cannot cancel each other out, and the best curve is found by solving the normal equations — a 3-by-3 linear system built from the sums of x, x², x³, x⁴, y, xy and x²y. There is no sign-up and nothing to install: the page runs entirely in your browser, so your numbers never leave your device.

That matters because a straight line is often the wrong shape: plant growth speeds up and then slows, braking distance grows with the square of speed, and a cooling curve bends as it flattens out The fit is a quadratic only — it cannot follow an S-shape or a sharp kink, and like every regression it is an estimate from your sample, not a law of nature. The rest of this page walks through the formula, the input people get wrong most often, and a worked example with real numbers you can check by hand.

How a Polynomial Regression Calculator works

At its core, the calculator applies the fitted curve is y = a + bx + cx², and the coefficients come from the normal equations. In matrix form the system is [[n, Σx, Σx²], [Σx, Σx², Σx³], [Σx², Σx³, Σx⁴]] times [a, b, c] equals [Σy, Σxy, Σx²y], where every sum runs over your data points. R² is then 1 minus the residual sum of squares divided by the total sum of squares. The formula box at the top of this page shows the same rule in symbols: y = a + bx + cx², fitted by least squares through the normal equations.

The calculator first adds up the eight sums, then solves the 3-by-3 system by Gaussian elimination with partial pivoting, which keeps the arithmetic stable even when the x values are large. It then evaluates the fitted curve at every x to work out R². You need at least three pairs of numbers, and the two lists must be the same length; otherwise the calculator shows dashes. If all your x values are identical, the system has no unique solution and the result is a dash too.

The arithmetic is exact least squares for a quadratic, so the only error in the answer is the rounding shown on screen A linear regression calculator can help you check the numbers that feed into this step, and it is worth doing that check before you trust an answer that looks surprising.

The the X values explained

The x values decide everything about the shape of the fit, and the mistake people make is feeding in x values that are not evenly spread. If all your points cluster at one end of the range with a single point far away, that lone point drags the whole curve towards itself, and the coefficients stop describing the bulk of your data. A quadratic is flexible enough to chase one wild point, which is exactly why you should look at the spread of x before you trust the curve.

Check that your x values cover the range you care about, with no big gaps in the middle and no single value sitting far from the rest. If a point looks like a typing error — a 100 where the rest are single digits — fix it before you fit, because the curve will bend to reach it. When the x values are years or dates, convert them to small numbers first, such as 0, 1, 2 for three successive years, so the x⁴ sum does not grow so large that the arithmetic loses precision.

Plot the points roughly on paper, or at least read them down the list: if the y values rise and then fall, a quadratic is a sensible shape, and if they only rise, a straight line may be enough. A standard deviation calculator is a good cross-check when the input comes from a measurement or a table rather than from a textbook problem.

A worked example

Take the default lists on this page. The x values are 0, 1, 2, 3 and 4, and the y values are 1, 2, 5, 10 and 17. Look closely and you can see the pattern: each y is one more than the square of its x, so the points lie exactly on the curve y = 1 + x².

The calculator adds up the sums — n is 5, Σx is 10, Σx² is 30, Σx³ is 100, Σx⁴ is 354, Σy is 35, Σxy is 110 and Σx²y is 384 — solves the normal equations and returns a = 1, b = 0 and c = 1. R² comes out as 1, which is the highest possible value: the curve passes through every point exactly, so there is no leftover error at all.

A perfect R² of 1 is rare in real data and usually means the numbers were made up for practice, as these were. In a real experiment R² of 0.9 or above is already a strong fit, and a value near 0.5 means the curve explains only half the variation and the rest is noise or a different shape altogether. You can verify the answer by hand for one point: at x = 3 the curve gives 1 + 0 × 3 + 1 × 9 = 10, which matches the y value in the list exactly.

Where the Polynomial Regression Calculator is used

In physics labs, polynomial regression fits calibration curves: a sensor's reading rarely grows in a straight line with the quantity it measures, so students fit a quadratic to their calibration points and then read unknown values off the curve.

In business, it models costs that rise faster than output — overtime, wear and tear, and waste all bend the cost curve upward — and a quadratic captures that bend where a straight line would understate the cost of growing fast. A correlation calculator often sits next to it in the same workflow, because the two answers answer different halves of the same question.

In biology, growth curves bend: a plant or a bacterial colony grows slowly, then fast, then levels off, and a quadratic fits the middle stretch well enough to predict the next few days of growth.

Polynomial Regression Calculator vs Linear Regression Calculator

Linear regression fits a straight line, y = a + bx, and polynomial regression fits a curve, y = a + bx + cx². The extra term is the whole difference: with c set to zero the two tools give the same answer, so polynomial regression contains linear regression as a special case.

Use the straight line when your points rise or fall at a steady rate, and switch to the quadratic when the rate itself is changing — when the points bend. A quick way to tell is to fit both and compare R²: if the quadratic's R² is barely higher, the bend is probably noise. The quadratic equation calculator covers the other side of the same problem, so the two tools complement each other rather than compete.

The cost of the extra term is real: a quadratic can chase noise and look better than it is, especially with few points. With only four or five points, prefer the straight line unless the bend is obvious to the eye.

Common mistakes with the Polynomial Regression Calculator

The first mistake is fitting a quadratic to a handful of points and trusting the curve. With three points a parabola can pass through all of them exactly, giving R² = 1 and telling you nothing at all. You need several more points than the three coefficients before the fit means anything.

The second mistake is predicting far outside the measured x range. A parabola that fits well between 0 and 4 can shoot off steeply at x = 10, and the prediction there is a guess dressed up as arithmetic. Keep predictions inside, or close to, the range you actually measured.

The third mistake is reading R² as proof that the curve is right. A high R² only says the curve follows your points closely; it says nothing about whether a quadratic is the true shape, and a curved pattern can still give a high R² to the wrong model. Always look at the residuals — the gaps between points and curve — for a pattern the R² hides.

How to use this Polynomial Regression Calculator

Open the page and enter your x values in the first box and your y values in the second, separated by commas, spaces or new lines. Both lists must have the same number of values, and you need at least three pairs. Paste a column copied from a spreadsheet and it works as it is.

Read a as the value of y when x is zero, b as the initial slope of the curve, and c as the amount of bend: positive c opens upward, negative c opens downward. Read R² as the share of the variation in y that the curve explains — 0.85 means about 85% explained and 15% left as noise.

Everything runs in your browser. No account, no upload, no data sent anywhere — your numbers never leave your device. If a result looks wrong, re-check the inputs first: a single mistyped number is the usual cause, and a linear regression calculator will confirm the arithmetic.

Frequently Asked Questions

The fitted curve is y = 1 + 0x + 1x², which is y = 1 + x², and R² is 1 because every point lies exactly on the curve.

the fitted curve is y = a + bx + cx², and the coefficients come from the normal equations In matrix form the system is [[n, Σx, Σx²], [Σx, Σx², Σx³], [Σx², Σx³, Σx⁴]] times [a, b, c] equals [Σy, Σxy, Σx²y], where every sum runs over your data points. R² is then 1 minus the residual sum of squares divided by the total sum of squares.

At least three pairs, because a quadratic has three coefficients, but three points give a perfect fit that proves nothing. Aim for eight or more points so the curve is tested against data it was not forced through, and check R² together with a look at the residuals.

Only with care. A parabola bends away steeply outside the measured range, so a prediction far beyond your largest x can be wildly wrong even when the fit inside the range is excellent. Keep predictions inside the measured range, or treat distant ones as rough guesses.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.