Correlation Coefficient Calculator
Separate values with commas, spaces or new lines; a spreadsheet column pastes straight in.
Try an example
Pearson correlation
r = 0.7746
A strong positive linear relationship across 5 pairs; r² = 0.6, so 60.0% of the variation in Y is linearly associated with X.
- p-value (two-sided)
- 0.124
- t (3 df)
- 2.121
- 95% CI for r
- -0.34 to 0.984
- Spearman ρ
- 0.7379
Not significant at the 5% level; with 5 pairs a correlation this size can easily arise by chance.
Scatter plot
r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² · Σ(y − ȳ)²). It measures only straight-line association: a perfect U-shape can give r = 0, and correlation alone never shows that one variable causes the other.
Measure how strongly two variables move together in a straight line. Enter paired X and Y values to get Pearson's r, r², a significance test with its p-value, a 95% confidence interval, Spearman's rank correlation and a scatter plot.
Formula
Worked Example
The deviations from the means (x̄ = 3, ȳ = 4) give Σ(x − x̄)(y − ȳ) = 6, Σ(x − x̄)² = 10 and Σ(y − ȳ)² = 6, so r = 6 ÷ √60 = 0.7746: a strong positive relationship. With only five pairs, though, p = 0.124, so a correlation this large could plausibly arise by chance.
Frequently Asked Questions
Does high correlation imply causation?
No. Correlation measures association, not causal direction or mechanism. A third variable can drive both, and the direction of any effect cannot be read from r.
What if the relationship is not a straight line?
Pearson r only measures linear association, so a perfect U-shape can give r = 0. Look at the scatter plot, and compare with Spearman’s rank correlation, which captures any consistently rising or falling pattern.
How many data points do I need?
More than you might think. With 5 pairs, r must exceed about 0.88 to be significant at the 5% level; with 30 pairs about 0.36 is enough. The p-value and confidence interval show how much a given r can be trusted.