Skip to content
Calc.

Correlation Coefficient Calculator

Paste paired X and Y values to get Pearson's correlation coefficient r, with r², the number of pairs and the p-value for testing whether the correlation differs from zero.

Last updated: October 2026

Pearson Correlation (r)

0.991

Formula below · 2 sources (ncbi.nlm.nih.gov, itl.nist.gov) · Updated Oct 2026

Compare with similar

About this calculator

Pearson's correlation coefficient r measures how closely paired values follow a straight line:

r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² × Σ(y − ȳ)²)

It runs from −1 (a perfect downward line) through 0 (no linear relationship) to +1 (a perfect upward line). The calculator centres both lists on their means before multiplying, which avoids the rounding trouble of the n·Σxy − Σx·Σy shortcut.

r² and the p-value

r² is the share of the variation in Y that a straight-line fit on X accounts for: r = 0.8 means r² = 0.64. To test whether the correlation in your sample could be chance, the calculator uses t = r√((n − 2) ÷ (1 − r²)) with n − 2 degrees of freedom and reports the two-tailed p-value. That test assumes the pairs are independent and roughly bivariate normal.

What r does not tell you

r only measures linear association: a strong curve can give r near 0. A single outlier can create or hide a correlation, so look at a scatter plot. Restricting the range of X weakens r. And correlation is not causation: a third variable, reverse causation or coincidence can all produce it. For ranked or clearly non-linear but monotonic data, use Spearman's rank correlation.

How to use

Enter the X values and the Y values in the same order (the first X goes with the first Y), separated by commas or spaces. Example 1 (defaults): hours studied 2, 3, 5, 6, 8, 9 and exam scores 65, 70, 74, 80, 85, 91. Means 5.5 and 77.5; Σ(x − x̄)(y − ȳ) = 131.5, Σ(x − x̄)² = 37.5, Σ(y − ȳ)² = 469.5. r = 131.5 ÷ √(37.5 × 469.5) ≈ 0.9910, r² ≈ 0.98, p < 0.001. Example 2: X = 1, 2, 3 and Y = 2, 4, 5 gives r ≈ 0.982 (p ≈ 0.12 with only 3 pairs: a high r from very few points is weak evidence). Example 3: X = 1, 2, 3, 4, 5 and Y = 60, 50, 40, 30, 20 gives r = −1, a perfect inverse line.

Frequently asked questions

How strong does a correlation need to be to "matter"?

There is no universal threshold — context dominates. Rough conventions: |r| > 0.7 is often called strong, 0.4–0.7 moderate, and below 0.4 weak. But these are field-dependent. In physics or engineering, where measurements are precise and the underlying relationship is deterministic, you would expect |r| above 0.95 for a "real" relationship; anything below should make you suspicious. In social sciences and behavioural research, r values of 0.3–0.5 are routinely treated as meaningful because the underlying phenomena are noisy. r² is often the more practical statistic: r = 0.5 means r² = 0.25, so X explains only a quarter of the variation in Y — most of what is happening to Y is driven by something else. Always report sample size and ideally a confidence interval for r, because small samples can produce dramatic-looking correlations purely by chance.

Does correlation imply causation?

No, and this is the most repeated warning in statistics for good reason. A non-zero r tells you only that two variables move together linearly in your sample; it does not say one causes the other. There are four common alternative explanations to keep in mind. (1) Reverse causation: maybe Y causes X, not the other way around. (2) Confounding: a third variable Z drives both X and Y, producing a spurious correlation between them. (3) Selection bias: the sample over-represents pairs where X and Y happen to align. (4) Coincidence: with enough variables and small enough samples, some correlations are random noise. Establishing causation requires controlled experiments (randomised assignment), natural experiments, instrumental variables, or rigorous causal-inference techniques (DAGs, propensity scores). Correlation is a useful first clue, never a conclusion.

When should I use Pearson r vs Spearman ρ vs Kendall τ?

Use Pearson r when both variables are continuous, approximately normally distributed, and the relationship is genuinely linear. Use Spearman's rank correlation (ρ) when the relationship is monotonic but not linear (Y consistently increases with X but not in a straight line), or when your data contains influential outliers — Spearman operates on ranks rather than raw values and is therefore robust. Use Kendall's tau when sample size is small (n < 20), when there are many tied ranks, or when you want a more conservative measure of association (Kendall typically gives smaller numbers than Spearman on the same data). All three measure association; only Pearson assumes linearity. If a scatter plot shows a clear curve, Pearson will understate the true strength of the relationship — switch to Spearman or fit a non-linear model.

What are the most common mistakes people make computing or interpreting correlation?

The first is reporting r without ever looking at the scatter plot — Anscombe's quartet famously shows four data sets with identical r ≈ 0.82 but completely different shapes (one linear, one curved, one with a single huge outlier, one with all but one point identical). The second is conflating r with r²; r = 0.4 sounds substantial but r² = 0.16 means X explains only 16% of Y's variance, which is often unimpressive. The third is treating r as causal evidence — covered above. The fourth is failing to spot outlier-driven correlations: a single extreme point can push r from 0.0 to 0.6 with no real relationship in the bulk of the data, or hide a strong relationship in the bulk. The fifth is computing r on truncated data (restricting range on X) and concluding "no relationship" because r drops sharply — range restriction always attenuates r even when the underlying relationship is strong.

Related calculators

Sources & references

How we check our calculators

Think a result is wrong? Report a problem with this calculator.