Linear Regression Calculator (Line of Best Fit)

Math Tools

Slope, intercept and R² from x and y pairs

FreePrivateInstant
Add a file · .txt .md .csv .json … · up to 2.00 MB
Predict y for x (optional)
Full guide, 3 min readLinear regression: the best-fit line, slope, intercept and R² explainedRead the story behind this tool →

Similar tools you may like

History

All history →

Linear Regression Calculator (Line of Best Fit) — at a glance

Fit a straight line to your data and predict new values.

You paste
1, 2
2, 4.1
3, 5.9
Fit Line
Result
y = 1.95x + 0.1
R² = 0.999

How to use it — step by step

One x, y pair per line, separated by a comma or space.

1

Add your text

Paste or type your input into the box. The Sample button fills in an example.

2

Choose the options

Pick the mode and settings you need. Results update when you run the tool again.

3

Press Fit Line

The result is made instantly inside your browser.

4

Copy the result

Use the Copy button, or send it to another tool.

Pro tips

Small things that make the result better.

✦You need at least two points.
✦R² close to 1 means a good linear fit.
✦Do not predict far outside your data range.

Quick facts

Freeno signup
Privateruns in your browser
Instantresult in a second
No limituse it as often as you like

Frequently Asked Questions

What is least squares?+

The line that makes the total of squared vertical distances to the points as small as possible.

What does R² mean?+

The share of the variation in y explained by x.

Is my data safe?+

Yes. Everything runs inside your own browser. Your text, files and images are never uploaded to any server.

Is this tool really free?+

Yes — completely free, no signup, no watermark and no usage limit.

More Free Tools