The most-used model in all of data science. Fit a line through a cloud of points and see exactly how least squares balances the residuals — and how R² grades the fit.
Linear RegressionLive
least squares & R²
Controls
Presets
Ordinary least squares finds the line that minimizes the sum of squared vertical residuals (the gray drop-lines). R² measures the fraction of variance the line explains — 1 is perfect, 0 is useless. Add noise or remove points to watch the fit and R² degrade.
Reading this result: R² = 0.00: noise (2) swamps the signal, so least squares can barely tell the slope from flat — adding data points would tighten the estimate.
Runs locally in your browser — free forever. Scale to the cloud when reality gets heavy.
★ Sign in to save this setupSave your tuned setup, or drop this simulation into your own site, docs, or course page.
How it works
Ordinary least squares chooses the slope and intercept that minimize the sum of squared vertical residuals. R² reports the fraction of the variation the line explains, from 1 (perfect) to 0 (no better than the mean). Add noise or thin out the data to watch the estimate wobble and R² fall.
✦
Ask the AI about this model
The math, the assumptions, real-world uses, or a code translation — explained for this exact simulation.
Is this linear regression calculator tool really free?▾
Yes. Linear Regression runs entirely in your browser using your device's own compute, so local use is free forever. You only pay Compute Tokens if you scale a job to the cloud.
Do I need to install anything?▾
No. Everything runs client-side in a modern browser — no downloads, no license, no account required to start.
Can I save or share my simulation?▾
Create a free account to save projects, and use a shareable embed or minted DOI to publish a live, interactive version anywhere.
How accurate are the results?▾
The solver uses established numerical methods, but results are for research and educational purposes and should be validated against experiment or professional review before you rely on them.