How to Calculate the Pearson Correlation Coefficient (2026)
By Rui Barreira · Last updated: 18 June 2026
The Pearson correlation coefficient (r) measures the strength and direction of the linear relationship between two variables. It ranges from −1 to +1: a value near +1 means the variables rise together, near −1 means one rises as the other falls, and near 0 means no linear relationship. It is the most widely used correlation measure in statistics, research, and data analysis. Use the Pearson Correlation to compute r instantly from any pair of datasets.
The Formula and Manual Calculation
Pearson's r is calculated as the covariance of X and Y divided by the product of their standard deviations. In practice, the equivalent computational formula is easier to apply by hand: sum the products of paired values, subtract (ΣX × ΣY) / n, then divide by the square root of [ΣX² − (ΣX)²/n] × [ΣY² − (ΣY)²/n]. For a dataset with five pairs, work through four intermediate sums — ΣX, ΣY, ΣXY, ΣX², ΣY² — then plug them in. For anything beyond a handful of points, a calculator eliminates arithmetic errors that compound quickly.
Example: Hours Studied vs. Exam Score
The table below shows five students' study hours and exam scores. Computing r on this data yields approximately +0.98, indicating a very strong positive linear relationship.
| Student | Hours studied (X) | Exam score (Y) |
|---|---|---|
| A | 2 | 55 |
| B | 4 | 65 |
| C | 6 | 74 |
| D | 8 | 82 |
| E | 10 | 91 |
Interpreting the Result
As a rule of thumb: |r| below 0.3 is weak, 0.3–0.7 is moderate, and above 0.7 is strong — though what counts as meaningful depends on the field. A high r only confirms a linear relationship; two variables can be strongly related in a curved way and still show r near 0. Correlation is also not causation — a high r between ice cream sales and drowning rates reflects a shared cause (hot weather), not a direct link. Always plot a scatterplot alongside r to spot non-linear patterns or outliers that can distort the coefficient. Use the Pearson Correlation to do this instantly.
Frequently Asked Questions
- Is this tool free?
- Yes — completely free, no signup required. All processing happens in your browser.
- Does the tool work offline?
- Once loaded, most features work without an internet connection since everything runs client-side.