Skip to content
AllCalcHub

Correlation Coefficient Calculator

Measure the strength and direction of the relationship between two variables with Pearson's r and Spearman's ρ.

About the Correlation Coefficient Calculator

Paste the x values and the y values, in the same order. The calculator gives Pearson's r, R², its p-value and Spearman's rank correlation, with a scatter plot.

Pearson's r ranges from −1 (perfect negative line) through 0 (no linear relationship) to +1 (perfect positive line). Spearman's ρ does the same on ranks, so it captures any steadily increasing or decreasing relationship and resists outliers.

The formula

r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² × Σ(y − ȳ)²)

Significance
t = r√((n − 2) ÷ (1 − r²)), n − 2 degrees of freedom

Worked example

x = 1 to 8 and y = 2.1, 3.9, 6.2, 7.8, 10.1, 12.2, 13.8, 16.1

  1. Pearson r = 0.9994
  2. R² = 0.9988: the line explains 99.9% of the variation
  3. Spearman ρ = 1 (perfectly increasing)

Questions people ask

Does a high r mean x causes y?

No. A third factor may drive both, or the link may be coincidence.

Pearson or Spearman?

Pearson for straight-line relationships with roughly normal data; Spearman for ranks, curves or outliers.