Calculator Tools
Linear Regression Calculator
Fit a least squares regression line to your (x, y) data. Get the equation, slope, intercept, R squared, residuals, and a live scatter plot.
Regression equation
y = 50.866667 + 4.642424 x
Or: y = 4.642424 x + 50.866667
Slope (b1)
4.642424
Intercept (b0)
50.866667
Pearson r
0.994326
R squared
0.988684
Summary statistics
- n
- 10
- Mean (x)
- 5.5
- Mean (y)
- 76.4
- Sample SD (x)
- 3.02765
- Sample SD (y)
- 14.135849
- Min (x)
- 1
- Max (x)
- 10
- Min (y)
- 53
- Max (y)
- 95
Regression diagnostics
- SS_xx
- 82.5
- SS_yy
- 1798.4
- SS_xy
- 383
- SS regression
- 1778.048485
- SS residual
- 20.351515
- Residual SE (s)
- 1.594973
- Slope SE
- 0.175601
- Intercept SE
- 1.089574
- Degrees of freedom
- 8
Predictions and residuals
Hover a row to highlight its point on the chart.
| # | x | y | y_hat | residual |
|---|---|---|---|---|
| 1 | 1 | 53 | 55.509091 | -2.509091 |
| 2 | 2 | 60 | 60.151515 | -0.151515 |
| 3 | 3 | 65 | 64.793939 | 0.206061 |
| 4 | 4 | 70 | 69.436364 | 0.563636 |
| 5 | 5 | 76 | 74.078788 | 1.921212 |
| 6 | 6 | 80 | 78.721212 | 1.278788 |
| 7 | 7 | 85 | 83.363636 | 1.636364 |
| 8 | 8 | 88 | 88.006061 | -0.006061 |
| 9 | 9 | 92 | 92.648485 | -0.648485 |
| 10 | 10 | 95 | 97.290909 | -2.290909 |
How to use
- Paste your data into the textarea with one (x, y) pair per line. Separate x and y with a comma, space, tab, or semicolon. Lines starting with # are ignored.
- Click a Quick sample (study hours vs exam score, temperature vs ice cream sales, advertising spend vs revenue, tree diameter vs height) to load a realistic dataset and see how the calculator works.
- Read the Regression equation card for y = b0 + b1 x, the slope, the intercept, Pearson r, and R squared.
- Inspect the Scatter plot for the data points and the fitted regression line drawn across the visible x range with axis ticks and grid lines.
- Use the Summary statistics and Regression diagnostics panels for means, standard deviations, sums of squares, residual standard error, and the standard errors of the slope and intercept.
- Scroll the Predictions and residuals table to see y_hat and e for every row; hover a row to highlight the matching point on the chart.
- Type any x value into Predict y from x to read the predicted y using the fitted line, useful for forecasting or interpolation.
- Click Copy full report to paste the complete summary into a notes app, lab report, or spreadsheet. Use Clear to start over.
About this tool
Linear Regression Calculator fits an ordinary least squares (OLS) line to a paired dataset of (x, y) values and shows the full result a statistics class, a science lab, or a data analyst typically needs. Paste any number of rows with one (x, y) pair per line, separated by commas, spaces, tabs, or semicolons, and the tool returns the regression equation y = b0 + b1 x with both forms displayed (the standard form and the textbook y = mx + b version), the slope b1 and intercept b0, the Pearson correlation coefficient r, the coefficient of determination R squared, the residual standard error s, the standard errors of the slope and intercept, the sums of squares SS_xx, SS_yy, SS_xy, SS regression, and SS residual, the sample mean and standard deviation of x and y, and the minimum and maximum of each axis. A live SVG scatter plot draws every point and the fitted line over a tidy grid with axis labels, so you can see at a glance whether the fit looks reasonable or whether the data needs a transformation. A predictions and residuals table lists each row with its predicted y_hat and residual e = y - y_hat, and hovering a row highlights the matching point on the chart. A small prediction box lets you plug in any x value and read the predicted y from the fitted line, useful for forecasting from training data, interpolating between observations, or extrapolating cautiously beyond the sample range. The input parser accepts comma decimals (European locale), scientific notation, and # comment lines, and the tool detects common error cases (only one number per row, identical x values, non-numeric tokens) and points to the exact row that needs attention. Everything runs locally in the browser; the numbers you paste here are never uploaded, logged, or stored.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Standard Deviation Calculator
Sample and population SD, variance, quartiles, outliers, and step by step working.
Open tool
CalculatorMean Median Mode Calculator
Mean, median, mode, range, standard deviation, and five number summary from any list.
Open tool
CalculatorSlope Calculator
Slope, line equation, midpoint, distance, and angle from two points.
Open tool
CalculatorA/B Test Significance Calculator
Two-proportion z-test for A/B and split tests with p-value, lift, and confidence interval.
Open tool
CalculatorSample Size Calculator
Required sample size for proportions or means, with reverse margin of error lookup.
Open tool
CalculatorZ-Score Calculator
Convert raw values to z-scores, p-values, and percentiles, plus inverse lookup.
Open tool