Linear Regression Calculator

Fit a least squares regression line to paired data and read the slope, intercept, equation and R squared.

Least squares regression line

Slope: — · Intercept: —
Equation: —
R squared: — · Pairs: —
y = —
The line is fitted by ordinary least squares, so it minimises the sum of the squared vertical distances to the points.

How to use the Linear Regression Calculator

  1. Paste your x values and matching y values into the two boxes.
  2. Read the slope, intercept and equation of the fitted line.
  3. Enter an x value in the prediction box to estimate y.

Features

Advertisement

Frequently Asked Questions

Common questions about the free online linear regression calculator.

Paste your x values and matching y values, and the tool fits a least squares line and shows the equation.
The slope is the change in y for each one unit increase in x along the fitted line.
R squared is the share of the variation in y explained by the line, from 0 for none to 1 for perfect.
It is fitted by ordinary least squares, which minimises the sum of the squared vertical distances to the points.
Yes. Enter an x value in the prediction box and the tool returns the matching y from the fitted line.
Yes. Each x value is paired with the y value in the same position, so the lists must line up.
The slope is undefined, because a vertical line cannot be written as y equals mx plus b.
A residual is the difference between an observed y value and the value that the fitted line predicts.
No. The regression is calculated locally in your browser and nothing you paste is transmitted.
Yes. It is completely free and unlimited, with no account, no sign-up and no usage caps.

Last updated: October 10, 2026