Calculate Pearson and Spearman correlation coefficients, R², covariance, significance testing, z-scores, and ranks from X/Y data. Full statistical analysis.
The correlation calculator compares how two variables move together using both Pearson and Spearman methods. Pearson measures linear association on raw values, while Spearman measures monotonic association on ranked values, which is useful when the relationship is consistent but not perfectly straight.
Enter paired X and Y data to get Pearson r, Spearman ρ, R², covariance, a significance test, and a table of ranks and z-scores. That gives you both the coefficient and the context needed to judge whether the relationship is linear, monotonic, or weak.
Preset datasets cover common positive, negative, and near-zero cases so you can see how the two methods behave on the same input.
Correlation is the quickest way to test whether two variables move together in a way that is worth modeling. Seeing Pearson and Spearman side by side helps distinguish a straight-line relationship from one that only has a consistent direction.
The covariance, R², significance test, and ranked data table make the result easier to interpret than a bare coefficient on its own.
Pearson r = Σ(xᵢ−x̄)(yᵢ−ȳ) / √[Σ(xᵢ−x̄)²·Σ(yᵢ−ȳ)²]. Spearman ρ = 1 − 6·Σdᵢ²/(n(n²−1)). t = r·√(n−2)/√(1−r²), df = n−2.
Result: Pearson r = 0.9997, Spearman ρ = 1.0, R² = 0.9994, p < 0.05 (significant)
Near-perfect positive linear correlation. 99.94% of Y's variance is shared with X. The monotonic Spearman correlation is perfect because as X increases, Y always increases.
Pearson is the default choice for continuous data expected to have a linear relationship. It's sensitive to outliers and assumes both variables are approximately normally distributed. The formula measures how closely data points fall to a straight line.
Spearman first converts values to ranks, then computes Pearson's r on the ranks. This makes it robust to outliers (extreme values just get the highest rank) and detects any monotonic relationship, not just linear ones. It's also appropriate for ordinal data (Likert scales, rankings).
Statistical significance (p < 0.05) tells you the correlation is probably not zero — it says nothing about practical importance. With n=10,000, even r=0.02 (trivially small) is significant. With n=5, even r=0.80 might not be significant. Always report AND interpret both the correlation magnitude and significance.
Ecological fallacy: country-level data shows r=0.90 between variable A and B, but individual-level data shows r=0.10. Aggregated data inflates correlations. Simpson's paradox: subgroup correlations can reverse the overall correlation. Restriction of range: measuring height-weight correlation only in basketball players gives much lower r than in the general population.
Last updated:
Pearson measures linear relationships (Y = aX + b). Spearman measures any monotonic relationship (Y consistently increases or decreases with X, even nonlinearly). If your data is ordinal (ranks) or has outliers, prefer Spearman.
The t-test checks whether the observed correlation could have occurred by chance from uncorrelated data. "Significant at p < 0.05" means there's less than a 5% chance of seeing this correlation in truly uncorrelated data.
No. Correlation measures association, not causation. Two variables can move together because of a third factor, timing, or coincidence rather than a direct causal link.
R² gives the proportion of shared variance: R²=0.81 means 81% of Y's variation is "explained" by X. It's directly interpretable as a percentage, while r requires squaring for that interpretation.
Our calculator uses average ranks for ties. If values 3, 3, 5 would have ranks 1, 2, 3, the tied values both get rank 1.5 (average of ranks 1 and 2).
Minimum 10 for rough estimates. 30+ for reliable significance testing. With 3-5 points, even random data can show r > 0.8, so small samples are unreliable.