Statistics

Correlation Calculator

Calculate Pearson correlation coefficient (r) and R-squared from paired data

Last reviewed: How we build & verify
XY
Pearson r
R² (Coefficient of Determination)
Interpretation
Data Summary

How it works

The Pearson correlation coefficient measures the strength and direction of a straight-line relationship between two variables, on a scale from -1 to +1. Zero means no linear association, which is not the same as no relationship.

Formula
r = (n·Σxy − Σx·Σy) / √( (n·Σx² − (Σx)²) × (n·Σy² − (Σy)²) )
Variables
  • rcorrelation coefficient, between -1 and +1
  • nnumber of paired observations
  • Σxysum of the products of each pair
  • coefficient of determination: share of variance in y explained by x
Worked example
Inputs: x = 1, 2, 3, 4, 5 and y = 2, 4, 5, 4, 5
  1. n = 5, Σx = 15, Σy = 20, Σxy = 66, Σx² = 55, Σy² = 86
  2. Numerator: 5(66) − 15(20) = 330 − 300 = 30
  3. Denominator: √((5·55 − 225) × (5·86 − 400)) = √(50 × 30) = 38.73
  4. 30 / 38.73
Result: r = 0.775, a strong positive linear relationship (r² = 0.60)
Notes
  • Pearson detects only linear association. A perfect parabola gives r near zero, so always plot the data before trusting the coefficient.
  • Correlation is not causation, and it is also not slope. A value of 0.9 says the points hug a line closely, saying nothing about how steep that line is.
  • A single outlier can drive r from 0 to 0.9 in a small sample. Spearman rank correlation is the resistant alternative.
  • r² is the interpretable figure for explained variance: r = 0.5 means only 25% of the variance is accounted for.

Most Searched Today

Frequently Asked Questions

Correlation Calculator runs right in the browser tab you already have open. No install, no account, no cost.

Correlation Calculator follows the standard method used in textbooks and technical references for this calculation, and we show the formula or approach on the page itself so you can check the working rather than trust a black box. Found an edge case that breaks it? Use the feedback button in the bottom-right corner.

Correlation Calculator | ExaCalc