At a Glance
- Category
- Statistics
- Best For
- Students and analysts modeling a straight-line relationship and making predictions
- Privacy
- 100% in your browser: nothing you enter is uploaded
- Time Required
- Under a minute
- Cost
- Free
- Updated
- November 2026
Quick Overview
Finds the straight line that minimizes the squared vertical distances to your points and uses it to predict y.
Students, scientists, analysts and forecasters.
When you want a trend line and a prediction from observed data.
It quantifies a trend and shows how well a straight line fits.
Key Features & Capabilities
Regression line
Slope and intercept from least squares.
Goodness of fit
r and R² show how well the line fits.
Prediction
Estimate y at any x.
How to Use This Tool
Enter your points
Put one x, y pair on each line. Tip: At least two distinct x values are needed.
Read the equation
The slope and intercept define y = mx + b. Tip: The slope is the change in y per unit of x.
Check the fit
R² near 1 means the line fits well. Tip: Plot the points to check for curvature.
Predict
Enter an x value to see the predicted y. Tip: Avoid predicting far outside your data range.
Worked Real-World Example
Five data points
Data: (1, 2.5), (2, 3.8), (3, 5.1), (4, 6.9), (5, 8.2). Predict y at x = 6.
How It Works (Math & Calculation Logic)
With n points: slope = (nΣxy − ΣxΣy) ÷ (nΣx² − (Σx)²), intercept = (Σy − slope × Σx) ÷ n, r = (nΣxy − ΣxΣy) ÷ √((nΣx² − (Σx)²)(nΣy² − (Σy)²)), R² = r². Predicted y = slope × x + intercept.
How to Interpret Your Results
R² ranges from 0 to 1. Higher means a closer fit.
A high R² does not prove causation or that a line is the right model.
Plot residuals and keep predictions within the range of observed x.
Frequently Asked Questions
What is a line of best fit?
What does R² mean?
How many points do I need?
Can I predict outside my data?
What is the difference between r and R²?
Complementary QuickForma Utilities
Descriptive Statistics Calculator
Calculate mean, median, mode, range, variance, standard deviation, quartiles, IQR, and MAD from data.
Hypothesis Test Calculator
Calculate test statistic Z = (xbar - mu) / (s / sqrt(n)), two-tailed p-value, and significance decision.
Sample & Population Standard Deviation Solver
Solves sample (s) and population (σ) standard deviation with variance steps.
Margin of Error & Survey Sample Size Solver
Calculates minimum required survey sample size based on confidence level (95%, 99%) and margin of error.
Altman Z-Score Business Bankruptcy Predictor
Uses 5 financial ratios to predict public and private business insolvency risk.
Raw Quiz / Exam Test Score Percentage Solver
Converts raw exam points (e.g. 47 out of 58) into percentage, letter grade, and grade points.
Definite & Indefinite Integration Solver
Calculates polynomial, exponential, and trigonometric definite/indefinite integrals with step-by-step logic.
Matrix Addition, Multiplication & Determinant Solver
Performs $2\times 2$ and $3\times 3$ matrix operations, determinant calculation, and matrix inversion.
Line Slope, Y-Intercept & Equation Solver
Solves line slope m = (y₂-y₁)/(x₂-x₁), point-slope form, and slope-intercept equation y=mx+b.
Pearson r & Spearman Rank Correlation
Computes Pearson product-moment correlation coefficient r and Spearman rank correlation.