Correlation Coefficient Calculator (Pearson and Spearman)
Find the correlation between two sets of values, with the p-value and strength.
Pearson and Spearman correlation
- Pearson’s r measures the strength of a straight-line relationship between two numeric variables, from −1 (perfect negative) to +1 (perfect positive). 0 means no linear relationship.
- Spearman’s ρ uses the ranks of the values, so it measures any steadily increasing or decreasing relationship and is less affected by outliers. Use it for ordinal data or skewed data.
Enter your x values and your y values, one pair per position, separated by spaces, commas or new lines.
Worked example
Ten students sat two related tests. Their scores (x = 65, 70, 72, … and y = 55, 62, 66, …) have Pearson’s r = 0.996, r² = 0.992, p < .001. That is a very strong positive correlation, and about 99% of the variation in y is shared with x. The Spearman tab’s example (x = 86, 97, 99, … and y = 2, 20, 28, …) gives ρ = -0.176, p = .627, which is a weak and not significant relationship.
| |r| | Strength |
|---|---|
| Below 0.1 | Negligible |
| 0.1 to 0.3 | Weak |
| 0.3 to 0.5 | Moderate |
| 0.5 to 0.7 | Strong |
| 0.7 and above | Very strong |
Formula
r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² × Σ(y − ȳ)²). The significance test uses t = r × √(n − 2) ÷ √(1 − r²) with n − 2 degrees of freedom.
Cautions
- Correlation is not causation. Two variables can move together because of a third factor.
- Pearson’s r only captures straight-line relationships. Always look at a scatter plot.
- A single outlier can change r a lot. Check with Spearman’s ρ.
To fit a line and predict y from x, use the linear regression calculator.
How to cite this page
CalcPulse. (2026). Correlation Coefficient Calculator. https://calcpulse.com/correlation-coefficient-calculator/
Frequently asked questions
What is a correlation coefficient?
A number from −1 to +1 that describes how closely two variables move together. Pearson's r measures straight-line relationships.
What is the difference between Pearson and Spearman?
Pearson uses the actual values and measures linear association. Spearman uses ranks and measures any steady, monotonic relationship, so it suits ordinal or skewed data.
What is a good correlation?
It depends on the field. Above 0.5 is usually called strong, but in some sciences even 0.3 is meaningful.
Does correlation prove causation?
No. A correlation can come from a common cause or from chance.
What does r squared mean?
The proportion of the variation in one variable that is shared with the other. An r of 0.8 gives r² = 0.64.
Last updated