Regression Line Calculator

Calculate the linear regression line (least squares method) for a set of data points. Get the slope, intercept, and R-squared value.

isCalculator Editorial Team Published by:
Reviewed by: Review Board
Last Updated:

Was this calculator helpful?

How to use this tool?

This calculator computes the linear regression line (best-fit line) for a set of data points using the least squares method.

  1. Enter data points in the text area, one pair per line, with X and Y values separated by a comma. For example:
    1,2
    2,4
    3,5
  2. Click "Calculate Regression" to process the data.
  3. View the results:
    • Slope (m) – the rate of change in Y per unit change in X.
    • Intercept (b) – the Y value when X = 0.
    • R² – the coefficient of determination (0 to 1), indicating how well the line fits the data.
    • Equation – the full regression line formula: y = mx + b.
  4. Error handling: If all X values are identical, or if input is invalid (non-numeric or missing values), an error message will appear.

Tip: Use at least 2 distinct X values for a meaningful regression. The calculator accepts any number of pairs.

Previous Results

Generate Charts
Result Inputs Date

Frequently Asked Questions

A regression line is a straight line that best fits a set of data points, used to model the relationship between two variables.

Enter each pair of X and Y values on a new line, separated by a comma. For example: 1,2 then 2,4.

R² (R-squared) indicates how well the regression line fits the data. A value close to 1 means a good fit.

Reviewed by Experts

Eurico José Kiala

Eurico José Kiala

Mathematician

Teacher

LinkedIn
João Lino

João Lino

Mathematician

LinkedIn
Quick Convert
Length Converter
0
Weight/Mass Converter
0
Area Converter
0
Volume Converter
0
Speed Converter
0
Temperature Converter
0
Pressure Converter
0
Energy Converter
0
Power Converter
0
Force Converter
0
Time Converter
0
Angle Converter
0
Fuel Consumption Converter
0
Data Storage Converter
0
Base Numbers Converter
0
Dry Volume Converter
0
Currency Converter
0
Text Case Converter
0