Find the best-fit straight line (slope and intercept) through a set of x,y data points.
How It Works
How Linear Regression Calculator Works
Using the least-squares method, the line is positioned so that the sum of the squared vertical distances between each data point and the line is as small as possible — this is the standard way to fit a straight line through scattered data.
FAQ
Frequently Asked Questions
What do the slope and intercept actually tell me?
The slope is how much y changes for every one-unit increase in x, and the intercept is the predicted value of y when x is zero — together they let you estimate y for any x value along the fitted line.
How do I know if the line is actually a good fit?
The correlation coefficient calculator on this site gives you r, and squaring it gives R² — the proportion of variation in y explained by the line — which is the standard way to judge fit quality.