Curve Fitting Tool
Fit a line, parabola or cubic to pasted x, y points by least squares, with the equation and R² printed. Runs in your browser.
Least squares on your own points
Paste one x, y pair per line and choose a polynomial degree of one, two or three. The page builds the normal equations for that degree, solves them by Gaussian elimination with partial pivoting, and prints the fitted polynomial with R², the share of the variance in y that the curve explains. The scatter and the fitted curve are drawn together on a canvas.
The fit is ordinary least squares on the numbers as given: no weighting, no outlier rejection, no robust loss. Degrees above three are not offered because a high-degree polynomial through a handful of points interpolates the noise and would be presented as knowledge the data does not contain. Collinear or duplicated x values are refused, since the normal equations then have no unique solution.
Everything is computed in this tab from the pasted text. Nothing is uploaded, the points are not saved, and reloading with the same table prints the same coefficients and the same R².
Fit a polynomial of degree 1, 2 or 3 to pasted x, y pairs by solving the normal equations, then read the equation, R² and the drawn curve.
It is an ordinary least-squares fit of the degree you choose, not a model search: nothing picks the degree for you and nothing is uploaded.
How to use Curve Fitting Tool
Paste one x, y pair per line into One x, y pair per line, separating the two values with a comma, a tab or a space.
Choose the Polynomial degree — 1, 2 or 3 — and press Fit.
Read the equation term by term with R² beside the point count; when Fit refuses, it names whether the points were too few, collinear or repeated at one x.
Using it
Paste one x, y pair per line, separated by commas, tabs or spaces; blank lines are skipped. Choose the degree and press Fit. The equation is printed term by term with the coefficients, and R² is printed beside the point count.
The arithmetic
The coefficients solve the normal equations by Gaussian elimination with partial pivoting. A degree d needs at least d + 1 points, and a set that is collinear or has a repeated x has no unique fit at that degree, so the page refuses instead of printing a singular answer.
Where it stops
Degrees 1, 2 and 3 only, one response column, and no weighting, no error bars and no extrapolation beyond the domain of your points in the drawing. R² is the share of variance in these points, not a prediction of new ones.
What to Expect
Best for
- fitting a trend line or a parabola to a small measured set
- checking the coefficients a spreadsheet reported
What this tool keeps
- The points, the elimination and the drawing stay in this tab; no dataset is uploaded and none is stored.
Frequently asked questions
What method does the fit use?
Ordinary least squares via the normal equations, solved by Gaussian elimination with partial pivoting. The equation and R² are printed so the fit can be checked rather than trusted.
Why does it refuse my points?
A degree d fit needs at least d + 1 points, and a set that is collinear or repeats an x value has no unique solution at that degree. The page names the reason instead of returning coefficients.
Is a higher degree always better?
No. R² cannot fall as the degree rises, so the printed figure alone never justifies the choice. The page fits the degree you pick and does not select one for you.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.