Ad Space
Statistics Calculators

Linear Regression Calculator

Calculate the slope and intercept of the best-fit line through a set of x and y data points using least-squares regression.

Enter x-values separated by commas or spaces.
Enter y-values separated by commas or spaces, matching the number of x-values.
Slope (m)
Intercept (b)
R² (coefficient of determination)
Ad Space — 300×250

About the Linear Regression Calculator

Simple linear regression finds the straight line that best fits a set of (x, y) data points by minimizing the sum of squared vertical distances between the points and the line — the "least-squares" method.

Formula: Slope m = ∑((x − x̄)(y − ȳ)) ÷ ∑(x − x̄)² · Intercept b = ȳ − m × x̄ · Line: y = mx + b

R² indicates how well the line fits the data, ranging from 0 (no linear relationship) to 1 (perfect fit). Linear regression is a foundational tool for forecasting and trend analysis.

Ad Space