Life Calculator
MAKE THE FORMULA CLEAR

Pearson correlation and linear regression calculator

Calculate Pearson correlation and a least-squares regression line from matched X and Y observations.

Start with your own numbers

Editable example

An example is filled in. Replace it with your own data to calculate.

Enter corresponding X and Y values on each row; at least two pairs are required.

Loading calculator…

Paired observations

Enter each matching X and Y pair, from 2 to 100 pairs.

Record 1
Record 2
Record 3

Results update when inputs are complete. A plan is kept only when you save it. Inputs and results are not uploaded.

Saved plans →

Saved in this browser. Before changing devices, export a backup from My tools.

Example result

Regression line slope

2

Correlation does not imply causation; very small samples and outliers limit interpretation.

Regression line intercept0
Pearson correlation r1
Coefficient of determination R²1
Number of paired observations3

Worked steps

  1. Regression line: y = intercept + slope × x.
  2. Correlation measures linear association, not causation.
  3. Results show up to eight significant digits; very large or small values may use scientific notation.

Pearson r measures linear association. The least-squares line is y = intercept + slope × x; R² is the coefficient of determination for this model with intercept. Constant X makes the line undefined; constant Y yields a line but leaves r and R² undefined. Two points can have r = ±1 without proving a reliable trend. Correlation is not causation; outliers, nonlinear patterns and sampling affect interpretation. Results use floating-point approximation; usage events are not transmitted.

Method and scope

Correlation measures linear association and does not establish cause. Outliers, nonlinearity and sampling can affect results.

Constant X makes the regression undefined. Constant Y gives a horizontal line but correlation and R² are undefined. No usage event is transmitted.

References:NIST: correlation、Taipei Medical University: correlation analysis

Purpose

Use matching X and Y observations to calculate Pearson correlation and a least-squares regression line.

Inputs

Enter a matching X and Y number on each row, with two to one hundred rows and no more than six decimal places.

Formula

The slope is the sum of centered X times centered Y divided by the sum of squared centered X; intercept is mean Y minus slope times mean X.

Example

For pairs (1,2), (2,4), (3,6), the fitted line has slope 2, intercept 0 and Pearson correlation 1.

Reading the result

The sign of r indicates linear direction and its magnitude indicates linear association. R² is the squared correlation for this fitted model.

Limits

Constant X makes the line undefined; constant Y makes correlation and R² undefined. Two points can yield perfect correlation without proving a reliable trend or causation.

Keep it handy for next time

Add Pearson correlation and linear regression calculator to your home screen

This icon opens this tool. Confirm installation in your browser.

  1. iPhone: Open in Safari, tap Share → Add to Home Screen, then confirm.
  2. Android: Open in Chrome and choose Install app or Add to Home screen from the menu.
  3. In an in-app browser such as LINE or Facebook, use its menu to open the page in Safari or Chrome first.

Browser options vary. A shortcut does not provide cross-device synchronization, and an installed app may have separate storage. Export a backup from My tools first. The first load requires a connection.

Checking offline data.