Daily Figures Edition No Sign-Up No Tracking Free Forever Vol. XII — No. 204
“The figures, plainly worked — a standing desk of free, no-nonsense calculators.”

Linear Regression Calculator

Paste your paired X and Y values to get the least-squares line of best fit — slope, intercept, the y = mx + b equation and R-squared.

 
Line of best fit
Least-squares regression line.
Regression readout
Slope b₁
Intercept b₀
R squared fit quality
Correlation r
Pairs n
Show our math
Enter your figures above to see the step-by-step working.
Least-squares fit — be cautious predicting outside your data rangeEverything computed client-side — nothing leaves this page

How the Linear Regression Calculator Works

Linear regression finds the straight line that best predicts Y from X by minimising the sum of the squared vertical distances from each point to the line — the least-squares method. Paste your paired data and the desk returns the line’s equation, its slope and intercept, and how well it fits.

The slope is how much Y changes for each one-unit rise in X; the intercept is the predicted Y when X is zero. The value, from 0 to 1, is the share of the variation in Y explained by the line — the closer to 1, the tighter the fit.

slope = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)²  ·  intercept = ȳ − slope · x̄

Frequently Asked Questions

What do the slope and intercept mean?

The slope is the predicted change in Y for each one-unit increase in X. The intercept is the predicted value of Y when X equals zero. Together they define the line y = slope·x + intercept.

What is a good R-squared value?

R² ranges from 0 to 1 and gives the fraction of the variation in Y explained by the line. What counts as “good” depends on the field — physical measurements may expect above 0.9, while noisy social data may treat 0.3 as meaningful.

Can I use this to predict new values?

Yes — plug an X into the equation to get a predicted Y. Be cautious predicting far outside the range of your data (extrapolation), where the linear pattern may no longer hold.

More From The Desk

Same plain method, different figures