Linear regression calculator
Paste your data pairs to get the line of best fit, r, R², and a plot.
Least squares regression
The line of best fit is the straight line that makes the squared vertical distances to your points as small as possible. Its slope tells you how much y changes for each one-unit increase in x. The intercept is the predicted y when x is zero.
Correlation r and R²
The correlation coefficient r runs from −1 to 1. Values near 1 or −1 mean the points hug a line, and values near 0 mean there is little straight-line pattern. R² is r squared and shows the share of the variation in y that the line explains.
Predicting values
Enter an x value to get the predicted y. Predictions inside the range of your data (interpolation) are more reliable than ones outside it (extrapolation), where the pattern may not continue.
Things to watch for
A high R² does not prove that x causes y. Outliers can pull the line a long way, and a curved pattern will fit a straight line poorly even if r looks decent. Always look at the plot.