Enter your paired data to get Pearson's r, the proportion of variance it explains, and whether a correlation that size could plausibly have arisen by chance. Spearman's rho is reported alongside, so a curved or outlier-driven relationship shows itself immediately.
| x | y | Remove |
|---|---|---|
One row per paired observation — the two measurements taken on the same subject, day or unit. Order matters only in that x and y must line up.
Show the working, step by step
The formula
Pearson's r is the covariance of the two variables divided by the product of their standard deviations:
r = Σ(x − x̄)(y − ȳ) ÷ √[ Σ(x − x̄)² × Σ(y − ȳ)² ]
The numerator is the engine. For each point it multiplies the two deviations from the means: a point above average on both variables contributes a positive product, as does one below average on both. A point above on x but below on y contributes a negative one. Add them up and the sign tells you which pattern dominates.
The denominator is what makes r comparable across datasets. Dividing by both spreads strips out the units entirely, which is why r is confined to the range −1 to +1 whether you are correlating millimetres with kilograms or dollars with years.
Reading the number
| r | r² | Reading |
|---|---|---|
| ±0.9 to ±1.0 | 81–100% | Very strong — points cluster tightly on a line |
| ±0.7 to ±0.9 | 49–81% | Strong |
| ±0.5 to ±0.7 | 25–49% | Moderate |
| ±0.3 to ±0.5 | 9–25% | Weak |
| 0 to ±0.3 | 0–9% | Negligible |
Notice how quickly r² falls away. A correlation of 0.5 sounds like "half", but it explains only a quarter of the variation. Quoting r² alongside r is the fastest way to keep a result honest.
Significance: could this have happened by chance?
A small sample can produce a large r from nothing at all. Three random points will often look strongly correlated. The test converts r into a t statistic:
t = r√(n − 2) ÷ √(1 − r²), with df = n − 2
The p value that follows is the probability of seeing a correlation at least this strong if the
two variables were genuinely unrelated. Note the n in the formula: the same r
becomes more convincing as the sample grows. An r of 0.5 is not significant at n = 10 and
comfortably significant at n = 100.
The calculator also reports a 95% confidence interval for r, built by Fisher's z transformation. It is usually the more useful output — it shows the range of correlations consistent with your data, which a bare "significant" or "not significant" never does.
The four traps
- Causation. r says two things move together. It never says which one moves the other, or whether something else moves both.
- Curvature. r only measures straight-line association. A strong curved relationship can produce an r near zero. Compare it with Spearman's rho and look at the plot.
- Outliers. A single distant point can create a strong correlation out of an unrelated cloud, or destroy a real one. Anscombe's quartet is the classic demonstration: four datasets with the same r of 0.816 and utterly different shapes.
- Restricted range. Correlating exam scores among admitted students only will understate the true relationship, because the low scores were filtered out before you measured anything.
Correlation and the standard deviation
The link is direct. Standardise both variables — convert every value to a z-score by subtracting the mean and dividing by the standard deviation — and r is simply the average product of the paired z-scores. That is why r has no units, and why it cannot escape the range −1 to +1: it is a correlation of two quantities that have each already been scaled to a standard deviation of 1.
Common questions
What is the correlation coefficient?
Pearson's r measures how closely two variables move together in a straight line. It runs from −1 to +1. At +1 every point sits exactly on an upward line; at −1 every point sits on a downward one; at 0 there is no linear relationship at all.
The sign is the direction and the magnitude is the strength. An r of −0.8 is exactly as strong as an r of +0.8 — it just points the other way.
What counts as a strong correlation?
The conventional bands are roughly: below 0.3 negligible, 0.3–0.5 weak, 0.5–0.7 moderate, 0.7–0.9 strong, above 0.9 very strong. They are rules of thumb, not law — what counts as strong depends entirely on the field. An r of 0.4 is a major finding in psychology and a broken instrument in physics.
What is r² and how is it different from r?
r² is simply r squared, and it has a cleaner interpretation: the proportion of the variation in one variable that is accounted for by the other. An r of 0.7 gives r² = 0.49, so 49% of the variance is explained and 51% is not.
Because squaring shrinks values below 1, r² is always less impressive than r. That is a feature — it is the more honest of the two numbers.
Does correlation prove causation?
No, and this is the most important caveat in the whole subject. A correlation between x and y is equally consistent with x causing y, y causing x, or some third variable driving both. Ice cream sales correlate with drownings because both rise in summer.
Establishing causation needs a controlled experiment, or careful design that rules out the alternatives. No amount of correlation, however strong, does it on its own.
What is the difference between Pearson and Spearman correlation?
Pearson's r measures linear association and uses the actual values. Spearman's rho measures monotonic association — whether y consistently rises or falls as x rises — and uses only the ranks.
This calculator reports both. When they are close, the relationship is roughly linear. When Spearman is much higher, the relationship is real but curved. When Pearson is much higher, an outlier is probably inflating it.
Can a correlation of zero mean the variables are unrelated?
Not necessarily. r only detects straight-line association. Points forming a perfect symmetric U have an r of about 0, yet y is entirely determined by x. This is why the scatter plot matters — always look at it before trusting a single number.
Related calculators
-
Linear regression calculator
The line through the points, and predictions from it.
-
Standard deviation calculator
The spread that r scales the covariance by.
-
P-value calculator
Convert a test statistic into a p value.
-
Z-score calculator
Standardise a value — the building block of r.