Pearson Correlation Calculator

Pearson’s r measures how closely paired data follow a straight line, from −1 (perfect negative) through 0 (no linear relation) to +1 (perfect positive).

Also called: Correlation coefficient calculator · Pearson r calculator

  • Last updated
  • Formula tested against reference values

Your numbers

At least 3 values, separated by commas, spaces or new lines.

Result

Pearson’s r
—

Calculating…

r² (share of variance explained)
—
Pairs (n)
—
t statistic (n − 2 df)
—
p-value
—
p-value and sidedness
—
Confidence interval for ρ (Fisher z)
—
CI lower bound
—
CI upper bound
—

How to use this calculator

  1. Enter or choose x values.
  2. Enter or choose y values (same order).
  3. Enter or choose alternative hypothesis.
  4. Enter or choose confidence level for r.
  5. The pearson’s r updates as you type. Use Copy result or Share to keep it.

Method

r = Sxy ÷ √(Sxx·Syy); t = r·√((n − 2) ÷ (1 − r²)) with n − 2 df; CI = tanh(atanh r ± z* ÷ √(n − 3))

Sxy
Σ(x − x̄)(y − ȳ)
Sxx, Syy
sums of squared deviations of x and y
n
number of pairs
z*
two-sided standard normal critical value

Worked example

  1. x̄ = 3, ȳ = 4. Sxy = 6, Sxx = 10, Syy = 6.
  2. r = 6 ÷ √(10 × 6) = 0.7746, so r² = 0.6.
  3. t = 0.7746 × √(3 ÷ 0.4) = 2.121 with 3 df: two-sided p = 0.124.

The five pairs have r = 0.77, a fairly strong positive association, but with so few points it is not significant at 5% (p = 0.12).

What the result means

r describes linear association only: a strong curved relation can give r near 0, and a single outlier can create or hide a correlation, so always look at a scatter plot. Correlation does not show which variable causes the other, or whether a third factor drives both.

Assumptions and limits

  • Pairs are independent observations.
  • For the p-value and interval: x and y are roughly bivariate normal (or n is large).
  • The p-value is for the null hypothesis ρ = 0, with the sidedness you choose.
  • The Fisher z interval needs at least 4 pairs and is approximate for small n.
  • For ranked or strongly non-normal data, use Spearman’s rank correlation.

Questions

What counts as a strong correlation?

It depends on the field. As a rough guide, |r| around 0.1 is small, 0.3 moderate and 0.5 or more large, but a scatter plot says more than any label.

Why do r and the regression slope have the same p-value?

With one predictor, the test of zero correlation and the test of zero slope are the same t test.