Linear Regression — Best-Fit Line, r, R²
Least-squares best-fit line with r and R² and a live scatter plot. Client-side; your data stays private.
How to use
- 1 Enter your data as “x, y” pairs, one per line.
- 2 The least-squares best-fit line is drawn over the scatter plot.
- 3 Read the slope, intercept, correlation r and R².
Why use this tool
- Least-squares linear regression with a live scatter plot.
- Gives the line equation plus correlation (r) and goodness of fit (R²).
- Runs entirely in your browser — your data never leaves your device.
Frequently asked questions
What is linear regression?
Fitting the straight line y = mx + b that minimises the sum of squared vertical distances to your data points (the least-squares line).
What does the correlation r mean?
r ranges from −1 to +1 and measures how strongly the points follow a straight line. Values near ±1 are strong; near 0 is weak.
What is R²?
The coefficient of determination — the fraction of the variation in y explained by the line. R² = r² for simple linear regression.
How many points do I need?
At least two. More points give a more reliable fit; the x values must not all be identical.
What is Linear Regression Calculator?
A linear regression calculator fits the least-squares straight line to a set of (x, y) data points and reports its slope, intercept, correlation coefficient r and coefficient of determination R².
Linear Regression Calculator is a free math utility by Zerethon Tools. Least-squares best-fit line with r and R² and a live scatter plot. Client-side; your data stays private. Runs entirely in the browser — no signup, no upload.
- Category
- Math
- Pricing
- Free
- Privacy
- Browser-based
- Signup
- Not required
Privacy
Your data never leaves your browser unless explicitly stated. Linear Regression Calculator runs entirely client-side — no server upload, no logging, no tracking of your input.
Related tools
Percentage Calculator
Three-in-one percentage calculator: X% of Y, X as a % of Y, and % increase/decrease. Instant, client-side.
Open toolScientific Calculator
Online scientific calculator — trig, log, powers, roots, factorial, π/e, DEG/RAD, with a proper expression parser. Client-side.
Open toolFraction Calculator
Add, subtract, multiply and divide fractions with automatic simplification, decimal and mixed-number output. Client-side.
Open toolCombinations & Permutations Calculator
Exact nCr, nPr and n! with big-integer precision. Client-side, no signup.
Open toolBuild, share, and grow on Zerethon Social
Free signup. Earn points, collect achievements, and connect with creators worldwide.