Linear Regression Calculator (Line of Best Fit)

Linear regression calculator: the line of best fit (least squares) for x–y data, with slope, intercept, correlation r, R² and predictions.

y = m x + b · m = Σ(x − x̄)(y − ȳ)Σ(x − x̄)²

How to use this calculator

  1. Type your input in the box.
  2. The result updates as you type.
  3. Use “Copy result” or “Copy link” to share it.

The least-squares line minimizes the sum of squared vertical distances. R² is the share of the variation in y explained by x.

Frequently asked questions

(1, 2.1), (2, 3.9), (3, 6.2), (4, 7.8), (5, 10.1)?

y = 1.99x + 0.05, r ≈ 0.9987.

Related calculators

Last updated: · Report an error