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 to use the linear regression
Use this linear regression to he linear regression line (y = mx + b) for a dataset. Enter your values above and get your result in seconds. The tool is free, works on all devices, and keeps your data private — nothing is stored or shared.
How the linear regression works
The linear regression calculator uses standard formulas used in statistical analysis, data science, and research. Enter your inputs, and the tool calculates the result instantly in your browser. No server-side processing means your data stays on your device. Results update in real time as you change inputs.
Who uses this linear regression
This tool is used by researchers, data scientists, students, and analysts. Whether you need a quick estimate or a precise figure for a decision, this linear regression delivers reliable results. It is especially useful when you need to check a calculation without opening a spreadsheet or searching for a formula.
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:
WikipediaCorrelation Coefficient Calculator
Calculate Pearson correlation coefficient (r) between two variables. Measures strength and direction of linear relationships.
Z-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.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →