# Correlation Coefficient Calculator

URL: https://hifreetools.com/calculators/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.

## 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

- Pearson correlation coefficient: r = Σ((x − x̄)(y − ȳ)) / √( Σ(x − x̄)² · Σ(y − ȳ)² )

## Examples

- Strong positive (the default): X = 1, 2, 3, 4, 5 Y = 2, 4, 5, 4, 5 → r ≈ 0.7746 (n = 5)
- Perfect positive correlation: X = 1, 2, 3, 4 Y = 2, 4, 6, 8 → r = 1 (n = 4)
- Perfect negative correlation: X = 1, 2, 3, 4, 5 Y = 10, 8, 6, 4, 2 → r = −1 (n = 5)
- Near-zero correlation: X = 1, 2, 3, 4, 5 Y = 5, 3, 8, 2, 6 → r ≈ 0.0662 (n = 5)

## FAQ

**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

- [Wikipedia — Pearson correlation coefficient](https://en.wikipedia.org/wiki/Pearson_correlation_coefficient)
- [OpenStax Introductory Statistics 2e — 12.3 The Regression Equation](https://openstax.org/books/introductory-statistics-2e/pages/12-3-the-regression-equation)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Correlation Coefficient Calculator", https://hifreetools.com/calculators/correlation-coefficient-calculator
