Least Squares Regression Line Calculator
Fit a best-fit line y = mx + b through up to five points.
Least-squares regression finds the straight line that best fits a set of data points.
The math behind it
It minimises the sum of squared vertical distances. The slope and intercept come from the standard normal-equation formulas using sums of x, y, xy and x².
Worked example
Points (1,2)…(5,6) give a best-fit slope near 0.8 and intercept near 1.4.
FAQ
Do I need all five points?
Use as many as you have; set unused points to repeat a real point or leave the defaults.