Skip to content
ToolMug

Correlation Coefficient Calculator

Are height and weight related? Study time and grades? Paste two columns of data to get the correlation, its significance and a scatter plot — positive or negative, strong or weak.

Runs in your browser — nothing you enter is uploaded

Paired values in the same order; spaces, commas or line breaks.

r

0.9992

Strong positive correlation

n
10
t
71.4178
p-value
1.65e-12
95% confidence interval
0.997 … 1
r²
0.9984

Pearson’s r measures linear association; Spearman’s ρ uses ranks and suits ordinal data or curved monotonic relationships. The Spearman p-value uses the t approximation, which can differ slightly from R’s exact test for small samples without ties. Correlation does not imply causation.

How to use

  1. Paste the two columns into X and Y, in matching order.
  2. Choose Pearson (linear) or Spearman (rank).
  3. Read the coefficient, p-value and confidence interval, and check the scatter plot for outliers.

Options explained

Pearson r
Measures linear association from −1 to 1. The p-value uses t = r√(n−2)/√(1−r²); the interval uses Fisher's z.
Spearman ρ
Correlates the ranks — suitable for ordinal data, outliers or monotonic but curved relationships.

Worked example

Take X = 1, 2, 3, 4, 5, 6, 7, 8 and Y = 2, 1, 4, 3, 7, 8, 6, 9. With n = 8:

Measure Pearson Spearman
Coefficient r = 0.896 ρ = 0.881
t (6 degrees of freedom) 4.954 4.560
p-value 0.0026 0.0039
95% CI 0.521 to 0.981 0.465 to 0.978

The squared Pearson coefficient is r² = 0.804, so about 80% of the variance in Y is shared linearly with X in this sample.

Spearman is Pearson computed on ranks, with tied values given their average rank. Its p-value uses the same t approximation, so for very small samples without ties it can differ slightly from an exact test.

The interval needs n greater than 3. It is built on Fisher’s z: z = atanh(r), with standard error 1 ÷ √(n − 3), then transformed back with tanh.

Frequently asked questions

What counts as a strong correlation?

A rough guide is |r| ≥ 0.7 strong, 0.4–0.7 moderate and 0.1–0.4 weak, but fields differ.

Does a significant correlation prove causation?

No. A third factor may drive both, or the direction may be reversed.

Is my data uploaded?

No. Calculations run in your browser.

Privacy

This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.

Related tools