Correlation Coefficient Calculator
Free Pearson correlation coefficient calculator: paste paired x/y data and get r, R², the significance test (t, p-value), and a plain-language strength label.
Correlation Coefficient Calculator
Background.
The Quanta correlation coefficient calculator takes two comma-separated lists of paired numbers — an X list and a Y list, matched up index-for-index — and returns the Pearson correlation coefficient r, the coefficient of determination R², a two-tailed significance test (a t-statistic and its p-value), the degrees of freedom, the sample size, and a plain-language strength-and-direction label such as ‘very strong positive correlation’. Enter the default example — X = 1, 2, 3, 4, 5 and Y = 2, 3, 5, 4, 6 — and the calculator returns r = 0.90 exactly, R² = 0.81, t ≈ 3.576 on 3 degrees of freedom, and p ≈ 0.037, meaning the association is unlikely to be pure chance at the conventional 0.05 threshold.
Pearson's r, formalized by Karl Pearson in 1896 (building on Francis Galton's earlier work on regression toward the mean), is the single most widely reported statistic for describing how strongly two continuous variables move together in a straight-line sense. It answers one specific question: as X goes up, does Y tend to go up too (positive r), tend to go down (negative r), or show no consistent straight-line pattern at all (r near zero)? The value is always bounded between −1 and +1 by the Cauchy-Schwarz inequality, which is what makes r comparable across wildly different units — the correlation between height in centimetres and weight in kilograms uses the identical scale as the correlation between rainfall in millimetres and crop yield in tonnes.
The single most common mistake with correlation is treating a high r as proof of causation. A classic example: ice cream sales and drowning deaths are strongly positively correlated across the calendar year, not because ice cream causes drowning but because both are driven by a third variable, hot weather, that pushes people toward both ice cream stands and swimming pools simultaneously. Statisticians call this confounding, and no correlation coefficient, however large, can rule it out on its own — only a controlled experiment or a carefully designed observational study that accounts for the confounder can establish causation. A second common mistake is assuming r = 0 means 'no relationship' when it actually means no *linear* relationship; two variables related by a perfect U-shaped curve (like temperature and heating-plus-cooling cost) can have a Pearson r very close to zero while being deterministically connected. Anscombe's quartet, a famous 1973 dataset, drives this home: four wildly different-looking scatter plots — one linear, one curved, one with a single dominant outlier, one with a vertical cluster plus one outlier — all produce the exact same Pearson r, mean, and variance, which is why every statistics course now insists on plotting the data before trusting the number.
The significance test this calculator runs — converting r into a t-statistic on n−2 degrees of freedom and reading off a two-tailed p-value — answers a narrower, complementary question: assuming there is truly no linear relationship in the underlying population (the null hypothesis ρ = 0), how surprising would a sample correlation this large be, purely from random sampling noise? A small p-value (conventionally below 0.05) means an r this extreme would be unlikely under the null, so you can be reasonably confident the association reflects something real rather than sampling coincidence. But statistical significance is not the same thing as practical importance: with a large enough sample, even a tiny, practically meaningless r (say 0.05) can become 'statistically significant', while with a small sample a genuinely large r can fail to clear the significance bar simply because there was not enough data to rule out chance. This calculator reports both r and p side by side for exactly that reason — read the effect size (r, R²) for how strong the relationship is, and the p-value for how confident you can be that it is not noise.
Because the underlying arithmetic (means, sums of squared deviations, and their cross-product) is exactly the machinery behind sample variance and standard deviation, this calculator sits naturally alongside Quanta's standard deviation, z-score, and p-value tools — use those to understand the spread of each variable on its own, and this one to understand how the two variables move together.
What is correlation coefficient calculator?
The Pearson correlation coefficient, denoted r, measures the strength and direction of the linear relationship between two paired numeric variables. It is defined as r = Sxy / (√Sxx · √Syy), where Sxy = Σ(xi − x̄)(yi − ȳ) is the sum of cross-products of deviations from each variable's mean, and Sxx and Syy are the corresponding sums of squared deviations — the same quantities that define each variable's own variance. Dividing the cross-product sum by the geometric mean of the two variance-like sums normalizes r so it is always between −1 and +1, regardless of the original units or scale of X and Y. r = +1 means every point lies exactly on a line with positive slope; r = −1 means every point lies exactly on a line with negative slope; r = 0 means there is no linear association (though a strong non-linear relationship can still exist). Squaring r gives the coefficient of determination R², interpreted as the proportion of variance in one variable that is statistically associated with the other — an r of 0.9 corresponds to an R² of 0.81, meaning 81% of the variability in Y lines up with variability in X in a linear sense. Testing whether an observed r is significantly different from zero uses the test statistic t = r·√((n−2)/(1−r²)), which follows a Student t-distribution with n−2 degrees of freedom under the null hypothesis that the true population correlation ρ is zero (OpenStax, Introductory Statistics 2e, §12.4). A two-tailed p-value from that t-distribution then measures how likely a correlation this extreme would be to arise from an uncorrelated population purely by sampling chance.
How to use this calculator.
- Enter your X values as a comma-separated list in the first box.
- Enter your Y values as a comma-separated list in the second box, in the same order — the first Y value is paired with the first X value, and so on. Both lists must be the same length, with at least 3 pairs.
- Read the primary result, Pearson's r, and its plain-language strength label directly beneath it.
- Check R² to see the practical size of the association (the share of variance the two variables share), separately from the p-value, which tells you how confident you can be that the association is not random noise.
- If the p-value is above 0.05 (or whatever threshold your field uses), treat the correlation as not statistically distinguishable from zero, even if r itself looks moderately large — this is common with small sample sizes.
- Remember that correlation does not imply causation: a high r can arise from a genuine causal link, a confounding third variable, reverse causation, or pure coincidence in small samples. Use domain knowledge or a controlled experiment to distinguish between them.
- Always look at a scatter plot of your data alongside the numeric result — Anscombe's quartet shows that very different-looking data patterns, including clearly non-linear ones, can share the exact same r.
The formula.
The calculator first computes the mean of the X list and the mean of the Y list. It then computes three sums across all n pairs: Sxy, the sum of the products of each point's deviation from its own mean (Σ(xi−x̄)(yi−ȳ)); Sxx, the sum of squared X deviations; and Syy, the sum of squared Y deviations. Pearson's r is Sxy divided by the square root of the product SxxSyy (NIST Dataplot reference manual). This is exactly the covariance of X and Y, normalized by the product of their standard deviations — which is why r is dimensionless and bounded in [−1, 1] by the Cauchy-Schwarz inequality applied to the deviation vectors.
Squaring r gives R², the coefficient of determination, interpreted in simple linear regression as the fraction of the total variance in Y explained by a straight-line fit against X.
The significance test converts r into a t-statistic, t = r·√((n−2)/(1−r²)), which under the null hypothesis ρ = 0 follows a Student t-distribution with n−2 degrees of freedom (OpenStax, Introductory Statistics 2e, §12.4). The calculator evaluates the two-tailed p-value from that distribution using the regularized incomplete beta function, the same numerically stable machinery used by Quanta's p-value and confidence-interval calculators. When |r| is 1 (every point falls exactly on a line), 1−r² is zero and t is mathematically infinite; rather than surface a non-finite result, the calculator reports a large finite sentinel (±1 × 10³⁸) for t and exactly 0 for the p-value, since a perfect linear fit is as statistically extreme as it gets.
The plain-language strength label anchors on Cohen's (1988) widely used effect-size benchmarks for |r|: approximately 0.10 is a 'small' effect, 0.30 a 'medium' effect, and 0.50 a 'large' effect. This calculator extends that scale into six descriptive bands — negligible (< 0.10), weak (0.10–0.30), moderate (0.30–0.50), strong (0.50–0.70), very strong (0.70–1.00), and perfect (exactly ±1) — purely as a reading aid; the underlying r and p-value are always the numbers that should drive any actual decision.
A worked example.
A small business tracks weekly ad spend, in hundreds of dollars (X = 1, 2, 3, 4, 5), against weekly units sold, in dozens (Y = 2, 3, 5, 4, 6), over five weeks. The mean ad spend is 3 and the mean units sold is 4. Computing each week's deviation from those means and multiplying paired deviations together (−2×−2, −1×−1, 0×1, 1×0, 2×2) gives a cross-product sum Sxy of 4+1+0+0+4 = 9. The sum of squared X deviations Sxx is 4+1+0+1+4 = 10, and the sum of squared Y deviations Syy is also 4+1+1+0+4 = 10. Pearson's r is therefore 9 divided by the square root of (10 × 10), which is 9/10 = 0.90 exactly — a very strong positive correlation. Squaring gives R² = 0.81, meaning 81% of the week-to-week variation in units sold lines up with variation in ad spend in a linear sense. Testing significance with n = 5 (df = 3): t = 0.90 × √(3 / (1 − 0.81)) = 0.90 × √(3/0.19) ≈ 3.576, which produces a two-tailed p-value of about 0.037 — below the conventional 0.05 threshold, so the business can be reasonably (though not certainly, with only 5 data points) confident that more ad spend really is associated with more sales, rather than the pattern being a coincidence of a short observation window.
Frequently asked questions.
Does a strong correlation mean X causes Y?
What is the difference between r and R²?
Why does this calculator require at least 3 pairs of data?
What does the p-value tell me that r doesn't?
Why can two completely different-looking scatter plots have the same r?
Can r detect a non-linear relationship?
What counts as a 'strong' correlation?
How is this different from Quanta's standard deviation and z-score calculators?
References& sources.
- [1]NIST Dataplot Reference Manual, ‘CORRELATION’ command — defines the Pearson correlation coefficient r = Sxy / (√Sxx · √Syy).
- [2]OpenStax, Introductory Statistics 2e (2023), §12.4 ‘Testing the Significance of the Correlation Coefficient’ — gives the test statistic t = r·√((n−2)/(1−r²)) with n−2 degrees of freedom.
- [3]Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences, 2nd ed. Hillsdale, NJ: Lawrence Erlbaum Associates — effect-size benchmarks for correlation (small ≈ .10, medium ≈ .30, large ≈ .50).
- [4]NIST/SEMATECH e-Handbook of Statistical Methods.
- [5]Anscombe, F.J. (1973). ‘Graphs in Statistical Analysis.’ The American Statistician, 27(1), 17–21 — the original ‘Anscombe's quartet’ demonstration that identical summary statistics, including r, can describe visually very different datasets.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 313 calculators remain free
- No billing is enabled