Skip to content

Correlation Coefficient Calculator

Paste two columns of paired numbers to measure how closely they move together…

Paste two columns of paired numbers to measure how closely they move together, and drag any point on the scatter plot to watch r change.

Read 12 pairs; left out the header row (“Temperature (°C)”, “Ice creams sold”).

Method
More optionsTwo-sided, 95% confidence
Hypothesis
Confidence level

ExamplePearson’s r

0.9645

A very strong positive correlation: as Temperature (°C) goes up, Ice creams sold tends to go up too. Significant at the 5% level (p < 0.05).

Paste your own two columns, or drag a point.

Temperature (°C)Ice creams sold

Drag any point and watch r change. With the plot focused, arrow keys move the highlighted point (the one furthest from the line) and [ ] pick another.

p-value
4.16 × 10⁻⁷
95% CI for r
0.875 to 0.99
r² (shared variation)
0.93 (93%)
How this works: 10 sources,

How this works

Method

Pearson’s correlation coefficient r measures how closely two quantities follow a straight line together, from −1 (a perfect falling line) through 0 (no linear pattern) to +1 (a perfect rising line). In the example, twelve days of temperature and ice cream sales give r = 0.96: warmer days come with more sales almost in lockstep. Full method

How it’s tested

2 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.

Privacy

On your device. Nothing you enter or open leaves this browser. About privacy labels

Changes

  • First published: live curves with draggable cut-offs, and tests on pasted data (t-tests, ANOVA, chi-square, Fisher’s exact, correlation, regression, A/B), checked against SciPy.

Every change on What’s new

How we make toolsReport a mistake

How the correlation coefficient works

Pearson’s correlation coefficient r measures how closely two quantities follow a straight line together, from −1 (a perfect falling line) through 0 (no linear pattern) to +1 (a perfect rising line). In the example, twelve days of temperature and ice cream sales give r = 0.96: warmer days come with more sales almost in lockstep.

r is the sum of the products of each pair’s distances from the two means, divided by the square root of the two sums of squares. Squared, it is the share of the variation the two have in common: r² = 0.93. To test whether the true correlation could be 0, t = r√((n − 2)/(1 − r²)) on n − 2 degrees of freedom. The confidence interval uses Fisher’s z transformation, atanh(r), which is close to normal with standard error 1/√(n − 3).

Always look at the scatter plot. Anscombe’s quartet is four data sets with the same r of 0.82 that look nothing alike: a line, a curve, a line with one outlier and a vertical stack with one far point. Drag a point far from the others and watch r swing. Spearman’s rank correlation, the other option, works on ranks, so it measures any steadily rising or falling pattern and shrugs off outliers. And neither says what causes what: hot days drive both ice cream sales and sunburn.

r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² Σ(y − ȳ)²) · t = r√((n − 2) ÷ (1 − r²))

How strong a correlation must be to be significant

The smallest |r| with a two-sided p-value under 0.05 and under 0.01, by the number of pairs (r = t ÷ √(df + t²)).

The smallest |r| with a two-sided p-value under 0.05 and under 0.01, by the number of pairs (r = t ÷ √(df + t²)).
Pairsdf|r| for p < 0.05|r| for p < 0.01
420.950.99
530.8780.959
640.8110.917
860.7070.834
1080.6320.765
12100.5760.708
15130.5140.641
20180.4440.561
25230.3960.505
30280.3610.463
Show all 15 rows
50480.2790.361
100980.1970.256
2001980.1390.182
5004980.0880.115
1,0009980.0620.081

Common questions

What counts as a strong correlation?

A common rule of thumb (Evans, 1996) calls |r| under 0.2 very weak, 0.2 to 0.4 weak, 0.4 to 0.6 moderate, 0.6 to 0.8 strong and above 0.8 very strong. In practice it depends on the field: 0.3 can be important in medicine and disappointing in physics.

Pearson or Spearman?

Pearson for a straight-line relationship between measurements without big outliers. Spearman for ranks, ratings, curved but steady relationships, or data with outliers. If they disagree a lot, the scatter plot will usually show why.

My correlation is significant but small. Does it matter?

With enough data, even r = 0.1 is significant (see the table), but it means the two share only 1% of their variation. Report r and its confidence interval, not just the p-value.