Correlation Calculator
Compute Pearson r, R², covariance, and the two-tailed significance test from any list of (x, y) pairs.
Written by Golam Rabbani, Founder & Lead Engineer
How to use this correlation calculator
- Paste your (x, y) pairs one per line — comma or space separated.
- Press Calculate to compute Pearson r, R², covariance, and the significance test.
- Check the table for the t statistic and the bundled t-critical at α = 0.05.
- Copy the result or Reset to clear the data.
About this correlation calculator
Pearson's correlation coefficient r measures the strength and direction of a linear relationship between two variables. r ranges from −1 (perfect negative) through 0 (no linear relationship) to +1 (perfect positive). The calculator uses sample means and (n − 1)-divisor standard deviations, then converts r into a t statistic with df = n − 2 to test whether the population correlation differs from zero: t = r · √(df) / √(1 − r²). The two-tail critical value at α = 0.05 comes from the bundled t-table, so significance is decided locally without any network lookup.
Worked example. Enter the pairs (1, 2), (2, 4), (3, 5), (4, 4), (5, 6). x̄ = 3, ȳ = 4.2. Sxx = 10, Syy = 8.8, Sxy = 8. So r = 8 / √(10 · 8.8) = 8 / √88 ≈ 0.8528, R² ≈ 0.7273. With df = 3, t = 0.8528 · √3 / √(1 − 0.7273) = 1.4771 / 0.5222 ≈ 2.828. The bundled t-critical at α = 0.05, df = 3 is 3.182, so |t| < 3.182 — fail to reject H₀: ρ = 0 at the 5% level despite the strong-looking r, because n is tiny. The tool reports all of this in one table.
FAQ
- What does R² tell me?
- R² is the proportion of variance in y explained by a linear relationship with x. R² = 0.73 means 73% of the variation in y is associated with x.
- Why might a high r not be significant?
- Because significance depends on sample size too. A correlation of 0.85 with only n = 5 has just df = 3 and can fall short of the t-critical even though r looks impressive.
- Does Pearson r detect non-linear relationships?
- No — only linear. Two variables can have r ≈ 0 yet still be perfectly related through a non-linear curve. Always plot the data.
- What if every x or every y is identical?
- Sxx or Syy is zero, the denominator collapses, and r is undefined. The calculator returns 0 with the implication that there is no usable variation.
- Is this Pearson or Spearman?
- Pearson. For ranks (Spearman), apply the same calculator after converting each column to ranks.