Statistics

Pearson Correlation Calculator

Compute the Pearson correlation coefficient r from paired x, y values, with strength labels. Includes a worked 5-point example and warnings on causation.

Inputs

Results update as you type — essentials first

Saved scenarios

Store input snapshots on this device — load anytime.

No saved scenarios yet.

Formula / how it works

r = sum((x-xbar)(y-ybar)) / sqrt(sum((x-xbar)^2) * sum((y-ybar)^2)).

Detailed guide

What it is, how to use it, how to read the numbers, common mistakes, a worked example, formulas, and FAQs.

What this calculator is

The Pearson correlation coefficient measures how closely two variables follow a straight-line relationship. A value near +1 means that when x increases, y tends to increase; near −1 means y tends to decrease; near 0 means no linear relationship. This calculator takes pairs of x and y values, one pair per line, computes r and gives a rough strength label. Students use it in statistics courses, and analysts use it to screen relationships before modelling. Correlation does not prove causation, can be distorted by outliers, and only captures linear association. With few points, r can be large by chance.

When to use / who it helps

  • You have paired measurements and want a quick measure of linear association.
  • You are checking homework on correlation.
  • You are screening variables for regression.
  • You are examining whether two series move together.
  • You want r² for the explained variance.

How to use

Steps

  1. Enter one pair per line as x,y.
  2. Use at least three pairs; more is better.
  3. Read the Pearson r.
  4. Read the number of pairs used.
  5. Read the strength label.
  6. Plot the data to check for curves or outliers.

How to interpret results

  • |r| above 0.7 is often called strong, 0.4–0.7 moderate, below 0.4 weak, though conventions vary.
  • The sign gives direction.
  • r² gives the proportion of variance explained by a linear fit.
  • Outliers can change r dramatically.
  • A small sample can produce a misleading r.

Common mistakes & gotchas

  • Concluding causation from correlation.
  • Applying it to curved relationships.
  • Ignoring outliers.
  • Mixing up pairs.
  • Reporting r without the sample size.

Worked example

Worked example — five pairs

  1. Data: (1,2), (2,4), (3,5), (4,4), (5,6). Means: x̄ = 3, ȳ = 4.2.
  2. Σ(x − x̄)(y − ȳ) = 8.0; Σ(x − x̄)² = 10; Σ(y − ȳ)² = 8.8.
  3. r = 8.0 ÷ √(10 × 8.8) = 8.0 ÷ 9.381 ≈ 0.853.
  4. r² ≈ 0.727, so about 73% of the variation in y is explained by a straight-line fit.

Result: r ≈ 0.853, a strong positive linear association.

To load the form's own demo values, tap Try example above the Calculate button.

How to calculate / formula

r = sum((x-xbar)(y-ybar)) / sqrt(sum((x-xbar)^2) * sum((y-ybar)^2)).

Frequently asked questions

What does a correlation of 0 mean?

No linear relationship, though a nonlinear one may exist.

Does correlation imply causation?

No. Other variables or chance can explain it.

What is r²?

The square of r, the fraction of variance explained by a linear fit.

How many pairs do I need?

Three is the minimum, but many more are needed for reliable conclusions.

Can r be greater than 1?

No, it lies between −1 and +1.

What is the difference between Pearson and Spearman?

Spearman uses ranks and detects monotonic relationships; Pearson measures linear association.