Calculate linear regression with step-by-step solutions. Find slope, intercept, correlation coefficient (r), and R-squared with scatter plot visualization.
Linear regression is a statistical method for modeling the relationship between a dependent variable (y) and one or more independent variables (x). Simple linear regression uses one independent variable and finds the line y = bx + a that best fits the data by minimizing the sum of squared differences between observed and predicted values.
Linear regression finds the best-fitting straight line through a set of data points. Use our free calculator to calculate the slope, intercept, correlation coefficient (r), and R-squared value. Simply enter your x,y data points and get the regression equation with detailed step-by-step calculations and an interactive scatter plot.
Test your skills with practice problems
Practice with 6 problems to test your understanding.
Explore similar calculators
Formulas follow standard definitions from the NIST Digital Library of Mathematical Functions and classical textbook derivations. Calculations run entirely in your browser. Where a closed-form solution exists, it is used; where an iterative or numerical method is required, the implementation is named on the page.

Full-stack software engineer specializing in embedded systems, web architecture, and AI/ML. Founder of Practical Web Tools. Built the gesture-controlled drone IP acquired by KD Interactive (Aura Drone, sold on Amazon).