Pearson Correlation Coefficient Calculator
Calculate the Pearson correlation coefficient to measure the strength and direction of linear association between two variables. Includes significance testing.
As an Amazon Associate and CJ Affiliate publisher we earn from qualifying purchases. Prices and availability may vary.
Correlation Coefficient Guide
What do I need to know about Pearson r Values?
The Pearson correlation coefficient r ranges from −1 to +1. r = +1: perfect positive linear correlation — as X increases, Y increases proportionally. r = −1: perfect negative linear correlation — as X increases, Y decreases proportionally. r = 0: no linear correlation. Guidelines for interpretation: |r| 0.0–0.2: negligible. 0.2–0.4: weak. 0.4–0.6: moderate. 0.6–0.8: strong. 0.8–1.0: very strong. These thresholds are context-dependent — a correlation of 0.3 may be very meaningful in social science research, where human behaviour is influenced by many factors, while the same value might be considered weak in a controlled physics experiment.
What's the key thing to understand about R-squared and Explained Variance?
R² (coefficient of determination) = r². It represents the proportion of variance in Y that is explained by X. R² = 0.64 means 64% of the variation in Y is explained by its linear relationship with X. The remaining 36% is due to other factors or random variation. Example: r = 0.8 (strong positive correlation) → R² = 0.64. If Y is exam score and X is hours studied: 64% of the variation in exam scores is explained by study time. The other 36% is explained by other factors — prior knowledge, sleep, anxiety, and countless other variables not captured by hours studied alone.
What's the difference between Correlation and Causation?
Correlation does not imply causation — one of the most important statistical principles. Examples of spurious correlations: ice cream sales and drowning rates correlate strongly (both driven by summer/hot weather). Number of Nicolas Cage films and swimming pool drownings correlate (coincidence in a finite dataset). Shoe size and reading ability in primary school (both caused by age). Before concluding causation: check temporal order (cause must precede effect), consider confounding variables, test for them statistically, and ideally look for supporting experimental evidence rather than relying on correlation alone to establish cause and effect.
When NOT to Use Pearson r?
Pearson r measures linear association only. For non-linear relationships (curved, U-shaped), r may be near zero even with a strong non-linear pattern. Check by plotting a scatterplot first. For non-normal data or ordinal data (ranks), use Spearman's rank correlation (rₛ) instead. Outliers heavily influence Pearson r — a single extreme point can change r from near 0 to 0.8. Always check scatterplots before interpreting correlation coefficients. Restricted range: if data is sampled from a narrow range of one variable, the calculated correlation can understate the true relationship across the full range of possible values.
What should I know about Calculating Pearson's r Step by Step?
Pearson's r = Σ[(x−x̄)(y−ȳ)] / √[Σ(x−x̄)²×Σ(y−ȳ)²]. In words: for each data pair, multiply how far x is from its mean by how far y is from its mean, sum those products (the covariance numerator), then divide by the square root of the product of each variable's own sum-of-squared-deviations. If x and y tend to be above their means together and below together, the products are mostly positive, giving r close to +1. If one tends to be above its mean when the other is below, products are mostly negative, giving r close to −1. If there's no consistent pattern, positive and negative products cancel out, giving r near 0. This is why r is scale-independent (changing units of x or y doesn't change r) — both the numerator and denominator scale by the same factor and cancel.
What do I need to know about Outliers and Correlation?
A single extreme outlier can dramatically distort Pearson's r because the formula squares deviations from the mean, giving outliers disproportionate weight. A dataset with a genuinely weak relationship among most points can show a strong apparent correlation purely because one unusual point sits far from both means in a direction that happens to align — or a genuinely strong relationship can be masked by one point pulling in the opposite direction. This is why visualising the data with a scatter plot before trusting a calculated r value is essential practice, rather than relying on the number alone. Robust alternatives like Spearman's rank correlation (which uses ranks instead of raw values) are far less sensitive to outliers and are often preferred when the data contains extreme values or isn't expected to be linearly related in the first place.
What do I need to know about Spearman's Rank Correlation as an Alternative to Pearson's r?
Pearson's correlation coefficient measures linear relationships and assumes the data is roughly normally distributed and free of extreme outliers. Spearman's rank correlation is a more robust alternative that works by first converting each variable's values into ranks (1st, 2nd, 3rd, and so on) and then calculating Pearson's formula on those ranks instead of the raw values. Because it only cares about rank order rather than exact magnitude, Spearman's correlation can detect any consistent monotonic relationship (one variable always increasing as the other increases, even if not in a straight line) and is far less distorted by outliers or skewed data than Pearson's r. It's the preferred choice whenever the relationship between two variables might be real but non-linear, or when the data includes ordinal categories (like satisfaction ratings on a 1-5 scale) rather than precise continuous measurements.
Worked Example: Calculating Pearson's r for a Small Data Set
Five students' hours studied (x) and test scores (y) are: (1, 52), (2, 60), (3, 65), (4, 75), (5, 85). Means: x̄ = (1+2+3+4+5)/5 = 3, ȳ = (52+60+65+75+85)/5 = 337/5 = 67.4. Deviations and products (x−x̄)(y−ȳ): for x=1: (-2)(-15.4)=30.8; x=2: (-1)(-7.4)=7.4; x=3: (0)(-2.4)=0; x=4: (1)(7.6)=7.6; x=5: (2)(17.6)=35.2. Sum = 30.8+7.4+0+7.6+35.2 = 81.0. Sum of (x−x̄)²: 4+1+0+1+4 = 10. Sum of (y−ȳ)²: 15.4²+7.4²+2.4²+7.6²+17.6² = 237.16+54.76+5.76+57.76+309.76 = 665.2. Pearson r = 81.0 / √(10 × 665.2) = 81.0 / √6652 = 81.0 / 81.56 ≈ 0.993. An r this close to 1 indicates an almost perfectly straight-line relationship between hours studied and test score in this small sample, with r² ≈ 0.986 meaning about 98.6% of the variation in scores is associated with variation in study hours.
Interpreting the Size of r: Reference Table
| r | range | Typical interpretation | |
|---|---|---|---|
| 0.00-0.10 | Negligible / effectively no linear relationship | ||
| 0.10-0.30 | Weak | ||
| 0.30-0.50 | Moderate | ||
| 0.50-0.70 | Strong | ||
| 0.70-0.90 | Very strong | ||
| 0.90-1.00 | Near-perfect linear relationship |
These bands are commonly used rules of thumb rather than strict statistical cut-offs — what counts as a 'strong' correlation also depends on the field (a correlation of 0.4 might be considered notably strong in social science data, but weak in a tightly controlled physics measurement).
From r to r²: What the Squared Value Actually Tells You
Squaring the correlation coefficient converts it into r², the coefficient of determination, which has a more concrete interpretation: the proportion of variance in one variable that is statistically associated with variance in the other. The earlier worked example found r ≈ 0.993 between hours studied and test score, so r² ≈ 0.986 — meaning about 98.6% of the variation in test scores in that small sample lines up with variation in study hours, leaving only about 1.4% unaccounted for. Contrast that with a weaker relationship of r = 0.3: r² = 0.09, meaning only 9% of the variance is associated with the other variable and a full 91% is down to other factors entirely. This squared relationship is also why correlation strength doesn't scale in a straight line — dropping from r = 1.0 to r = 0.7 looks like a modest 30% drop in r, but it's actually a drop from 100% to 49% of variance explained, roughly halving the explanatory power.
Sample Size and the Reliability of a Correlation Estimate
A correlation coefficient calculated from a handful of data points is far less trustworthy than the same coefficient calculated from hundreds, even if both produce an identical r value, because small samples are much more easily swayed by a single unusual point. The earlier worked example found r ≈ 0.993 from only 5 students — a striking result, but one that could shift substantially if a 6th student with an unusual combination of study hours and score were added, whereas the same shift in a 500-student sample would barely move the overall r at all. Statisticians address this with a significance test (commonly a t-test on the correlation) and by reporting a confidence interval around r rather than treating the single calculated value as exact — as a rough rule of thumb, a correlation needs to be noticeably larger to be considered statistically meaningful in a small sample than in a large one, which is why a 'strong' correlation reported from a tiny pilot study should generally be treated as a hypothesis to test further rather than a settled finding.