Linear regression (line of best fit) calculator
Least-squares straight line through your data, with R². Enter your values and see the formula, your numbers plugged in and every step of the working. Free, no sign-up, SI and imperial units.
Formula
m = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)² c = ȳ − m · x̄, R² = r²
Inputs
- x values (x)
- y values (same count) (y)
Worked example: Five measured points
- x values x = 1, 2, 3, 4, 5
- y values (same count) y = 2.1, 3.9, 6.2, 7.8, 10.1
- x̄ = 3, ȳ = 6.02
- Σ(x − x̄)(y − ȳ) = 19.9; Σ(x − x̄)² = 10
- m = 19.9 ÷ 10 = 1.99
- c = 6.02 − 1.99 × 3 = 0.05
- R² = 0.997305
Answer: Slope m = 1.99 ; Intercept c = 0.05 ; R² R² = 0.997305 ; Equation: y = 1.99x + 0.05
More engineering maths calculators
- Linear interpolation: Find a value between two table entries (steam tables, property charts).
- Matrix calculator: Determinant and inverse of a 2×2 or 3×3 matrix.
- Simultaneous equations: Solve 2 or 3 linear equations with Cramer's rule.
- Significant figures: Count significant figures and round a number to n figures.
- Quadratic roots: Solve ax² + bx + c = 0, including complex roots.
- Descriptive statistics: Mean, median, standard deviation and more from a list of numbers.
- Triangle solver: Missing sides, angles and area of any triangle.
- Percentage error & change: Percentage error of a measurement, or percentage change between two values.
Engineering Maths formula sheet · All calculators · Practice problems