How to use it
- Type one pair per line in Pairs x, y: the x value, then the y value.
- Check that each line holds two numbers and that there are at least three lines.
- Read Pearson correlation r and p-value of r, then Spearman correlation ρ and p-value of ρ.
- Check The pairs and their ranks and How it is worked out.
Pearson's r and Spearman's ρ
Pearson's r measures how closely the points lie on a straight line: it is the covariance of x and y divided by the product of their standard deviations. It runs from -1 for a perfect falling line, through 0 for no linear relation, to 1 for a perfect rising line.
Spearman's ρ replaces each value by its rank and then computes Pearson's r of the ranks. It measures any consistent rising or falling pattern, not only a straight line, and it is less affected by outliers. Tied values share the average of their ranks.
r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² Σ(y − ȳ)²)
ρ = r of the ranks; without ties, ρ = 1 − 6Σd² ÷ (n(n² − 1))
t = r √((n − 2) ÷ (1 − r²)), with n − 2 degrees of freedom
Significance and the p-value
The t test asks whether a correlation found in the sample could be zero in the population. The p-value is the probability of a correlation at least as far from zero as the one found, if the true correlation were zero. A small p-value shows that the relation is unlikely to be chance; it does not show how strong or how important the relation is.
The test assumes that the pairs are independent. For Spearman's ρ the t test is an approximation, exact for large samples; with fewer than about ten pairs, read the p-value with care.
What the calculator does not cover
- Correlation is not causation: a strong r shows that two quantities move together, not which one causes the other.
- Regression lines and predictions. For a line through the points, use the linear regression calculator.
- Correlations for more than two variables, for groups of pairs that are not independent, or for categories rather than measurements.
Worked example: IQ and hours of television
For ten people (IQ and television hours, from Wikipedia's example), Pearson's r is -0.0376 with a two-tailed p-value of 0.9179, and Spearman's ρ is -0.1758, exactly -29/165, with a p-value of 0.6272. Neither correlation is significant at 5%.
| x | y | Rank of x | Rank of y | Difference |
|---|---|---|---|---|
| 106 | 7 | 7.0 | 3.0 | 4.0 |
| 86 | 0 | 1.0 | 1.0 | 0.0 |
| 100 | 27 | 4.0 | 7.0 | -3.0 |
Frequently asked questions
What is the difference between Pearson's r and Spearman's ρ?
Pearson's r measures a straight-line relation between the values, so a curve that always rises can give a lower r. Spearman's ρ works on the ranks and measures any steadily rising or falling relation, and it is less affected by extreme values.
What does a correlation of 0 mean?
It means there is no linear relation between x and y in these data. A correlation near 0 does not exclude a curved or other pattern, so look at the points as well.
How many pairs do I need?
The calculator needs at least three. With only a few pairs even a large correlation can have a large p-value, so collect more data before concluding anything.
Why is the p-value sometimes exactly 0?
When every point lies exactly on a line, r is 1 or -1 and the t value is infinite, so the p-value is 0. Real data rarely give this.
Do I have to paste the pairs in the same order?
Yes. Each line must pair the x value with the y value of the same case. The order of the lines does not matter for the result.
Does the calculator send my data anywhere?
No. The calculation runs in your browser, and nothing you type is sent to our servers.
Sources
- Wikipedia: Spearman's rank correlation coefficient
- Wikipedia: Pearson correlation coefficient
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.6.7.2: Critical values of the Student's t distribution
Figures and text last checked on Tuesday, November 10, 2026.