FormatFlow

No tool matches “”

Try a format (“webp”, “mp3”) or a verb (“merge”, “compress”).

Loading index

↵to open

Scientific Tools · Updated October 21, 2026 · Reviewed by FormatFlow Editorial

Linear Regression Calculator

You can fit a least-squares line to paired data in your browser, read the slope, intercept, correlation and residuals, and predict y for a chosen x with an extrapolation warning.

Runs in your browserFree · No sign-up · No watermark
X,Y PAIRS → FIT + RRuns in your browser
Loading the tool…

Everything runs locally in this tab. No file is uploaded while the tool loads.

This tool runs in your tab. Nothing is uploaded and no copy is stored.

How files are handled

At a glance

Works with
X,Y PAIRS → FIT + R
Processing
In your browser
Price
Free, no account
Updated
October 21, 2026
All Scientific Tools

About Linear Regression Calculator

A line of best fit summarises how one measured quantity changes with another, but the numbers behind it matter: the slope, the intercept, the correlation and the residuals each describe a different part of the relationship. Reporting only r, for example, hides whether the line actually passes near the points.

This calculator fits a least-squares line to data you paste, shows the slope and intercept with the working, reports r and r², and lists residuals for every pair. A scatter plot marks the fitted line and an optional prediction, which is flagged as extrapolation when it falls outside the observed range.

What this tool does

The details that matter when you use Linear Regression Calculator for real work.
  • Least-squares fit with working

    Slope and intercept are computed from Sxx, Sxy and the means, and the step section shows that arithmetic with your numbers.

  • Correlation and r²

    Read r for the direction and strength of the linear relationship and r² for the share of variation in y explained by the line.

  • Residual summary and table

    See SSE, the mean and largest residual, and a per-pair table of observed, fitted and residual values.

  • Predictions with a warning

    Enter an x value to get a predicted y; the tool flags extrapolation beyond the data range instead of implying the line is reliable there.

  • Accessible scatter plot

    An SVG plot with a text description and a data table shows the points, the fitted line and the prediction without relying on colour alone.

  • Flexible pasted data

    Pairs can be comma, tab or space separated with one pair per line, and an optional header row is ignored.

How to use Linear Regression Calculator

No account, no installation — the whole job happens in this browser tab.
  1. 01

    Paste the paired data

    Put one x,y pair per line, separated by a comma, tab or space; a header row such as x,y is optional.

  2. 02

    Check the fit statistics

    The slope, intercept, r and r² appear above the plot, with the means and correlation details beside them.

  3. 03

    Review the residuals

    The residual table shows how far each observed y sits from the fitted value; patterns in it suggest a straight line may not be the right model.

  4. 04

    Optionally predict a value

    Type an x value in the prediction field; the predicted y appears and is marked on the plot.

  5. 05

    Read the extrapolation warning

    If the x value is outside the observed range, the tool warns that the prediction is an extrapolation rather than a data-backed value.

How this tool works

Works with
X,Y PAIRS → FIT + R
Processing
Client-side, in your browser. Nothing is uploaded.
Requirements
Chrome, Edge, Firefox or Safari · JavaScript enabled

Limitations worth knowing

  • Only a single-variable straight line is fitted; curved relationships need a different model.
  • Least squares is sensitive to outliers, and the tool does not detect or exclude them.
  • A maximum of 2,000 pairs is accepted, and predictions outside the observed x range are extrapolations.

Privacy and file handling

The pairs you paste are parsed and fitted with plain JavaScript inside your browser tab. Nothing is uploaded, logged or stored, and no request is made to a server while you work. Closing the page clears the data.

Read the full privacy policy

Linear Regression Calculator FAQ

Short, direct answers to the questions people ask before using this tool.
What do the slope and intercept mean in a regression?
The slope is the predicted change in y for a one-unit increase in x. The intercept is the predicted y when x is zero; it may have no physical meaning if x never approaches zero in the data.
What is a good r² value?
There is no universal threshold: r² depends on the field and the question. A high r² means the straight line explains much of the variation in y, but it does not prove the model is correct; inspect the residuals and the study design.
Why is r undefined for some data sets?
The correlation coefficient divides by the variation in y. If every y value is identical there is no variation to explain, so r and r² are undefined even though the best-fit line is horizontal.
What does an extrapolated prediction mean?
It is a prediction for an x value outside the range of the data used to fit the line. The relationship may change outside that range, so extrapolated values are less trustworthy than interpolated ones.
Does correlation show that one variable causes the other?
No. A strong correlation can come from a shared cause, from chance in a small sample, or from a real causal link. Causation needs evidence from the study design, not just a coefficient.
How many data pairs do I need to fit a line?
Two pairs are enough to draw a line, but they give a perfect fit by construction and say nothing about noise or curvature. More pairs spread across the range of x are needed before the slope and r mean much.
Can I include an outlier in the regression?
Yes, the least-squares line uses every pair. A single outlier can pull the slope and correlation noticeably, so check the residual table and consider whether the value is a data error before removing it.
Are my data pairs uploaded to a server?
No. The pairs are parsed and fitted with JavaScript in your browser; nothing is uploaded, stored or logged, and closing the page clears the data.

Background reading

Format guides that explain the trade-offs behind Linear Regression Calculator.