Pearson Correlation Coefficient (r) Calculator
Compute Pearson’s r for two paired data columns, with R² and a plain-language interpretation of strength and direction.
Result
- r0.774597
- R² (variance explained)0.600000
- Strengthstrong positive
- Covariance (sample)1.500000
- Points (n)5
Step-by-step
- Center each variable on its mean and accumulate Σ(x−x̄)(y−ȳ) = 6.0000.
- Normalize by the spreads: r = 6.0000 ÷ √(10.0000 × 6.0000) = 0.774597.
- Interpretation: strong positive linear relationship; R² = 0.6000 of variance shared.
How to use this calculator
- Enter the X values, comma-separated.
- Enter the matching Y values in the same order.
- Read r, its strength/direction label, and R².
- Use a scatter plot alongside r to confirm the relationship is roughly linear.
About this calculator
Pearson’s correlation coefficient, r, measures the strength and direction of the linear relationship between two variables. It ranges from −1 to +1: a value near +1 means the two variables rise together almost perfectly, near −1 means one falls as the other rises, and near 0 means little or no linear relationship. It is computed as the covariance of the two variables divided by the product of their standard deviations, which standardizes it onto the −1 to +1 scale regardless of the units involved. Squaring r gives R², the proportion of variance the two variables share. This calculator returns r, R², and a plain-language label for the strength and direction, from a pair of equal-length data columns. Remember that r captures only straight-line association and that correlation never, by itself, establishes causation.
How it works — the formula
r = Σ(x−x̄)(y−ȳ) / √(Σ(x−x̄)² · Σ(y−ȳ)²)
R² = r²The numerator is the covariation of X and Y; dividing by the product of their spreads standardizes it to the −1…+1 range, independent of units.
Worked examples
- Inputs:
- xs=1,2,3,4,5; ys=2,4,5,4,5
- Output:
- r ≈ 0.7746, R² = 0.6
- Inputs:
- xs=1,2,3; ys=10,20,30
- Output:
- r = 1.0
- Inputs:
- xs=1,2,3,4; ys=8,6,4,2
- Output:
- r = −1.0
Limitations
- Captures only linear relationships; misses curves.
- Sensitive to outliers; consider Spearman for ranked/robust analysis.
- Requires non-constant data in both variables.
Correlation is not causation; pair r with a scatter plot.