Pearson Correlation Calculator
Test cases replayed : 2 of 2 match · Methodology · No outside source listed
Paste two lists of paired values, x and y, in the same order to measure the strength of their linear relationship.
Result
Pearson correlation coefficient (r)
Coefficient of determination (r²)
- Number of pairs
- Sample covariance
- Least-squares line
- Note
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- x values (separated by commas, spaces or new lines): type or paste your values.
- y values, same order and count: type or paste your values.
- Read the result: Pearson correlation coefficient (r); the panel also shows Coefficient of determination (r²), Number of pairs, Sample covariance, Least-squares line and Note.
Data plot
Table of values
| x | y |
|---|
How this calculator works
Pearson's correlation coefficient: r = Σ(xᵢ − x̄)(yᵢ − ȳ) ÷ √(Σ(xᵢ − x̄)² × Σ(yᵢ − ȳ)²). It ranges from −1 (perfect negative line) through 0 (no linear relationship) to +1 (perfect positive line).
r² is the share of the variance of y explained by the least-squares line y = a + bx, with slope b = Σ(xᵢ − x̄)(yᵢ − ȳ) ÷ Σ(xᵢ − x̄)² and intercept a = ȳ − b x̄.
r measures linear association only: a strong curved relationship can have r near 0, and correlation alone does not show cause.
Worked example
| x values (separated by commas, spaces or new lines) | 1, 2, 3, 4, 5, 6 |
|---|---|
| y values, same order and count | 2, 4, 5, 4, 5, 7 |
| Pearson correlation coefficient (r) | 0.8783 |
|---|---|
| Coefficient of determination (r²) | 0.7714 |
| Number of pairs | 6 |
| Sample covariance | 2.7 |
| Least-squares line | y = 1.8 + 0.771429x |
Frequently asked questions
What is r for x = 1 to 6 and y = 2, 4, 5, 4, 5, 7?
r ≈ 0.8783, so r² ≈ 0.7714: the line explains about 77% of the variation in y.
What counts as a strong correlation?
There is no single rule; many textbooks call |r| above about 0.7 strong and below 0.3 weak, but the field and the sample size matter.