Correlation Coefficient Calculator

Pearson r, R², p-value and Spearman ρ from two data columns

Separate with commas, spaces or line breaks. You can also paste two columns from Excel or Google Sheets here and leave Y empty.
Same number of values as X, in the same order
Pearson correlation coefficient (r)—
Strength—
R² (coefficient of determination)—
p-value (two-tailed)—
Spearman rank correlation (ρ)—
Pairs / t statistic—
🎰 15 Global Lotteries + 12 Smart Number Pickers
Powerball · Mega Millions · EuroMillions · UK Lotto — Zodiac, Birthday, Dream, AI & more

What the correlation coefficient measures

Pearson's correlation coefficient r measures how closely two variables follow a straight line. It runs from −1 (perfect negative relationship) through 0 (no linear relationship) to +1 (perfect positive relationship). Typical uses: hours studied vs. SAT or exam score, ad spend vs. sales, daily temperature vs. electricity use, or two stocks' daily returns.

Formula and example

r = Σ(x − x̄)(y − ȳ) ÷ √[Σ(x − x̄)² × Σ(y − ȳ)²]. To test whether r differs from zero, t = r√(n − 2) ÷ √(1 − r²) with n − 2 degrees of freedom.

Example: ten students' hours studied (2, 3, 5, 1, 4, 6, 7, 8, 3, 5) and scores (62, 65, 74, 55, 70, 78, 85, 88, 60, 72) give r = 0.9843, R² = 0.9688, t = 15.77 with 8 degrees of freedom, and a p-value far below 0.05 — a very strong positive relationship. Spearman's rank correlation is 0.9756.

How to read r

  • Rough rule of thumb (used in this calculator): |r| ≥ 0.9 very strong, 0.7–0.9 strong, 0.5–0.7 moderate, 0.3–0.5 weak, below 0.3 little or no linear relationship. Fields differ — in social science an r of 0.3 can be meaningful.
  • R² is the share of the variation in Y explained by a straight-line fit on X. An r of 0.5 explains only 25%.
  • Significance depends on sample size: with 1,000 pairs a tiny r can be significant; with 5 pairs even r = 0.8 may not be.

Common pitfalls

  • Correlation is not causation. Ice cream sales and drowning deaths both rise in summer — heat drives both.
  • Outliers can create or hide a correlation. If Pearson and Spearman disagree, plot the data.
  • Non-linear patterns (a U-shape, for example) can have r near 0 even when the relationship is strong.

To fit the line itself and predict Y from X, use the linear regression calculator.

Frequently Asked Questions

What is a good correlation coefficient?
It depends on the field. As a rough guide, |r| above 0.7 is strong and below 0.3 is weak. In physics or engineering you may expect 0.99; in psychology or economics 0.3 can already be important.
What is the difference between Pearson and Spearman correlation?
Pearson measures linear relationships using the actual values. Spearman uses ranks, so it captures any consistently increasing or decreasing relationship and is less sensitive to outliers.
How do I calculate correlation in Excel or Google Sheets?
Use =CORREL(A2:A11,B2:B11) or =PEARSON(...). This calculator gives the same r and also reports R², the p-value and Spearman's ρ.
Is a correlation of 0.5 strong?
It is usually called moderate. It explains 25% of the variation (R² = 0.25). Whether that matters depends on your field and sample size.
Does a significant p-value mean the relationship is important?
No. The p-value only says the correlation is unlikely to be exactly zero. With large samples even trivial correlations are significant — look at r and R² for the size of the effect.

Bookmarks