Blog
Statistics on data

Linear regression calculator online

Regression fits the line that comes closest to your points and hands you its equation. The slope is the useful part: it says how much the second column changes when the first goes up by one, which is the number people actually want when they ask whether something is working.

Your data never leaves this device

Your data

Paste a table straight from Excel or Google Sheets, or drop a CSV file. Nothing is uploaded anywhere — the whole calculation runs inside this browser tab.

CSV, TSV or plain text. Files saved in windows-1251 are detected and re-read automatically, so Cyrillic headers do not turn into garbage.

Parsing options

Columns

Result

The drawing library is downloaded only when you press the button, and only on this page.

This page has no server side at all. The table you paste is parsed by JavaScript inside your own browser, the chart is drawn on a canvas element on your machine, and the export file is assembled locally. Nothing is uploaded, stored or written to any log. You can disconnect from the network after the page has loaded and everything will still work — which is the simplest way to verify the claim yourself.

Facts and limits of this method

Method Ordinary least squares — minimises the sum of squared vertical distances
Equation y = a·x + b, with a the slope and b the intercept
Share of the variation in y explained by x, from 0 to 1
Standard error Typical size of a residual, in the units of y
Residuals Every row exported with its predicted value and its error
Minimum rows 3, and meaningfully around 20

When it misleads you

How it is calculated

The slope is the covariance of x and y divided by the variance of x, and the intercept is whatever makes the line pass through the point of both means. That is the closed-form solution to minimising the sum of squared vertical distances from the points to the line.

Vertical distances, not perpendicular ones. That asymmetry is why swapping x and y gives a different line: the method assumes the x values are known and all the error lives in y, which is a modelling assumption and not a mathematical necessity.

R² is the square of the correlation coefficient and is read as the share of variation in y that the line accounts for. The standard error of the estimate complements it by saying, in the units of y, how far a typical point sits from the line — a number that is often more useful and almost never reported.

The export contains every row with its predicted value and its residual. Residuals are where model problems become visible: if they form a curve rather than a shapeless cloud, the relationship is not linear and the equation above them is misleading.

Questions and answers

What does the slope actually mean?

How much y changes when x increases by one unit. In the sample data a slope near 8.9 means roughly nine additional units of sales per unit of ad spend — within the observed range, and assuming the relationship is causal, which the regression itself cannot establish.

Is my R² good enough?

It depends entirely on the field. Above 0.9 is routine in physics and suspicious in social science, where 0.3 can be a real finding. Compare against what is normal for your kind of data rather than against an absolute threshold.

Can I predict beyond my data range?

You can compute it, but you should not trust it. Extrapolation assumes the relationship continues unchanged, and outside the observed range there is no evidence for that at all.

Should x and y be swapped?

Put the variable you control or observe first on x, and the outcome on y. The two orderings give different lines because least squares minimises error in y only.

Does my data leave the browser?

No. The fit, the chart and the residuals are all computed locally.

Related tools

All tools