Zero Signup ToolsFree browser tools

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

5060708090246810xy

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.

#xyy_hatresidual
115355.509091-2.509091
226060.151515-0.151515
336564.7939390.206061
447069.4363640.563636
557674.0787881.921212
668078.7212121.278788
778583.3636361.636364
888888.006061-0.006061
999292.648485-0.648485
10109597.290909-2.290909

How to use

  1. 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.
  2. 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.
  3. Read the Regression equation card for y = b0 + b1 x, the slope, the intercept, Pearson r, and R squared.
  4. 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.
  5. 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.
  6. 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.
  7. Type any x value into Predict y from x to read the predicted y using the fitted line, useful for forecasting or interpolation.
  8. 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

All tools
All toolsCalculator Tools