Calculator Pro Hub

Linear Regression Calculator

Fit a straight line to paired data. Enter x,y points (one per line) to get slope, intercept, equation, and R².

Data points

Enter x,y pairs one per line—comma or space separated. Need at least two valid points.

Regression line

Enter points and tap Calculate regression.

Ordinary least squares on entered points—outliers and non-linear trends are not handled.

FAQ for this calculator

What format for points?
One pair per line: 1, 2 or 1 2—semicolons also separate lines.
What is R²?
Fraction of y variance explained by the line—1 means perfect linear fit.
Vertical x values?
All same x breaks the formula—need variation in x.
Predict y for new x?
Plug x into y = mx + b using the slope and intercept shown.

How to use the linear regression calculator

Least squares minimizes vertical distance from points to the line y = mx + b.

  • List x,y pairs from your dataset.
  • Tap Calculate regression.
  • Use slope, intercept, and R² for analysis.

When to use this calculator

  • Homework check for stats or algebra.
  • Quick trend line on lab data.
  • Scatter plot fit before charting in Excel.

Examples & walkthrough

  1. (1,2), (2,4), (3,5) → positive slope with R² under 1 if not perfectly linear.
  2. Perfect line (0,0), (1,2), (2,4) → slope 2, intercept 0, R² = 1.

Related tools