Correlation Calculator

Calculate correlation using your data.

Loading calculator…

What this tool does

Calculate correlation using your data. Pearson measures linear association; Spearman measures monotonic association and resists outliers. Correlation never by itself establishes causation.

How to use the Correlation Calculator

  1. Enter or select x values (comma or whitespace separated).
  2. Enter or select y values (same order as x).
  3. Read the calculated result; change any measurement to compare alternatives.

Formula

Pearson r = Σ(x−x̄)(y−ȳ) / sqrt( Σ(x−x̄)² · Σ(y−ȳ)² ); Spearman ρ = Pearson r computed on ranks (average ranks for ties)
x
X values (comma or whitespace separated)
y
Y values (same order as X)

Pearson measures linear association; Spearman measures monotonic association and resists outliers. Correlation never by itself establishes causation.

Worked example

For correlation calculator, the following measurements illustrate the exact method: X values (comma or whitespace separated): 1,2,3,4,5; Y values (same order as X): 2,4,5,4,5.

Inputs

  • X values (comma or whitespace separated)1,2,3,4,5
  • Y values (same order as X)2,4,5,4,5

Result

  • Pearson correlation (r)0.77
  • Spearman correlation (ρ)0.74
  • R² (Pearson)0.6
  • Pairs5

Results explained

Pearson correlation (r)
Pearson correlation (r) from the formula above. Pearson measures linear association; Spearman measures monotonic association and resists outliers. Correlation never by itself establishes causation.
Spearman correlation (ρ)
Spearman correlation (ρ) from the formula above. Pearson measures linear association; Spearman measures monotonic association and resists outliers. Correlation never by itself establishes causation.
R² (Pearson)
R² (Pearson) from the formula above. Pearson measures linear association; Spearman measures monotonic association and resists outliers. Correlation never by itself establishes causation.
Pairs
Pairs from the formula above. Pearson measures linear association; Spearman measures monotonic association and resists outliers. Correlation never by itself establishes causation.

Frequently asked questions

Pearson r = Σ(x−x̄)(y−ȳ) / sqrt( Σ(x−x̄)² · Σ(y−ȳ)² ); Spearman ρ = Pearson r computed on ranks (average ranks for ties)

Pearson measures linear association; Spearman measures monotonic association and resists outliers. Correlation never by itself establishes causation.

Enter numbers only, in the units and format each label describes. Remove missing values rather than substituting zero, unless zero is a real observation.

No. Results describe the numbers you entered. Statistical inference also depends on sampling design, independence, model fit and interpretation; a p-value is not the probability that a hypothesis is true.

No. Every calculation, including the distribution algorithms, runs entirely in your browser.