# Linear Regression Calculator - Regression Line, r and R² Online

> Free online linear regression and curve fitting: paste x and y columns for the least-squares line, r, R², residuals, predictions and quadratic or cubic fits.

- URL: https://qilingtools.com/en/math/regression
- Category: Math Tools (https://qilingtools.com/en/math)
- Tags: [Math](https://qilingtools.com/en/tags/math), [Statistics](https://qilingtools.com/en/tags/statistics)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

Paste your x and y columns and get the least-squares regression equation, the correlation coefficient r and R² immediately. Switch to a quadratic or cubic fit, inspect the residual of every point, predict y for any x, and open the scatter plot with the fitted curve in the grapher.

## How to use

1. Copy two columns from a spreadsheet or lab notes — one point (x, y) per line
2. Choose a linear, quadratic or cubic fit
3. Read the equation, r and R², and enter an x in the prediction box for ŷ
4. Click “Plot the scatter and the fitted curve” to see the fit in the grapher

## Features

- Least-squares regression with slope, intercept and correlation coefficient r
- The strength of the relationship is labelled for you (strong / moderate / weak, positive or negative)
- R² and the standard error of the estimate to judge the fit
- Intermediate values Sxx, Syy and Sxy listed so they match the textbook formulas
- Residual table with observed, fitted and residual for every point, copyable in one go
- Quadratic and cubic polynomial fits for non-linear trends
- One click sends the points and the fitted curve to the graphing tool

## FAQ

### What is the difference between r and R²?

r measures the direction and strength of a linear relationship and runs from −1 to 1. R² is its square in the linear case and gives the share of the variation explained by the fit; the closer to 1 the better. Polynomial fits report R² only.

### How large does r have to be to count as strong?

A common rule of thumb: |r| ≥ 0.8 is strong, 0.5 to 0.8 moderate, 0.3 to 0.5 weak, and below 0.3 essentially none. The tool labels it for you.

### What are residuals for?

A residual is observed minus fitted. The table shows which points sit furthest from the trend, and a clear pattern in the residuals (all positive then all negative, say) is a sign that a straight line is the wrong model — try the quadratic or cubic fit.

### How should the data be formatted?

One point per line with x and y separated by a comma, space or tab, so you can paste two columns straight from a spreadsheet. With a single column the row number is used as x.

### Does a high R² prove causation?

No. R² only describes how closely the curve follows the data. Two quantities can move together because of a third common cause; establishing causation needs an experiment or domain knowledge.

## Related tools

- [Graphing Calculator](https://qilingtools.com/en/math/graph): Free online function graphing calculator: type sin(x), x^2 or 1/x and see the curve at once, with several functions, parametric and polar curves, PNG export.
- [Scientific Calculator](https://qilingtools.com/en/math/calculator): Free online scientific calculator: type 2*(3+4)^2, sin(pi/6) or log(8,2) and see the answer as you type, with degrees or radians and a history list.
- [Equation Solver](https://qilingtools.com/en/math/equation): Free online equation solver: enter coefficients for linear, quadratic (with discriminant, vertex and complex roots) and cubic equations, plus 2×2 systems.
- [Fraction Calculator](https://qilingtools.com/en/math/fraction): Free online fraction calculator: add, subtract, multiply and divide fractions with automatic reduction, plus fraction ↔ decimal with repeating digits.
- [Percentage Calculator](https://qilingtools.com/en/math/percentage): Free online percentage calculator: X% of Y, X as a percent of Y, increase and decrease, a value after a percentage change and the original behind it.
- [Prime Factorization](https://qilingtools.com/en/math/prime): Free online prime factorization: factor an integer with exponents, list every divisor and their sum, test primality with neighbouring primes, or list a range.
- [GCD and LCM](https://qilingtools.com/en/math/gcd-lcm): Free online GCD and LCM calculator: works with two or more integers, says whether they are coprime, shows each prime factorization and every Euclidean step.
- [Statistics Calculator](https://qilingtools.com/en/math/statistics): Free online statistics calculator: paste a data set for the mean, median, mode, range, quartiles, variance, standard deviation, standard error and outliers.
