Free math and education calculator

Linear Regression Calculator

Fit a least-squares line to paired values and calculate its slope, intercept, and R-squared.

Open the interactive linear regression calculator

Free tools and planners

Formula

Least-squares slope = Σ((x − mean x)(y − mean y)) ÷ Σ((x − mean x)²); intercept = mean y − slope × mean x.

Worked example

For example, points (1, 2), (2, 4), and (3, 6) fit the line y = 2x with R² = 1.

Assumptions and limitations

A fitted line summarizes association, not causation; outliers, nonlinearity, and extrapolation can make predictions misleading.

Keep moving with a practical next step

Browse free calculators, planners, and templates, or explore the blog and business directory. No subscription is required.