Correlation Coefficient Calculator

Correlation Coefficient Calculator

Get Pearson's r, Spearman's ρ and Kendall's τ for the same paired data side by side, with a plain-English reading of how strong the relationship is.

−1 (perfect negative) · 0 (none) · +1 (perfect positive)

Enter paired X and Y values

What is a Correlation Coefficient?

A correlation coefficient is a single number from −1 to +1 that summarises how strongly two variables move together. The sign gives the direction; the size gives the strength.

There's more than one. Pearson's r measures straight-line association using the actual values. Spearman's ρ and Kendall's τ use only the order of the values, so they measure any steady rise or fall and shrug off outliers.

Comparing all three is a quick diagnostic. If they agree, the relationship is straight and well behaved. If Pearson is far from the other two, an outlier or a curve is driving it.

Correlation Coefficient Formulas

Definitions as in Hollander, Wolfe and Chicken; Kendall's τ-b as in Kendall (1938, 1945). See Sources.

1. Pearson's r

r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² Σ(y − ȳ)²)

2. Spearman's ρ

ρ = Pearson's r applied to the ranks of x and y

3. Kendall's τ-b

τ = (concordant pairs − discordant pairs) ÷ √((n₀ − n₁)(n₀ − n₂))

A pair of points is concordant if both coordinates move the same way. n₀ is the number of pairs, n₁ and n₂ adjust for ties in x and y.

Worked Example: Sleep, Reaction Time and One Outlier

Given:
Hours of sleep 5, 6, 6.5, 7, 7.5, 8, 8.5, 9 and reaction times in ms 310, 295, 290, 280, 275, 270, 268, 420. The last person was unwell on test day.
Step 1:
Without the unwell participant:
r = -0.989 · ρ = -1 · τ = -1
Step 2:
With all eight:
r = 0.295 · ρ = -0.333 · τ = -0.5
Step 3:
Compare the shift:
Pearson moves by 1.28; Spearman by 0.67
Result:
One outlier pulls Pearson's r to 0.29

More sleep clearly goes with faster reactions for seven of the eight people. A single unusual reading flips Pearson's r from strongly negative to weakly positive, while the rank-based measures, though weakened, still point the right way.

Which Correlation Coefficient to Use

Match the measure to your data.

Choosing between Pearson, Spearman and Kendall
SituationBest choice
Measurements with a roughly straight-line patternPearson r
Curved but steadily rising or fallingSpearman ρ
Ranks, ratings or ordered categoriesSpearman ρ or Kendall τ
Small samples with many tiesKendall τ-b
Outliers you can’t justify removingSpearman ρ or Kendall τ

Common Correlation Coefficient Mistakes

  • Comparing τ with r directly. Kendall's τ is usually smaller in size than r or ρ for the same data; a τ of 0.5 is quite strong.
  • Treating zero as "unrelated". All three miss U-shaped relationships.
  • Choosing the coefficient that looks best. Decide which suits the data before calculating, not after.
  • Reading correlation as cause. None of these measures can say which variable drives the other, or whether a third one drives both.

Correlation Coefficient FAQs

What does a correlation of 0.6 mean?

A fairly strong positive relationship: higher values of one tend to go with higher values of the other, with plenty of exceptions.

Why do the three measures differ?

Pearson uses the actual values, so outliers and curves affect it. Spearman and Kendall use only the order, so they don’t.

What is Kendall’s tau measuring?

The difference between the chance two random points are in the same order on both variables and the chance they’re in opposite order.

Can correlation be bigger than 1?

No. Any value outside −1 to 1 means a calculation mistake.

What’s the difference from covariance?

Covariance is in the variables’ units and has no fixed range. Correlation divides out the units so it always sits between −1 and 1.

How many pairs do I need?

At least 3 to calculate, but 20 or more for a reasonably reliable estimate.

Which one does Excel give?

=CORREL gives Pearson’s r. For Spearman, rank both columns with RANK.AVG first; Excel has no built-in Kendall function.

Where can I see the details of each?

The Pearson and Spearman correlation calculators show the significance test, confidence interval and full working for each.

Sources

  • M. G. Kendall, "A new measure of rank correlation", Biometrika 30 (1938) 81–93.
  • M. Hollander, D. A. Wolfe and E. Chicken, Nonparametric Statistical Methods, 3rd edition (Wiley, 2014), chapter 8.
  • OpenStax, Introductory Statistics 2e, section 12.3: the correlation coefficient r.

Related Tools