Linear regression calculator

One x, y pair per line. You get the straight line that best fits the data, and how well it fits.

Your answer

Slope1.99
Intercept0.05
R²0.9973
Correlation r0.9987
Standard error of the estimate0.1889
Standard error of the slope0.0597
p-value of the slope0.0001
Points5
Data and fitted line
  • Data
  • Fitted line
Show the numbers
Data and fitted line
xDataFitted line
12.12.04
23.94.03
36.26.02
47.88.01
510.110
  • Equation: y = 1.99x + 0.05. A good fit does not show that x causes y, and predictions beyond your data are less reliable.

Worked out in your browser. Nothing you type is sent to a server.

Step-by-step solution

Updated as you change the numbers.

  1. Slope = Sxy ÷ Sxx = 1.99.
  2. Intercept = mean of y − slope × mean of x = 0.05.
  3. R² = 1 − residual sum of squares ÷ total sum of squares = 0.9973.

Method and assumptions

Ordinary least squares with one predictor. The p-value tests whether the slope differs from zero, using a t statistic with n − 2 degrees of freedom.

Questions

What does R² mean?

The share of the variation in y that the line explains. An R² of 0.99 means the line accounts for 99% of it.

Sources

Method and figures checked on October 31, 2026. Every worked answer on this page is covered by an automated test. Found a mistake? Tell us.

Embed this calculator on your site

Free to use. Paste this where you want the calculator; it runs in your visitors’ browsers, sets no cookies and never sends us anything your visitors type.

Related calculators