Linear Regression Calculator
Best fit line for paired data.
Enter your values
Enter the x values you are working with.
Enter the y values you are working with.
Enter the predict y at x = you are working with.
Results update instantly as you type — no submit needed. Your values are remembered on this device, and the shareable link reopens the calculator with exactly these numbers.
- Equation
- y = 1.99286x + 0.25714
- Slope
- 1.992857
- Intercept
- 0.257143
- R squared
- 0.99827
- Prediction
- 20.18571
Quick answer
Least squares regression finds the line minimising squared vertical distances, giving y = mx + b.
m = Σ(x−x̄)(y−ȳ)/Σ(x−x̄)², b = ȳ − mx̄
At a glance
| What it does | Best fit line for paired data. |
|---|---|
| Category | Statistics |
| Inputs needed | X values, Y values, Predict y at x = |
| Main output | Equation |
| Formula | m = Σ(x−x̄)(y−ȳ)/Σ(x−x̄)², b = ȳ − mx̄ |
| Cost | Free — no sign-up, no download |
How to use the Linear Regression Calculator
- 1Paste your X values.
- 2Paste matching Y values.
- 3Enter an x value to predict.
Inputs explained
- X values
- Enter the x values you are working with.
- Y values
- Enter the y values you are working with.
- Predict y at x =
- Enter the predict y at x = you are working with.
Worked example
Using the values the calculator loads with:
Inputs
- X values1, 2, 3, 4, 5, 6, 7
- Y values2.1, 4.3, 6.2, 8.5, 10.1, 12.4, 14.0
- Predict y at x =10
Results
- Equationy = 1.99286x + 0.25714
- Slope1.992857
- Intercept0.257143
- R squared0.99827
- Prediction20.18571
Frequently asked questions
What is a good R squared?
Depends on field — 0.9+ in physics, 0.3 can be meaningful in social science.
Can I extrapolate?
Cautiously — predictions outside your data range are unreliable.
What do I need to enter into the Linear Regression Calculator?
Just 3 values: x values, y values, predict y at x =. Every field starts with a realistic example, so you can change one number at a time and watch the result update instantly.
How does the Linear Regression Calculator work out the answer?
Least squares regression finds the line minimising squared vertical distances, giving y = mx + b. It applies the formula m = Σ(x−x̄)(y−ȳ)/Σ(x−x̄)², b = ȳ − mx̄ and shows the working so you can check each step by hand.
Is the Linear Regression Calculator free, and do I need an account?
It is completely free with no sign-up, no download and no usage limit. Everything is calculated in your browser, so the numbers you type never leave your device.
Results are estimates for general information. For medical, legal, structural or financial decisions, confirm with a qualified professional.