About this tool
The Linear Regression Calculator fits a straight line to your paired (x, y) data using the ordinary least-squares method, entirely in your browser — nothing you paste is ever uploaded. Enter one pair per line as "x, y" (commas, spaces or tabs all work) and it returns the best-fit line plus its goodness-of-fit statistics live as you type.
It first computes the means x̄ and ȳ, then the sums of squares Sxx = Σ(x − x̄)², Syy = Σ(y − ȳ)² and the cross term Sxy = Σ(x − x̄)(y − ȳ). The slope is b = Sxy / Sxx and the intercept is a = ȳ − b·x̄, giving the line y = a + b·x. The correlation coefficient r = Sxy / √(Sxx·Syy) and its square r² measure how well the line explains the data.
Type a value in the "predict" field to get the fitted ŷ = a + b·x for that x. Lines that do not contain two readable numbers are skipped, so you can paste messy data; you need at least two valid points, and the x values must not all be identical.