Least squares line
Paste two columns of numbers and the tool finds the line that fits them, with R squared, correlation, standard errors, a residual chart and predictions both ways.
One line per pair. Tabs (a straight copy and paste from Excel or Google Sheets), semicolons, commas and spaces all work, and so do both the comma and the dot as the decimal mark. If the first line holds the column names it becomes the axis labels. Lines starting with # are comments.
The data you paste stays in your browser: not one line is sent anywhere.
How to paste your data
You need one line per pair of measurements, with x in the first column and y in the second. You can copy two columns straight out of Excel, LibreOffice or Google Sheets (they arrive separated by tabs), or use semicolons, commas or plain spaces. The decimal mark can be a comma or a dot, and if the automatic detection gets it wrong you can force it from the drop down. The first two numbers of each line are the ones taken, so a paste that still carries a label column in front works too. Lines without two numbers do not break the calculation, they are counted and the page tells you which ones they are.
What least squares actually minimises
Out of every possible straight line the method picks the one that makes the sum of the squared residuals as small as possible, the residuals being the vertical distances between each point and the line (the grey segments on the chart). The formulas are m = sum of (x minus the mean of x) times (y minus the mean of y), divided by the sum of (x minus the mean of x) squared, and q = mean of y minus m times the mean of x. One consequence surprises a lot of people: because the gaps are measured vertically, the line of y on x and the line of x on y are two different lines, not one the inverse of the other. The model takes for granted that the uncertainty sits on y and stays roughly the same across the range.
What R squared and the correlation do and do not say
R squared is the share of the variability of y that the line manages to explain (0.95 means 5 per cent of it is left unexplained), while r also carries the sign and tells you whether the relation goes up or down. For the free line R squared is exactly r squared. Neither of them proves causation, and neither notices a curve on its own: Anscombe's quartet is built precisely of four series sharing the same line, the same means and the same R squared, only one of which is genuinely linear. That is why the tool always shows you the points, the residuals and the row furthest from the line, which nine times out of ten turns out to be a typo.
Errors, intervals and prediction
With three points or more the tool also estimates the residual spread s (the square root of the sum of squared residuals divided by the degrees of freedom, which are n minus 2), and from it the standard error of the slope and of the intercept. The intervals shown are 95 per cent intervals built on Student's t with those degrees of freedom. The prediction of y for a new x carries a wider band than the line itself, because it adds the uncertainty of the line to that of a single measurement, and it widens as you move away from the centre of the data. If the x you type falls outside the measured range the page says so, because out there the line is only an extension and no data supports it.
Calibration curves, forced origin and stated limits
The field that finds x from a given y is there for calibration curves: you measure the signal of an unknown sample and read its concentration. The uncertainty shown uses the classic calibration formula and holds as long as the slope is well determined, that is much larger than its own standard error. The forced origin option sets q = 0 and computes m as the sum of x times y divided by the sum of x squared: it is honest only when physics tells you that y has to be zero at x = 0, and in that case the R squared shown (still measured against the mean of y) can even come out negative and must not be compared with the free line one. Multiple regression, weighted least squares and curves are all out of scope here, because this is one straight line only. With just two points the result is exact by construction and therefore meaningless.