Correlation Coefficient Calculator

This correlation coefficient calculator takes pairs of values and gives Pearson r, Spearman ρ and the regression line. The example (study hours and scores) gives r = 0.9852.

Source: Wikipedia – Pearson correlation coefficient (t-test for r, Fisher transformation). Updated: .

Two numbers per line, separated by semicolon, tab or space. Copy straight from a spreadsheet. Decimal comma and point both work.
My ToolboxYour inputs are saved in this browser only.

Result

Correlation
Correlation coefficient r = 0.9852 – very strong positive relationship
More figures
  • Value pairs: 8
  • Coefficient of determination R² = 0.9707 (97.1% explained by x)
  • Spearman rank correlation ρ = 0.9762
  • p-value (t-test for r = 0): < 0.0001
  • 95% interval for r: 0.9177 to 0.9974
  • Regression line: y = 47.893 + 4.107 · x
  • Means: x̄ = 4.500, ȳ = 66.375
Formula
r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² · Σ(y − ȳ)²)
With few value pairs r is uncertain. The interval shows how much.

How it is calculated

What the correlation calculator gives you

Correlation measures how closely two quantities are related. The Pearson coefficient r lies between −1 and +1: +1 means all points lie on a rising straight line, −1 on a falling one, 0 means no linear relationship. Its square R² gives the share of the spread of y that x explains.

Pearson or Spearman?

Pearson measures the linear relationship and reacts strongly to outliers. Spearman’s ρ works with the ranks of the values and captures any steadily rising or falling relationship, even a curved one. If r and ρ differ a lot, it is worth looking at the data.

p-value and interval

The p-value says how rare such a large r would be if there were really no relationship. The 95% Fisher interval shows the range in which the true r probably lies. Both depend strongly on the number of pairs: with five points even r = 0.77 is not significant.

Regression line

The line y = a + b · x describes the average trend by least squares. The slope b says by how much y rises on average when x grows by 1.

Honest limits

Correlation is not causation: two quantities can rise together without one causing the other. The method needs pairs and only tests relationships that are straight or monotonic.

Frequently asked questions

How do you calculate the correlation coefficient?

Pearson r is the covariance of x and y divided by the product of their standard deviations. The calculator does it for any number of pairs.

What does r = 0.9 mean?

A very strong positive linear relationship: when x rises, y almost always rises too. R² is then 0.81.

What is the difference between Pearson and Spearman?

Pearson measures the linear relationship of the values, Spearman that of the ranks. Spearman is more robust against outliers and curved relationships.

How do I paste data from a spreadsheet?

Select two columns, copy and paste them into the box. Spreadsheets separate columns with a tab, which the calculator understands.

Does a high correlation prove cause and effect?

No. It only shows that the values move together. The cause must be established in another way.

Sources and legal basis

As of: · Editorial policy

Related tools