Pearson’s product-moment correlation coefficient r measures how closely paired data follow a straight line. It is the covariance of X and Y divided by the product of their standard deviations, which removes the units and pins the value between −1 and +1. r = +1 means every point lies exactly on a rising line, r = −1 on a falling line, and r = 0 means no linear trend.
Pearson’s r is symmetric (the correlation of X with Y equals that of Y with X) and unaffected by changing units or adding constants, so correlating temperatures in °C or °F gives the same answer. It is, however, sensitive to outliers and blind to curved patterns, which is why the scatter plot is shown next to the number.
A sample correlation is only an estimate. The calculator therefore tests the null hypothesis that the true correlation is zero with a t test on n − 2 degrees of freedom, and gives a confidence interval based on Fisher’s z transformation. Squaring r gives R², the share of the variance in Y explained by the regression line ŷ = a + bx, where the slope is b = r · sy ÷ sx.
How to use the Pearson Correlation Calculator
- X values
- Y values (same order as X)
- Confidence level
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
Enter the paired X and Y values. The calculator centres both variables on their means, adds the cross-products and divides by the square root of the product of the sums of squares. It then computes t, the two-tailed p-value, the confidence interval for the chosen level and the least-squares line.
Worked example
Six students studied 2, 4, 5, 7, 8 and 10 hours and scored 55, 62, 60, 71, 75 and 84. The means are 6 hours and 67.83 points. Σ(x − x̄)(y − ȳ) = 153, Σ(x − x̄)² = 42 and Σ(y − ȳ)² = 582.83, so r = 153 ÷ √(42 × 582.83) = 0.978 and R² = 0.956. t = 0.978 × √4 ÷ √(1 − 0.956) = 9.35 with 4 degrees of freedom, p ≈ 0.0007. The 95% confidence interval is 0.806 to 0.998, and the regression line is ŷ = 3.643x + 45.98 – each extra hour adds about 3.6 points.
How strong is r?
| |r| (absolute value) | Strength (Evans, 1996) |
|---|---|
| 0.00 – 0.19 | Very weak |
| 0.20 – 0.39 | Weak |
| 0.40 – 0.59 | Moderate |
| 0.60 – 0.79 | Strong |
| 0.80 – 1.00 | Very strong |
Formula
r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² · Σ(y − ȳ)²) = cov(X, Y) ÷ (sx · sy) · t = r√(n − 2) ÷ √(1 − r²), df = n − 2 · CI: tanh(atanh r ± z* ÷ √(n − 3))
Worked example
Inputs — X values: 2, 4, 5, 7, 8, 10; Y values (same order as X): 55, 62, 60, 71, 75, 84; Confidence level: 95%.
Results — Pearson correlation coefficient r = 0.9779; Strength and direction = Very strong positive correlation; Coefficient of determination R² = 0.9563; t statistic = 9.3547; Degrees of freedom = 4; p-value (two-tailed) = 0.0007.
Key terms
- Product-moment correlation
- Another name for Pearson's r, the average product of standardized scores.
- Fisher z transformation
- z = atanh(r), which makes the sampling distribution of r approximately normal.
- Bivariate normal
- A joint distribution in which X and Y are each normal and linked linearly.
Frequently asked questions
How do I calculate Pearson's r by hand?
Subtract the mean from every x and every y, multiply the paired deviations and add them; divide that sum by √(Σ(x − x̄)² × Σ(y − ȳ)²). The step table below the result shows each of these columns.
How many data points do I need?
At least 3 for r and 4 for a confidence interval, but with fewer than about 10 pairs only very large correlations are statistically significant.
What does the p-value tell me?
The probability of a sample correlation at least this far from 0 if the true correlation were 0. With 6 pairs, r = 0.978 gives t = 9.35 and p ≈ 0.0007.
What are the assumptions of Pearson's correlation?
Paired, independent observations, a roughly linear relationship, no extreme outliers and, for the test and interval, approximately bivariate normal data.
How is r related to the regression slope?
Slope = r × sy ÷ sx. If X and Y have the same standard deviation, the slope equals r.
Does r = 0 mean the variables are independent?
Not necessarily. r = 0 rules out a linear relationship, but a curve can still link them. For normally distributed data zero correlation does imply independence.
What is a strong Pearson correlation?
On Evans' scale |r| from 0.6 to 0.79 is strong and 0.8 or more very strong, but importance depends on the field.