Linear Regression Calculator
Paste your X and Y values to compute the best-fit regression line.
Result
How to use
- Enter your values in the fields above.
- Press Calculate to see your result instantly.
- Use the Share button to copy a link to your result.
About this calculator
A linear regression calculator fits a straight line y = mx + b to a set of (x, y) data points by minimizing the sum of squared vertical distances between the line and the points — the method of least squares. The slope is m = (nΣxy − ΣxΣy) / (nΣx² − (Σx)²) and the intercept is b = (Σy − mΣx) / n; the calculator also reports the Pearson correlation coefficient r and the coefficient of determination R², which tells you what fraction of the variance in y is explained by x.
This is the same math behind the trendline feature in Excel or Google Sheets, and it underpins everything from stock-price trend analysis to lab-instrument calibration curves. Students, scientists, engineers, and analysts use it to quantify a relationship between two variables, forecast a y value for a new x, and judge — via R² — how reliable that forecast actually is.
Was this helpful?
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)