Statistics / Relationships

Correlation Calculator (Pearson and Spearman)

Measure how strongly two variables move together: Pearson's correlation coefficient r and Spearman's rank correlation ρ, each with its p-value, r², and a scatter plot of the pairs.

Correlation Calculator (Pearson and Spearman): Pearson's r is the covariance of X and Y divided by the product of their standard deviations, from −1 (a perfect falling line) to +1 (a perfect rising line). Spearman's ρ is Pearson's r on the ranks, with ties given their average rank. Each p-value tests whether the true correlation is zero using t = r√((n − 2) ÷ (1 − r²)); the results match SciPy. Runs 100% locally in your browser with zero server file uploads.

Runs
In your browser
Cost
Free · no sign-up
Availability
Ready to use
Correlation calculatorLocal processing

Runs entirely in your browser

Pearson's r0.4775moderate · p = 0.2315
Spearman's ρ0.503strong · p = 0.2039
r²0.228share of variance in common
Pairs8

Pearson's r measures how close the points lie to a straight line, from −1 to +1; Spearman's ρ does the same on the ranks, so it catches any steadily rising or falling relation and resists outliers. The p-values test whether the correlation is zero, using the t distribution. A correlation, however strong, does not show that one thing causes the other.

Worked example

Heights of 160, 165, 170, 175, 180, and 185 cm with weights of 55, 60, 65, 72, 78, and 85 kg give r = 0.998, a near-perfect straight-line relation in this small sample.

To fit the line itself and predict one from the other, use the linear regression calculator.

Look at the plot

Very different data can share the same r: a curve, a cluster with one outlier, and a clean line can all give r = 0.8. Always check the scatter plot before trusting the number.

For the p-value of a statistic from elsewhere, the p-value calculator converts t, z, χ², or F.

How to use it

  1. Paste the X values and the Y values in the same order.
  2. Read Pearson's r, Spearman's ρ, their p-values, and r².
  3. Check the scatter plot for outliers or a curved pattern.

Privacy & limitations

Your data stay in your browser.

Related tools

Frequently asked questions

Which should I use, Pearson or Spearman?

Pearson for a straight-line relation between measurements; Spearman for ranks, a curved but steadily rising or falling relation, or data with outliers.

How strong is a correlation of 0.5?

Conventionally moderate to strong: r² = 0.25, so a quarter of the variation in one is shared with the other. Labels vary by field.

Does correlation mean causation?

No: both may depend on a third factor, or the link may run the other way. Correlation shows association only.

Free tool · runs in your browser · no account required