Free Correlation Coefficient Calculator
Paste two equal-length lists of numbers (X and Y) to instantly compute the Pearson correlation coefficient r, the pair count n, and a plain-English reading of how strongly the two variables move together.
Enter two equal-length lists of numbers separated by commas, spaces, or new lines.
Strong positive correlation
r ranges from −1 to +1. The sign shows direction; the magnitude shows strength. r² is the share of variance the two variables share.
Quick answer
The Pearson correlation coefficient r measures the linear relationship between two variables and is computed as r = Σ((x−x̄)(y−ȳ)) / √(Σ(x−x̄)²·Σ(y−ȳ)²). It always falls between −1 (perfect negative) and +1 (perfect positive), with 0 meaning no linear relationship. For X = 1,2,3,4,5 and Y = 2,4,5,4,5 the numerator is 6 and the denominator is √(10·6) = 7.7460, so r ≈ 0.7746 — a strong positive correlation.
Formula & method
Pearson correlation coefficient
r = Σ((x − x̄)(y − ȳ)) / √( Σ(x − x̄)² · Σ(y − ȳ)² )
- r — Pearson correlation coefficient, ranging from −1 to +1
- x, y — Paired data values from the two lists
- x̄, ȳ — Arithmetic means of the X and Y lists
- Σ — Sum taken over all n paired observations
- n — Number of (x, y) pairs; both lists must have the same count
The numerator Σ((x−x̄)(y−ȳ)) is the sum of products of deviations (covariance × n). Dividing by the product of the two standard-deviation-like roots rescales it to the fixed −1…+1 range, so r is unitless and unaffected by the scale of X or Y.
Examples
- Input
- X = 1, 2, 3, 4, 5 Y = 2, 4, 5, 4, 5
- Result
- r ≈ 0.7746 (n = 5)
- Why
- Means are x̄ = 3 and ȳ = 4. Deviation products: (−2)(−2)+(−1)(0)+(0)(1)+(1)(0)+(2)(1) = 4+0+0+0+2 = 6. Σ(x−x̄)² = 4+1+0+1+4 = 10 and Σ(y−ȳ)² = 4+0+1+0+1 = 6, so denominator = √(10·6) = √60 = 7.7460. r = 6 / 7.7460 = 0.7746.
- Input
- X = 1, 2, 3, 4 Y = 2, 4, 6, 8
- Result
- r = 1 (n = 4)
- Why
- Every Y value is exactly 2×X, so the points lie on a straight rising line. The numerator equals √(Σ(x−x̄)²·Σ(y−ȳ)²) exactly, giving r = 1. A correlation of +1 means a perfect positive linear relationship; note it does not require Y = X, only a constant positive ratio plus offset.
- Input
- X = 1, 2, 3, 4, 5 Y = 10, 8, 6, 4, 2
- Result
- r = −1 (n = 5)
- Why
- As X rises by 1, Y falls by 2 every time, so the points lie on a straight descending line. The deviation products are all negative and the magnitudes match the denominator exactly, giving r = −1, the strongest possible negative linear relationship.
- Input
- X = 1, 2, 3, 4, 5 Y = 5, 3, 8, 2, 6
- Result
- r ≈ 0.0662 (n = 5)
- Why
- Means are x̄ = 3 and ȳ = 4.8. The sum of deviation products is just 1, while Σ(x−x̄)² = 10 and Σ(y−ȳ)² = 22.8, so r = 1 / √(10·22.8) = 1 / 15.0997 = 0.0662. A value this close to 0 indicates essentially no linear relationship between X and Y.
When to use this tool
- When you have two columns of paired measurements (e.g. hours studied vs. exam score) and want a single number for how strongly they move together.
- When checking whether two financial, scientific, or survey variables have a positive, negative, or negligible linear association before deeper modeling.
- When you need the input to other statistics such as r² (coefficient of determination) or the slope of a simple linear regression line.
- When teaching or learning statistics and you want to see the means, deviation sums, and final r worked out for a small dataset.
Common mistakes
- Submitting lists of different lengths. Pearson r needs paired observations, so X and Y must contain exactly the same number of values — the calculator flags a mismatch instead of guessing.
- Reading r as a percentage or as the slope of a line. r is a unitless index of linear strength and direction; the proportion of variance explained is r² (e.g. r = 0.77 → r² ≈ 0.60, or 60%), not r itself.
- Concluding causation from a high r. Correlation only describes how two variables move together; a confounding variable or pure coincidence can produce a strong r with no causal link.
- Trusting r when the true relationship is curved. Pearson r measures only the linear component, so a strong U-shaped or exponential pattern can still return an r near 0.
Frequently asked questions
What does the correlation coefficient r actually measure?
Pearson's r measures the strength and direction of the linear relationship between two variables. It runs from −1 (perfect downward line) through 0 (no linear relationship) to +1 (perfect upward line). The sign tells you direction and the magnitude tells you strength.
What is considered a strong correlation?
A common rule of thumb: |r| ≥ 0.7 is strong, 0.4–0.7 is moderate, 0.2–0.4 is weak, and below 0.2 is very weak or negligible. These thresholds are conventions, not hard cutoffs — what counts as 'strong' depends on your field and sample size.
Why do both lists need the same number of values?
Each term in the formula pairs one x with one y as a single observation. If X has 6 numbers and Y has 5, the pairs cannot be formed, so r is undefined. This calculator detects unequal counts and asks you to fix the lists before computing.
What is the difference between r and r²?
r is the correlation coefficient (−1 to 1). r² (the coefficient of determination) is r squared (0 to 1) and represents the proportion of variance in one variable explained by the other. For example, r = 0.7746 gives r² ≈ 0.60, meaning about 60% of the variation is shared.
Does a high correlation mean one variable causes the other?
No. Correlation is not causation. A strong r can arise from one variable driving the other, from a third hidden variable affecting both, or from coincidence. Establishing causation requires controlled experiments or careful causal analysis, not r alone.
Can the correlation coefficient be greater than 1 or less than −1?
No. By construction r is bounded to the interval [−1, 1]. If you ever compute a value outside that range, it signals an arithmetic error — typically a mismatched pair, a wrong mean, or a sign mistake in the deviation products.
Sources & references
- Wikipedia — Pearson correlation coefficient
- NIST/SEMATECH e-Handbook of Statistical Methods — Correlation
External references open in a new tab. We are independent and not affiliated with these organizations.
- ✓ Free to use
- ✓ No sign-up required
- ✓ Runs entirely in your browser — nothing is uploaded.
- ✓ Formula and method shown above
Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.
Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.
Related tools
- Standard Deviation CalculatorCalculators
- Z-Score CalculatorCalculators
- Average CalculatorCalculators
- Mean Median Mode CalculatorCalculators
- Confidence Interval CalculatorCalculators
Embed this tool on your site
Free to embed, no sign-up. Paste this code where you want the correlation coefficient calculator to appear: