ToolPatch

One page. One job. Done.

← Back to all tools
Math

Linear Regression Calculator

Fit a best-fit line from point data and compute r and R².

Last validated: 2026-02-14

Linear Regression Calculator fits a straight-line model to paired x and y data. The slope describes the expected change in y for a one-unit increase in x, while the intercept is the predicted y value when x equals zero. Least-squares regression chooses the line that minimizes the sum of squared vertical residuals, where residuals are differences between observed and predicted y values. R-squared describes the share of variation in y explained by the linear model, but it does not prove causation or guarantee that predictions are valid outside the observed range. Regression is useful for trend estimation and calibration, provided the relationship is approximately linear, residual patterns are reasonable, and influential outliers are examined.

Permalink

Input Pattern

Enter values in the left panel, keep units explicit, run the calculation, then copy or share the result. Invalid fields are highlighted immediately.

Point Data

One point per line: `x,y`

Model

Line: y = 0.900000x + 1.300000

r: 0.900000

R²: 0.810000

Points used: 5

How to use this tool

  1. Enter the required fields for the linear regression calculator, keeping units, dates, or text format consistent with the form labels.
  2. Confirm sample size, ordering, and distribution assumptions before relying on the calculated result.
  3. Click "Run the tool" and review Point Data, Model for the primary output.
  4. Check the statistical assumptions and sample context before using the result in a report or decision.

Worked Example

Auto-generated from the tool's current default or entered inputs.

Example Inputs

  • Slope: 0.9
  • Intercept: 1.3
  • R value: 0.9
  • R squared: 0.81

Expected Outputs

  • Parsed points 0 0: 1
  • Parsed points 0 1: 2
  • Parsed points 1 0: 2
  • Parsed points 1 1: 3

Interpretation

Confidence and limitations

Formula References

Assumptions

Explore more versions

Tailored guides for specific audiences, regions, and scenarios.

Data science learning products

Recommend statistics courses, data notebooks, and analysis tools.

Sponsored