Home › Linear Regression Calculator
Linear Regression Calculator
Find the least-squares regression line (y = a + bx) for your paired data, with the slope, intercept, correlation and R².
One pair per line, x and y separated by a comma or space. Paste two columns from a spreadsheet.
Show step-by-step solution
Enter at least two (x, y) pairs, one per line.
Formulas used
| Slope (b) | b = Σ(x−x̄)(y−ŷ) / Σ(x−x̄)² |
|---|---|
| Intercept (a) | a = ŷ − b·x̄ |
| Line | ŷ = a + bx |
Frequently asked questions
What is linear regression?
It finds the straight line that best fits a set of (x, y) points by minimising the squared vertical distances to the line.
What do the slope and intercept mean?
The slope is how much y changes for each one-unit increase in x; the intercept is the predicted y when x = 0.
What is R² in regression?
R² is the proportion of the variation in y explained by the line. Closer to 1 means a better fit.
How many data points do I need?
At least two pairs are required, but more points give a more reliable line.