Pearson Correlation Coefficient Calculator
Enter up to eight x and y pairs and the number of pairs to use. You get the Pearson correlation coefficient r, r squared, the t statistic, the p-value with n minus 2 degrees of freedom and a plain-language reading.
Updated
Report a problem
Formula
For n pairs, with means x-bar and y-bar:
r = Σ(x - x-bar)(y - y-bar) / sqrt( Σ(x - x-bar)² × Σ(y - y-bar)² )
t = r × sqrt( (n - 2) / (1 - r²) ), with n - 2 degrees of freedom.
The p-value is two-tailed: p = 2 × P(T ≤ -|t|) for a Student t variable T with n - 2 degrees of freedom. It tests the null hypothesis that the true correlation is 0.
Reading r
| Absolute value of r | Label on this page |
|---|---|
| below 0.1 | negligible |
| 0.1 to below 0.3 | weak |
| 0.3 to below 0.5 | moderate |
| 0.5 to below 0.7 | strong |
| 0.7 or more | very strong |
These bands are a common rule of thumb, not a standard. A result is called significant when p is below 0.05.
Worked example
x = 1, 2, 3, 4, 5, 6, 7, 8 and y = 2, 4, 5, 4, 5, 7, 8, 9 (n = 8).
- r = 0.9512, r² = 0.9048
- t = 0.9512 × sqrt(6 / 0.0952) = 7.5498 with 6 degrees of freedom
- two-tailed p = 0.00028, so the correlation is significant at the 5% level
Constant x or y values (no spread) and a perfectly straight line (r of exactly 1 or -1, so t is infinite) cannot be tested and return an error.
Frequently asked questions
What does the Pearson correlation coefficient measure?
Pearson r measures how closely paired data follow a straight line, from -1 (perfect downhill line) through 0 (no linear relationship) to +1 (perfect uphill line). For x = 1 to 8 and y = 2, 4, 5, 4, 5, 7, 8, 9 it is 0.9512.
How is the p-value calculated?
The calculator forms t = r x sqrt((n - 2) / (1 - r squared)) and looks it up in a Student t distribution with n - 2 degrees of freedom, two-tailed. For r = 0.9512 and n = 8, t is 7.55 with 6 degrees of freedom and p is about 0.00028.
What is a good correlation value?
There is no universal cut-off. This page labels |r| below 0.1 as negligible, 0.1 to 0.3 weak, 0.3 to 0.5 moderate, 0.5 to 0.7 strong and 0.7 or more very strong, a common rule of thumb. What counts as good depends on your field.
Why is my p-value large when r looks high?
With few pairs, a high r can happen by chance. Using the first 5 pairs of the example, r is 0.7746 but p is 0.124, so it is not significant at 5%. Adding data lowers p when the pattern holds.
Does correlation mean one thing causes the other?
No. A strong r only shows the two variables move together in a straight-line pattern. A third factor or coincidence can produce it, and outliers or curved relationships can distort r. The p-value assumes independent observations and approximately normal data, or a large sample.