📉 Linear Regression & Correlation Calculator
Fit a least-squares regression line to your paired (x, y) data — slope, intercept, the equation, correlation r and r² — with a scatter plot and the fitted line.
8 valid points parsed.
Regression equation
y = 1.99048x + 0.0428571
1.99048
Slope (b)
0.0428571
Intercept (a)
0.99941
Correlation r
0.99882
r² (fit)
r² means about 99.9% of the variation in y is explained by x.
Least-squares fit with Pearson’s r and r². Correlation is not causation. 🔒 Computed entirely in your browser.
How the linear regression & correlation calculator works
Paste your x and y values and the calculator finds the least-squares line y = a + bx that minimises the squared vertical distances to the points. It reports the slope and intercept, the regression equation, Pearson’s correlation coefficient r and the coefficient of determination r² (the share of variance explained), and draws a scatter plot with the fitted line so you can see the fit.
The visual differentiator: a scatter plot with the fitted line, plus the exact coefficients and r² — the kind of at-a-glance fit a chatbot can’t draw and often miscomputes.
Frequently asked questions
What is linear regression?
A method that fits a straight line y = a + bx to paired data by minimising the sum of squared vertical distances from the points to the line (least squares). The slope b and intercept a describe the best-fit relationship.
What do r and r² mean?
r is Pearson’s correlation coefficient (−1 to +1), measuring the strength and direction of the linear relationship. r² (r squared) is the proportion of the variance in y explained by x — an r² of 0.8 means the line explains 80% of the variation.
How do I read the regression equation?
y = a + bx: a is the predicted y when x is 0 (the intercept), and b is the change in y per one-unit increase in x (the slope). Plug in an x to predict its y.
Does correlation imply causation?
No. A strong r means x and y move together, not that one causes the other — a lurking third variable or coincidence can produce correlation. Regression describes association, not cause.
How much data do I need?
At least two points define a line, but more points give a more reliable fit and a meaningful r². Paste as many paired values as you have; the tool handles them all.
Is my data uploaded?
No — the fit, statistics and chart are all computed in your browser.