Pearson correlation calculator
Paste two columns of paired numbers, X and Y. Get the correlation coefficient r, r² and the p-value with a plain reading of the result.
- Checked against reference values
- Free, no sign-up
- Nothing leaves your browser
Enter paired values
The first Y belongs to the first X, the second to the second, and so on.
Assumptions and limitations
- Each X value and the Y value in the same position belong to the same respondent or object, so X and Y must have the same number of values.
- r captures only linear relationships. Outliers can change it a lot, so look at a scatter plot.
- The p-value assumes the pairs are independent and roughly normally distributed; with large samples this matters less.
Collect real answers in a SurveyNinja survey and see them in charts in the report.
Use this template See the questions firstData is not stored — calculation runs in your browser.
Ready-made template
Do it with your own respondents
The “Likert scale survey” template already has the questions. Put in your company name, share the link and watch the answers come in.
- Copy the template: the questions are written
- Share it by link, QR code or a widget on your site
- Read the results in the report with charts
New accounts get 14 days of Premium features, no credit card.
What is the Pearson correlation coefficient?
The Pearson correlation coefficient r measures the strength and direction of the linear relationship between two numeric variables measured on the same respondents or objects. It is the covariance of X and Y divided by the product of their standard deviations, and runs from −1 (a perfect falling line) through 0 (no linear relationship) to +1 (a perfect rising line).
How to read r and the p-value
-
Formula
r = Σ(x − x̄)(y − ȳ) / √(Σ(x − x̄)² × Σ(y − ȳ)²). The calculator works from deviations around the means, so large values (timestamps, revenue) keep their precision.
-
Reading r
The sign gives the direction: positive means Y tends to rise with X, negative means it tends to fall. The size gives the strength: by Cohen (1988), |r| around 0.1 is small, 0.3 medium and 0.5 or more large.
-
r²
The square of r is the share of the variance of Y that a straight line on X accounts for. r = 0.7 gives r² = 0.49: about 49% of the variation in Y goes along with X.
-
p-value
Tests whether r differs from zero: t = r × √((n − 2) / (1 − r²)) with n − 2 degrees of freedom, two-sided. At p < 0.05 the correlation is called statistically significant. With few pairs even a large r can be chance; with many pairs even a tiny r is significant.
-
Assumptions
The relationship should be roughly a straight line, each pair should come from a different respondent or object, and no single point should dominate. For the p-value the data should be roughly normal, which matters less with large samples.
-
Pearson or Spearman
Use Pearson for numeric measures with a roughly linear relationship. Use Spearman's rank correlation for ranks, short ordinal scales, curved but steadily rising or falling relationships, or data with strong outliers.
Pearson correlation calculation examples
-
Perfect positive relationship
- X: 1, 2, 3, 4, 5. Y: 2, 4, 6, 8, 10. Y = 2 × X.
r = 1, r² = 1, p < 0.001. All points lie on a rising straight line.
-
NPS and average order (5 segments)
- X (NPS): 30, 50, 70, 45, 60. Y (average order, $): 15, 22, 28, 18, 25.
r = 0.984, r² = 0.969, p = 0.002. A strong positive relationship. With only 5 points, check that one segment does not drive it.
-
Almost no relationship
- X: 1, 2, 3, 4, 5, 6, 7. Y: 5, 2, 7, 1, 6, 3, 4, in nearly random order.
r = −0.071, r² = 0.005, p = 0.879. No linear relationship. A curved one may still exist, so look at the scatter plot.
-
One outlier creates a correlation
- The seven pairs above plus one extreme pair: X: 1, 2, 3, 4, 5, 6, 7, 20. Y: 5, 2, 7, 1, 6, 3, 4, 20.
r = 0.881, p = 0.004. A single point turned "no relationship" into a large, significant one. Check that point before reporting r, or use Spearman.
-
Survey length and completion time
- X, number of questions: 10, 15, 20, 25, 30. Y, average time in minutes: 3, 5, 6, 8, 10.
r = 0.995, r² = 0.990, p < 0.001. More questions, longer completion: survey length accounts for 99% of the variation in time across these five surveys.
-
Effort and loyalty by customer
- X, CES (1–7, higher means easier); Y, likelihood to recommend (0–10) for the same customer. Paste both columns from the export.
A positive r means customers who found the interaction easier tend to give higher scores. Mind the scale direction: if 1 means "very easy" in your CES question, the same relationship shows as a negative r.
Size of the relationship by |r|
Cohen proposed these benchmarks for the behavioural sciences as a fallback when a field has no norms of its own. Whether a correlation is significant is a separate question answered by the p-value.
| |r| | Size (Cohen, 1988) |
|---|---|
| < 0.1 | Negligible |
| 0.1 – 0.3 | Small (weak) |
| 0.3 – 0.5 | Medium (moderate) |
| ≥ 0.5 | Large (strong) |
Smallest |r| that is significant, by number of pairs
Two-sided t-test with n − 2 degrees of freedom, the same test the calculator runs. With 500 pairs even a negligible r of 0.09 is significant, so read the size and the p-value together.
| Pairs (n) | p < 0.05 | p < 0.01 |
|---|---|---|
| 5 | 0.878 | 0.959 |
| 10 | 0.632 | 0.765 |
| 15 | 0.514 | 0.641 |
| 20 | 0.444 | 0.561 |
| 30 | 0.361 | 0.463 |
| 50 | 0.279 | 0.361 |
| 100 | 0.197 | 0.257 |
| 200 | 0.139 | 0.182 |
| 500 | 0.088 | 0.115 |
What to avoid
-
Skipping the scatter plot
One outlier can create or hide a correlation, and a curved relationship can give r near 0. Plot the points before you trust r.
-
Misaligned columns
An empty cell is skipped when you paste, which shifts every later pair. Delete incomplete rows in the spreadsheet before copying both columns.
-
Reading significance as strength
A small p-value says the correlation is unlikely to be zero, not that it is large. Report r together with p.
-
Treating correlation as cause
Customers who answer more surveys may also buy more, but surveys need not cause buying. Both may follow from a third factor.
Next step
Collect the data for this analysis
Build the survey in SurveyNinja, share the link in your email or chat, or as a QR code, and export the answers to Excel, CSV or SPSS on every plan.
- Ready questions or AI from a description
- A link for your email or chat, a QR code or a widget on your site
- Charts in the report, export to Excel, CSV and SPSS
Frequently asked questions about Pearson correlation
What is Pearson correlation?
A coefficient of the linear relationship between two quantitative variables, from −1 to +1. A positive r means that as one variable increases, the other tends to increase; a negative r means it tends to decrease.
How do I interpret r and the p-value together?
r tells you the direction and size of the relationship, the p-value tells you whether it could be chance. r = 0.45 from 26 pairs gives p = 0.021: a medium, significant relationship. The same r from 10 pairs gives p = 0.192: it may be real, but the sample is too small to tell. r = 0.09 from 500 pairs gives p = 0.044: significant but negligible in size.
What does r² mean?
r² is the share of the variation in Y that goes along with X in a straight-line fit. r = 0.6 gives r² = 0.36, so 36% of the variation is shared and 64% is not.
How strong is my correlation?
A common reference is Cohen (1988): |r| around 0.1 is small, 0.3 medium and 0.5 or more large. Many fields have their own norms, so compare with studies like yours when you can.
Does correlation mean causation?
No. A high r does not show that X causes Y: both may depend on a third factor, the causation may run the other way, or the pattern may be chance. Causal conclusions need an experiment or a model that accounts for other factors.
When should I use Spearman instead of Pearson?
When the relationship is monotonic but curved, the data are ranks or short ordinal scales, or there are strong outliers. Spearman's correlation works on ranks and is less sensitive to outliers.
How many pairs do I need?
The calculator needs at least 3 pairs, but so few pairs say little: with 5 pairs r has to be about 0.88 to reach p < 0.05, with 30 pairs about 0.36. Plan the sample from the smallest correlation you want to detect.
Can I paste columns from Excel?
Yes. Copy the X column into the first field and the Y column into the second; values may be separated by commas, spaces or line breaks. Copy the numbers without the header, remove thousands separators (1,250 would be read as two values) and delete rows where one value is missing. Both fields must contain the same number of values, otherwise the calculator says which one is longer.
Sources
- Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences, 2nd ed. Lawrence Erlbaum
Learn the method
Read how the method works and where its numbers come from.
Turn the numbers into a survey
Start from the “Likert scale survey” template: the questions are ready.
Cross-Sectional Study vs Longitudinal Study: Differences, Types and Survey Examples