About the Correlation Coefficient Calculator
What is the Correlation Coefficient Calculator?
The Pearson correlation coefficient r measures the strength and direction of the linear relationship between two variables. It ranges from −1 (a perfect negative line) through 0 (no linear relationship) to +1 (a perfect positive line).
Enter paired x and y values — for example hours studied and exam marks. The calculator returns r, the coefficient of determination r², a description of the strength and direction, and a two-tailed p-value that tests whether the correlation could plausibly be zero.
How to use the Correlation Coefficient Calculator
- X Values (separated by commas) (sample: 43, 21, 25, 42, 57, 59)
- Y Values (same order) — must have the same number of values as x, in matching order. (sample: 99, 65, 79, 75, 87, 81)
- Press Calculate Correlation (results also refresh as you type). The result card shows the Pearson Correlation (r), along with Coefficient of determination (r²), Strength & direction, Number of pairs and p-value (two-tailed).
Formula used
r = Σ(x − x̄)(y − ȳ) ÷ √[Σ(x − x̄)² × Σ(y − ȳ)²]
- x̄, ȳ = the means of x and y
- r² = the share of variation in one variable explained by the other
- t = r √(n − 2) ÷ √(1 − r²), used for the p-value with n − 2 degrees of freedom
Strength labels used: |r| ≥ 0.8 very strong, ≥ 0.6 strong, ≥ 0.4 moderate, ≥ 0.2 weak, otherwise very weak or none.
Worked example
These are the sample values already filled in the calculator above, and the result it returns for them:
| Input | Sample value |
|---|---|
| X Values (separated by commas) | 43, 21, 25, 42, 57, 59 |
| Y Values (same order) | 99, 65, 79, 75, 87, 81 |
| Result | Value |
|---|---|
| Pearson Correlation (r) | 0.5298 |
| Coefficient of determination (r²) | 0.2807 |
| Strength & direction | Moderate positive |
| Number of pairs | 6 |
| p-value (two-tailed) | 0.2796 |
Tips for using the Correlation Coefficient Calculator
- Correlation is not causation — ice-cream sales and drowning incidents are correlated because both rise in summer.
- Pearson r only captures straight-line relationships; a perfect U-shape can have r ≈ 0.
- With few data points, even a large r can arise by chance — check the p-value.
