About this calculator
You get the equation, how well it fits (R²) and whether the slope is statistically significant.
How to use it
- Enter the X values and the matching Y values.
- Optionally enter an X to predict at.
- Read the equation and fit.
The formula
b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)²; a = ȳ − b x̄
- b
- slope
- a
- intercept
- x̄, ȳ
- means of X and Y
Worked example
X 1 to 6 and Y 3, 5, 6, 9, 10, 13
- b = 1.943 and a = 0.867, so y = 0.867 + 1.943x.
- R² = 0.981; at X = 4.5, Y ≈ 9.61.
What the result means
The slope is the change in Y for each unit of X. Predictions outside the range of your X values are guesses and are flagged.
Assumptions
- A straight-line relationship with roughly constant scatter.
Limitations
- Outliers can pull the line strongly.
Frequently asked questions
What is the regression of y on x?
The line used to predict y from x, which is what this calculator gives.
What does R² = 0.8 mean?
The line explains 80% of the variation in Y.
Can I predict X from Y with the same line?
Not exactly; the regression of x on y is a different line unless r is ±1.
Last reviewed on 6 October 2026. Found a mistake? Tell us.

