Loading the page...
Preparing tools and content for you. This usually takes a second.
Preparing tools and content for you. This usually takes a second.
Fetching calculator categories and tools for this section.
Free regression line calculator for (x, y) scatterplot data. Minimize squared errors to obtain ŷ = bx + a, with slope, intercept, Pearson correlation r, and R² for simple linear regression.
Last updated: April 13, 2026
Need a custom analytics calculator for your product? Get a Quote
Fitted line
ŷ = 1.5x + 0.333333
n = 3 points used
Slope b
1.5
Intercept a
0.333333
x̄
2
ȳ
3.333333
r (correlation)
0.981981
R²
0.964286
Least squares reminder
b = Sxy/Sxx, a = ȳ − bx̄, minimizing ∑(y − ŷ)². Outliers can pull the line; consider residual plots for model checks.
The fitted line is chosen so vertical squared residuals are as small as possible—standard ordinary least squares (OLS) for simple regression.
b tells how much ŷ changes per unit increase in x; a anchors the line at x = 0 (only meaningful if x = 0 is in-range for your study).
r measures linear correlation between x and y. It is omitted when y has no variation (perfect horizontal fit).
In simple linear regression, R² equals r² when r is defined, summarizing how much variability in y is captured by the linear model.
The regression line always passes through (x̄, ȳ)—a useful check when plotting by hand or verifying software output.
Pair with our linear regression and R² tools when you need fuller tables, or with variance when discussing spread around the mean.
Points (1, 2), (2, 3), (3, 5)
ŷ = 1.5x + 0.333333
Strong positive slope; use the form on the right to tweak values and watch r and R² update.
Rows are scanned for numeric x and y. With at least two valid pairs and varying x, the calculator forms the sums needed for Sxx, Syy, and Sxy, then applies the closed-form least-squares estimates. Correlation uses the standard Pearson formula when both x and y vary. See our other Math & Science calculators for extended regression and inference-style tools.
Sxx = ∑(xᵢ − x̄)², Sxy = ∑(xᵢ − x̄)(yᵢ − ȳ)b = Sxy / Sxx, a = ȳ − bx̄ŷ = bx + aShare it with anyone fitting a first scatterplot model
Suggested hashtags: #Regression #Statistics #LeastSquares #LineOfBestFit #Education