Linear Regression Calculator
Calculate the linear regression line (y = mx + b) for a dataset. Find slope, intercept, and predict Y for any X value.
Did this tool work for you?
How to use this calculator
The least-squares regression line minimises the sum of squared vertical distances from each data point to the line.
- 1
Enter 5 paired X and Y data points.
- 2
Enter an X value in "Predict Y" to get the expected Y from the regression line.
- 3
Check R² — values above 80% indicate a strong linear fit.
Frequently asked questions
What is the slope in linear regression?
The slope (m) tells you how much Y changes for every 1-unit increase in X. A slope of 2.5 means Y increases by 2.5 for each 1-unit rise in X.
What does R² mean?
R² (coefficient of determination) measures how well the regression line fits your data. R² = 0.85 means 85% of the variation in Y is explained by X.
Can I use this for prediction?
Yes, but only within the range of your data (interpolation). Extrapolating far beyond your data range may produce unreliable predictions.
Linear Regression Calculator — Slope, Intercept & Predictions
How least-squares regression works
The least-squares method finds the straight line that minimises the total squared distance between each observed point and the line. This gives the best-fit line for predicting Y from X, expressed as y = mx + b where m is the slope and b is the y-intercept.
Interpreting the regression output
A positive slope means Y tends to increase as X increases; a negative slope means the opposite. R² (the coefficient of determination) tells you the proportion of variance in Y explained by the linear model — higher R² indicates a better fit.
Learn more from an authoritative source:
WikipediaZ-Score Calculator
Calculate the z-score (standard score) and percentile rank for any value in a normal distribution. Convert raw scores to z-scores instantly.
T-Test Calculator
Perform a one-sample t-test to determine if a sample mean is significantly different from a known population mean. Returns t-statistic and p-value.
Chi-Square Test Calculator
Calculate the chi-square (χ²) statistic for goodness-of-fit or independence tests. Enter observed and expected frequencies to get χ² and p-value.
Confidence Interval Calculator
Calculate the confidence interval for a population mean from sample data. Supports 90%, 95%, and 99% confidence levels.
Sample Size Calculator
Calculate the minimum sample size required for a statistically valid survey or experiment. Specify confidence level, margin of error, and population size.
Percentile Calculator
Find the percentile rank of a score in a dataset, or find the value at a given percentile. Enter up to 10 data values.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →