CalcToolsKitSimple tools. Clear answers.

Linear Regression Calculator

Free · No sign-up

Fit a least-squares line to paired measurements and evaluate it at an entered x.

Your inputs

Example values are shown. Edit them for your calculation.

Results update automatically as you edit.

Inputs stay in this page. No account needed.

Your result

MATH

Example values are prefilled. Results update automatically when JavaScript is available.

What this tool calculates

Fit a least-squares line to paired measurements and evaluate it at an entered x.

Inputs used: x, y — one point per line, x for line prediction.

On this page How it works & practical examples

How to use the Linear Regression Calculator

Enter paired observations on separate lines. Ordinary least squares treats x as the predictor and minimizes squared vertical residuals. The output includes the line coefficients and R² as a descriptive fit measure.

The calculation

Slope = Σ[(x−mean x)(y−mean y)] / Σ(x−mean x)²; intercept = mean y − slope × mean x

Worked example

Points (1,3), (2,5) and (3,7) fit y = 2x + 1 exactly. The line predicts y = 9 at x = 4.

Assumptions and limits

X values cannot all be identical. The tool does not establish causality, estimate prediction intervals or validate extrapolation. Constant y gives an undefined R² under this stated convention.

Common questions

Does a high R² prove one variable causes another?

No. It describes fit to these observations, not a causal relationship.

Can I reverse x and y?

That solves a different least-squares problem and need not produce the reciprocal line.

AboutContactPrivacy PolicyTermsDisclaimerAll calculatorsSitemap