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 →
Embed this tool on your websiteFree
  1. Choose how tall the frame should be.
  2. Press Copy code.
  3. Paste it into your page, blog, WordPress or Notion HTML block.
Height

The tool runs inside your visitor's browser, nothing is uploaded, and a small "Powered by ToolCloak" line stays under it. The second line (script) is optional: it makes the frame fit the tool's height.

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 Linear Regression Calculator?+

Find the line of best fit for your data. Enter x and y pairs to get the slope, intercept, correlation and R², and predict y for any x using least squares regression.

How do I use Linear Regression Calculator?+

Open Linear Regression Calculator on this page, then: 1. Add your text 2. Choose the options 3. Press Fit Line 4. Copy the result. Everything runs in your browser on a phone or computer.

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.

Also searched as: linear regression calculator · line of best fit calculator · regression line calculator · least squares calculator · how to use linear regression calculator · online linear regression calculator free

More Free Tools