Linear Regression Calculator
Calculate slope, intercept, R², and Pearson correlation coefficient from X,Y data pairs with best-fit line equation and Y prediction. Perfect for statistics, data science, and academic research with correlation strength classification.
One X,Y pair per line. Supports comma or space separated values.
🌈 Browse More Tools
Complete Guide: Linear Regression Calculator
Everything you need to know about using this tool effectively
Enter your data points and this calculator fits a best-fit line using least squares regression. It returns the slope, y-intercept, R-squared value, and Pearson correlation coefficient so you can evaluate the strength and direction of the relationship between your variables.
A statistics tool that performs simple linear regression analysis on paired X,Y data. The calculator computes the line of best fit in the form y = mx + b, where m is the slope and b is the y-intercept. It also provides R-squared to indicate how well the line fits your data and lets you predict Y values for new X inputs.
Academic Statistics Homework
Verify your hand-calculated regression results or check answers on assignments involving line fitting and correlation analysis.
Business Trend Analysis
Fit a trend line to monthly revenue or sales data to forecast future performance and identify growth patterns.
Scientific Data Analysis
Analyze the relationship between two measured variables in lab experiments, such as temperature and reaction rate.
Machine Learning Preprocessing
Quickly check linear relationships between features before building more complex predictive models.
Enter Your Data Points
Type or paste your X values in the first field and corresponding Y values in the second field, separated by commas or new lines.
Calculate the Regression
Click the calculate button to run the least squares algorithm on your dataset.
Review the Results
Examine the slope, intercept, R-squared value, and the full regression equation displayed in the results panel.
Predict New Values
Enter an X value in the prediction field to compute the estimated Y value using your fitted regression line.
Check for outliers in your data before running the regression, as extreme values can heavily influence the slope.
An R-squared close to 1 indicates a strong linear relationship, while values near 0 suggest little linear correlation.
Make sure your X and Y arrays have the same number of values or the calculation will fail.
Use at least 5 to 10 data points for more reliable regression results.
If R-squared is low, the relationship between your variables may be nonlinear and a different model might fit better.
What does the slope tell me?
The slope represents the rate of change in Y for every one-unit increase in X. A positive slope means Y increases as X increases, while a negative slope means Y decreases as X increases.
What is a good R-squared value?
An R-squared above 0.7 generally indicates a strong linear relationship, though what counts as good depends on your field. In physics, values above 0.9 are often expected, while social sciences may accept lower values.
Can I use this for multiple regression?
This calculator handles simple linear regression with one independent variable. For multiple regression with several predictors, you would need a multivariate analysis tool.
What is the Pearson correlation coefficient?
Pearson r measures the strength and direction of a linear relationship on a scale from -1 to 1. Values near 1 indicate a strong positive relationship, near -1 a strong negative relationship, and near 0 no linear relationship.
How many data points do I need?
You need at least two data points to calculate a line, but more points produce more reliable results. A minimum of 5 to 10 points is recommended for meaningful regression analysis.
Academic Calculator Tools for Students
Calculate grades, GPA, fractions, statistics, and solve math problems. Essential calculator tools for students, teachers, and academic work.
Math & Science Calculators
Essential math and science calculators for students, engineers, and researchers. Perform scientific calculations, solve fractions, compute statistics, and handle complex mathematical operations instantly.