Correlation Calculator
Correlation measures how strongly two things move together. Pearson's r — the correlation coefficient — runs from −1 to +1: +1 means a perfect rising straight-line relationship, −1 a perfect falling one, and 0 means no straight-line relationship at all. It is one of the most used numbers in statistics, from checking whether study time tracks exam scores to whether advertising spend tracks sales.
Paste two lists of paired values — the first X value goes with the first Y value, and so on — and this calculator gives Pearson's r, r², a plain-English interpretation, and the mean and standard deviation of each list.
Pearson correlation coefficient (r)
How It Works
Pearson's r compares how the two lists vary together with how much each varies on its own:
r = Σ(x − x̄) × (y − ŷ) / √(Σ(x − x̄)² × Σ(y − ŷ)²)
For each pair, take how far x is from its mean and how far y is from its mean, and multiply them. When x and y are on the same side of their means, the product is positive; when they are on opposite sides, it is negative. Adding those products up and dividing by the combined spread gives a number that is always between −1 and +1 — the units cancel out, so r means the same thing whether the numbers are heights, prices or test scores. Correlation measures how tightly two variables move together; linear regression draws the line that best fits them.
r² — r squared — is the share of the variation in Y that the straight-line relationship with X explains. An r of 0.7746 gives r² = 0.60, so about 60% of the variation in Y is explained by the line, and 40% is left over. Squaring r also removes the sign, so r² tells you about strength but not direction.
The strength words used on this page are rules of thumb, not hard cut-offs — different fields draw the lines differently: 0–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. The sign adds the direction: a positive r means the values rise together, a negative r means one falls as the other rises. Correlation is for two numeric variables; for two categorical variables, the chi-square test checks whether they are associated.
Worked Example
Take X = 1, 2, 3, 4, 5 and Y = 2, 4, 5, 4, 5. The means are x̄ = 3 and ŷ = 4. The products of the deviations are (1−3)×(2−4) = 4, (2−3)×(4−4) = 0, (3−3)×(5−4) = 0, (4−3)×(4−4) = 0 and (5−3)×(5−4) = 2 — adding to 6. The sum of squared deviations is 10 for X and 6 for Y, so r = 6 / √(10 × 6) = 6 / √60 = 0.7746, a strong positive relationship, with r² = 0.6.
For a perfect relationship, take X = 1, 2, 3, 4, 5 and Y = 2, 4, 6, 8, 10 — every Y is exactly double its X, so the points fall exactly on a rising straight line and r = 1. And for X = 1, 2, 3, 4, 5 with Y = 5, 4, 3, 2, 1, the points fall exactly on a falling straight line and r = −1.
Assumptions
- Paired lists of the same length. Each X value must have exactly one Y partner; if the lists are different lengths, the calculator reports the mismatch instead of guessing.
- At least two pairs. With a single pair there is no spread to measure, so correlation is not defined.
- Both lists must vary. If every value in either list is the same, its standard deviation is 0 and r would mean dividing by zero — the calculator reports that correlation is undefined.
- Linear relationships only. Pearson's r measures straight-line association. A perfect U-shaped relationship can have an r near 0 — always plot your data as well as calculating r.
- Outliers pull r around. A single extreme pair can inflate or deflate r substantially, especially with few pairs. With a small data set, check whether one point is doing all the work.
- Up to 10,000 values per list, each within ±1,000,000,000,000, keeping the page fast.
Sources: No external data is used on this page — every figure is calculated from the values you enter, using the standard Pearson product-moment formula. The standard deviations shown are population standard deviations (dividing by N); r is the same whichever version is used, because the divisor cancels out. Last reviewed: 15 November 2026.
Built and tested by SumKitTool — see how we check our numbers.
How to Use This Calculator
Paste your X values in the first box and your Y values in the second, separated by commas, spaces or new lines. The result updates as you type: the headline is r, and the table shows r², the interpretation, the number of pairs, and the mean and standard deviation of each list. Reset restores the worked example.
Try the worked examples: the defaults give r = 0.7746. Change the Y list to "2, 4, 6, 8, 10" and r becomes exactly 1; change it to "5, 4, 3, 2, 1" and r becomes exactly −1. Try making all the Y values the same — the calculator reports that correlation is undefined, with the reason.
Tips and Practical Advice
Always look at a scatter plot alongside r. The famous Anscombe's quartet is four data sets with nearly identical r values — yet one is a clean line, one is a curve, one has an outlier doing all the work, and one is a vertical pile of points. The number alone cannot tell them apart.
With only two pairs, r is always exactly +1 or −1 (or undefined) — two points always lie on a straight line. Correlation only becomes meaningful with at least a handful of pairs, and the more pairs you have, the more you can trust it.
Remember that r² is the more practical number when you want to know how much one variable explains the other: r = 0.50 sounds strong, but r² = 0.25 means three-quarters of the variation is still unexplained.
Frequently Asked Questions
What does a correlation of 0.77 mean?
It means a strong positive linear relationship: as X rises, Y tends to rise too. With r = 0.77, r² = 0.60, so about 60% of the variation in Y is explained by the straight-line relationship with X, and 40% is left over. The strength words are rules of thumb — 0.60–0.79 counts as strong, 0.80–1.00 as very strong.
What is the difference between correlation and causation?
Correlation only says two things move together; causation says one makes the other happen. Ice-cream sales and drownings correlate strongly, but neither causes the other — hot weather drives both. A high r is a reason to investigate further, never proof that changing X will change Y.
Can correlation be negative?
Yes — r runs from −1 to +1. A negative r means that as X rises, Y tends to fall: for example, the more a product costs, the fewer units tend to sell. An r of −1 is a perfect falling straight line, and an r of 0 means no straight-line relationship in either direction.
Why is correlation undefined when all the values are the same?
Because correlation is built on variation: the formula divides by the standard deviation of each list, and a list of identical values has a standard deviation of 0. Dividing by zero has no answer, so the calculator reports that correlation is undefined instead of showing a misleading number.
Last updated: