Correlation Coefficient Calculator
Pearson correlation coefficient and r squared.
Fit a least squares line and predict from it.
Optional. Uses the fitted line, which is extrapolation outside your data.
The two lists must be the same length.
| X | Y | Fitted Y | Residual |
|---|
| Statistic | Value |
|---|
Linear Regression Calculator fits a least squares line to paired data and reports the slope, the intercept and how well the line fits. Least squares means the line that minimises the sum of the squared vertical distances from the points, which is the standard definition of a line of best fit.
The slope is the interesting coefficient: it is the change in Y associated with a one-unit change in X. The intercept is where the line crosses the Y axis, which is meaningful only if X equal to zero is a real possibility for your data -- for a regression of weight on height, it is not.
Residuals are listed point by point because they are where a bad fit shows up. A good fit has residuals scattered randomly around zero; residuals that curve, or fan out as X grows, mean a straight line is the wrong model even when r squared looks respectable. The calculator also flags a prediction made outside the range of the data, which is extrapolation and should be treated with suspicion.
The page shows its working, not just its answer. Where there is a formula it is printed with your own numbers substituted in, so you can check the result rather than take it on trust -- which is the difference between a calculator you can use for something that matters and one you cannot.
Everything runs inside your browser. What you type is never uploaded, never logged and never stored, and the calculator keeps working if your connection drops after the page has loaded.
Looking for something this does not cover? FreeToolsZone.org is more free browser-based tools, organised by job, and it is worth a look if linear regression calculator is only part of what you are working on.
The linear regression calculator is used by writers, developers, students, marketers and anyone else who needs the job done once without installing software. Common cases include:
The share of the variation in Y that the line accounts for. 0.6 means sixty per cent explained and forty per cent not.
The arithmetic will, but the answer is extrapolation and the calculator says so. Relationships that hold over one range often do not hold outside it.
Then a straight line is the wrong model. A curve, a transformation of the variables or a different model entirely is needed, whatever r squared says.
If the linear regression calculator is not quite what you need, these other free tools solve closely related problems, and there are 13 more in statistics calculators.
Pearson correlation coefficient and r squared.
Slope between two points, with angle and line equation.
Sample and population variance with the full working.
Mean, median, mode, range and quartiles of a data set.
Standard deviation, variance, mean, median and quartiles from any list.
Checked and rebuilt on 2026-10-14. The method this calculator uses is described in the section above, and corrections go through the contact page.