Skip to content

Linear Regression Calculator

Result

Slope2
Intercept-0.5
R20.9523809524
↗ Math

Linear Regression Calculator — free online calculator.

Formula

Method: Fit y = intercept + slope·x to the four entered points by ordinary least squares, then return slope, intercept, and R².
  • Linear Regression Calculator calculates its result from x1, x2, x3, x4, y1, y2, y3, y4. It uses the formula Calculated with the verified ST Calculator runtime.. Change any input to recalculate the result instantly.
  • The main inputs are x1, x2, x3, x4, y1, y2, y3, y4. Enter them in the units and format shown in the calculator.
  • Keep comparable quantities in compatible units whenever the formula combines or compares them.
  • Changing any input above recalculates the result with the same calculation engine used by this page.

Example: Linear Regression

Inputs
  • x1: 1
  • x2: 2
  • x3: 3
  • x4: 4
  • y1: 2
  • y2: 3
  • y3: 5
  • y4: 8

Using x1 = 1, x2 = 2, x3 = 3, x4 = 4, y1 = 2, y2 = 3, y3 = 5, y4 = 8, the calculated result is Slope: 2 | Intercept: -0.5 | R2: 0.9523809524.

Sample result: Calculating…

Frequently asked questions

What does the Linear Regression calculate?

Linear Regression Calculator — free online calculator.

Which values should I enter?

Enter x1, x2, x3, x4, y1, y2, y3, y4 using the units and format shown beside each field.

What formula does this calculator use?

The calculator uses the following relationship: Method: Fit y = intercept + slope·x to the four entered points by ordinary least squares, then return slope, intercept, and R²..

Why might my result differ from another source?

Results can differ when another source uses different units, rounding rules, conventions or assumptions. Compare the inputs and definitions before comparing results.

Does the result update automatically?

Yes. Changing an input updates the result using the same calculation engine shown on this page.

Page information

Updated: October 7, 2026