Skip to content
ihateDesmos

Correlation coefficient calculator

Paste two lists of numbers to measure how strongly they move together. You get Pearson’s r, r², the line of best fit and a p-value, with the data drawn as a scatter plot.

Pearson correlation coefficient (r)
0.999419
r² (share of variation explained)
0.998839
Line of best fit
y = 1.9976x + 0.035714
What it means
A very strong positive linear relationship
Points (n)
8
p-value (two-tailed)
4.889 × 10⁻¹⁰
Steps
  1. Means: x̄ = 4.5, ȳ = 9.025
  2. Sums of squares and products: Sxx = 42, Syy = 167.795, Sxy = 83.9
  3. r = Sxy ÷ √(Sxx × Syy) = 83.9 ÷ √(42 × 167.795) = 0.999419
12345678246810121416xy
Scatter plot with the line of best fit, y = 1.9976x + 0.035714.

How to use it

  1. 1
    Paste the x values in the first box and the y values in the second, in matching order.
  2. 2
    Read r and what it means from the results.
  3. 3
    Check the scatter plot. A correlation only describes a straight-line trend, so it can mislead if the pattern is curved.

How to read r

The correlation coefficient r runs from −1 to 1. Its sign gives the direction: positive means y tends to rise with x. Its size gives the strength: 0 means no straight-line relationship, and ±1 means the points lie exactly on a line.

|r|A common reading
0.9 to 1Very strong
0.7 to 0.9Strong
0.4 to 0.7Moderate
0.2 to 0.4Weak
Below 0.2Very weak or none

These labels are only conventions, and what counts as strong varies by field.

The formula

Pearson’s r is Sxy ÷ √(Sxx × Syy), where Sxx = Σ(x − x̄)², Syy = Σ(y − ȳ)² and Sxy = Σ(x − x̄)(y − ȳ). Squaring it gives r², the share of the variation in y that the line accounts for: r = 0.8 means r² = 0.64, or 64%.

What correlation can’t tell you

  • Causation. Ice cream sales and drownings both rise in summer. Neither causes the other; hot weather drives both.
  • Curved relationships. Points on a perfect U-shape can have r = 0, so always look at the plot.
  • Outliers. A single extreme point can create or hide a strong correlation.

Frequently asked questions

What is a good correlation coefficient?
It depends on the field. In physics, r below 0.99 can signal a problem. In the social sciences, r = 0.3 can be important. Consider the sample size and whether the relationship makes sense.
What is the difference between r and r²?
r gives the strength and direction of a straight-line relationship. r² is always between 0 and 1, and says what share of the variation in y the line accounts for.
What does the p-value mean here?
It is the probability of seeing a correlation this strong by chance if there were truly no linear relationship. It comes from a t-test with n − 2 degrees of freedom.
Does this calculate Spearman’s correlation?
No, this is Pearson’s r. Spearman’s correlation is Pearson’s r computed on the ranks of the data, so you can rank each list and paste the ranks here to get it.

Related tools and guides

Try the correlation coefficient calculator

It opens instantly, with no account and nothing to install.

Open the calculator