Correlation Coefficient Calculator – Do Your Two Lists Move Together?

Two lists of paired numbers can rise together, move in opposite directions, or have nothing to do with each other. The Pearson correlation coefficient, written as r, sums that pattern up in one number between -1 and +1, so you can see the direction and the strength at a glance.

100% FreeNo sign-up neededInstant results

Your paired data

Separate values with commas, spaces or new lines. The two lists must pair up, so they need the same count of values, in matching order.

Your numbers never leave this page. Everything is calculated in your browser.

Result

Correlation coefficient (Pearson r)
0.7746
Strong positive relationship.

The numbers behind it

Pairs (n)5
Mean of X3
Mean of Y4
r-squared0.6000
Shared variation60.0%
StrengthStrong
DirectionPositive (rise together)
Copied

The strength bands on this page are a common guide only: an absolute r of 0.7 or more reads as strong, 0.3 to 0.7 as moderate, and below 0.3 as weak. What counts as strong enough depends on your field and on what the numbers will be used for.

Key Takeaways
  • The anchor pair gives r = 0.7746 and r² = 0.6000 — about 60% of the variation is shared.
  • r always sits between −1 and +1; the sign gives direction only.
  • Correlation is not causation — a high r never says one list causes the other.

The anchor pair, worked in full

For X = 1, 2, 3, 4, 5 and Y = 2, 4, 5, 4, 5, the means are 3 and 4. Each row shows how far a value sits from its own mean, and the product of those two distances.

xyx minus mean of Xy minus mean of YProduct
12-2-24
24-100
35010
44100
55212

The products add up to 6. The squared distances add up to 10 for X and 6 for Y, so r = 6 divided by the square root of 60, which is 6 divided by 7.7460 = 0.7746. Squaring r gives 0.6000, so about 60 percent of the variation is shared.

How it works, in three steps

1

Pair up the values

Each x value belongs with the y value in the same position, like a height paired with a weight for the same person. Both lists need the same count.

2

Measure distance from each mean

For every pair, multiply the x distance from its mean by the y distance from its mean. Pairs that sit on the same side of both means push r up; pairs on opposite sides push it down.

3

Scale the sum into r

Divide the product sum by the square root of the two squared-distance sums. That scaling pins the answer between -1 and +1, whatever units the data came in.

How the calculation works

r = sum of ((x − mean of X) × (y − mean of Y)) ÷ square root of (sum of (x − mean of X)² × sum of (y − mean of Y)²)

Worked example. X is 1, 2, 3, 4, 5 (mean 3) and Y is 2, 4, 5, 4, 5 (mean 4). The distance products are 4, 0, 0, 0 and 2, adding to 6. The squared distances add to 10 for X and 6 for Y. So r = 6 ÷ √(10 × 6) = 6 ÷ 7.7460 = 0.7746, a strong positive correlation.

Reading r-squared. Squaring r gives 0.6000. Read as a percent, about 60 percent of the variation in Y follows the same pattern as X in this pair of lists. The other 40 percent comes from everything else that differs between the pairs.

The extremes. If every point sits exactly on one rising straight line, r is +1. If the line falls instead, r is -1. Both are perfect straight-line relationships; the sign only tells you the direction.

Going deeper

A high r says two lists move together; it never says one of them causes the other. Ice cream sales and sunburn counts correlate strongly, but neither causes the other: hot weather drives both. A third factor, a coincidence in a small sample, or the way the data was collected can all produce a strong r with no cause behind it. Treat r as a reason to look closer, not as proof of a cause.

Pearson r measures straight-line patterns only. A perfect curved relationship, like y following a U shape as x grows, can score an r close to 0 even though the link is exact. Single unusual pairs can also pull r a long way, because every distance is squared in the scaling step. If one point sits far away from the rest, check the result with and without it before trusting the number.

Four pairs of lists, four correlations

The Pearson correlation coefficient, written as r, is a number between −1 and +1 that shows how strongly two paired lists of numbers move together in a straight-line pattern. Every figure below was run through the calculator above, starting from its anchor pair — X as 1, 2, 3, 4, 5 and Y as 2, 4, 5, 4, 5 — and switching to the page’s own presets or typing new lists. The strength bands on this page are a common guide only: an absolute r of 0.7 or more reads as strong, 0.3 to 0.7 as moderate, and below 0.3 as weak.

ListsPairs (n)Mean of X, mean of Yrr-squared and shared variationReading
Anchor: X 1, 2, 3, 4, 5; Y 2, 4, 5, 4, 553, 40.77460.6000, 60.0%Strong positive
Perfect positive preset45, 2.51.00001.0000, 100.0%Strong positive
Weak negative preset53, 3−0.10000.0100, 1.0%Weak negative
Typed: X 1, 2, 3; Y 1, 2, 332, 21.00001.0000, 100.0%Strong positive

The anchor pair is the worked example to understand first, because the page prints its full working table. The means are 3 for X and 4 for Y. For each pair, the distance from the mean is computed for both values, and the two distances are multiplied: for the pair (1, 2) the distances are −2 and −2, giving a product of 4; for (2, 4) they are −1 and 0, giving 0; for (3, 5) they are 0 and 1, giving 0; for (4, 4) they are 1 and 0, giving 0; and for (5, 5) they are 2 and 1, giving 2. The products sum to 6. The scaling step then divides by the square root of the product of the two sums of squared distances: the X distances squared sum to 4 + 1 + 0 + 1 + 4, which is 10, and the Y distances squared sum to 4 + 0 + 1 + 0 + 1, which is 6, so r = 6 ÷ √(10 × 6) = 6 ÷ 7.746 = 0.7746. That is the whole calculation: pair up the values, measure distance from each mean, scale the sum into r.

The perfect positive preset shows what r = 1.0000 means in practice: every point lies exactly on a rising straight line, so the shared variation is 100.0% and r-squared is 1.0000. The typed lists X 1, 2, 3 and Y 1, 2, 3 give the same r of 1.0000 with only three pairs, because the points again lie exactly on a rising line, this time the line Y = X. The number of pairs does not determine r; the straightness of the pattern does. A three-point perfect line and a four-point perfect line both give 1.0000, and a hundred-point perfect line would give the same. What the number of pairs does affect is how much to trust the result: a perfect correlation on three points is far weaker evidence than a perfect correlation on a hundred, because three points can line up by chance in ways a hundred cannot. The calculator reports n beside r for exactly that reason, and any r quoted without its n is incomplete.

The weak negative preset is the most instructive row, because it corrects the most common misreading of r. A value of −0.1000 is negative, but its absolute value is 0.1000, which is below 0.3, so the reading is weak negative, and the shared variation is only 1.0%: knowing X tells you almost nothing about Y in a straight-line sense. The sign says the direction — opposite directions — and the absolute value says the strength, and the two must be read separately. A correlation of −0.9 is strong, not weak, because its absolute value exceeds 0.7, and a correlation of +0.1 is weak, not moderate, because its absolute value is below 0.3. The page’s bands are bands on the absolute value, and the sign is carried separately as the direction, positive for rise together and negative for opposite directions. Confusing the sign with the strength — reading −0.1 as “very negative” and therefore strong — is the single most common error in reporting correlations, and the weak negative preset exists to prevent it.

What r-squared means, and what it does not

The calculator reports r-squared beside r, and the two numbers answer different questions. The correlation r says how strongly and in which direction two lists move together in a straight line. The r-squared value says what share of the variation in one list is associated with straight-line variation in the other: for the anchor pair, r = 0.7746 and r-squared = 0.6000, so 60.0% of the variation is shared in that straight-line sense, and 40.0% is not. For the perfect presets, r-squared is 1.0000 and the shared variation is 100.0%, because every point lies on the line. For the weak negative preset, r-squared is 0.0100 and the shared variation is 1.0%, because almost none of the variation is shared. The squaring removes the sign, which is why r-squared is always between 0 and 1 and never negative, and why it must be read beside r rather than instead of it: r-squared alone cannot tell you whether the relationship rises or falls.

The phrase “shared variation” needs care, because it invites a causal reading that the mathematics does not support. Correlation is not causation, as the page’s own guide heading states, and a shared variation of 60.0% does not mean that 60% of Y is caused by X. It means that 60% of the variation in Y can be accounted for by the best-fitting straight line in X, which is a statement about the geometry of the two lists, not about the mechanism that produced them. A third variable could drive both, the direction could run the other way, or the association could be coincidence, and r cannot distinguish those cases. The page’s example is worth repeating in full: two lists can rise together for years because both grow with time, or because both respond to a common cause, without either causing the other. The calculator measures the straight-line association; the explanation for it must come from outside the numbers.

The strength bands carry a similar caution. An absolute r of 0.7 or more reads as strong, 0.3 to 0.7 as moderate, and below 0.3 as weak, but the page states that those bands are a common guide only, and that what counts as strong enough depends on the field and on what the numbers will be used for. In a physics laboratory, where measurements are precise, an r of 0.8 might be considered modest, because the instruments leave little room for noise. In a social survey, where human behaviour is noisy, an r of 0.4 might be considered substantial, because it survives that noise. The band is a starting point for discussion, not a verdict, and a correlation reported without its field, its n, and its purpose is a number without a context. The calculator gives you r, r-squared, n, and both means together for exactly that reason: the full set is the result, not r alone.

Straight lines only, and the outlier problem

Pearson r measures straight-line patterns only, and that limitation shapes everything it can and cannot say. Two lists related by a perfect curve — rising steeply, then flattening, or rising and then falling — can have an r near zero, because no single straight line fits them, even though the relationship is exact and predictable. A U-shaped pattern is the classic case: as X rises, Y first falls and then rises, and the straight-line summary averages those two directions into something near nothing. If the calculator returns a low r for data that looks patterned when plotted, the first response should be to plot the data, not to conclude there is no relationship. The page’s own guide makes the same point: straight lines only, and a low r rules out a straight-line pattern, nothing more.

Outliers are the second limitation, and they work through the squaring in the scaling step. Because each distance from the mean is squared before summing, a point far from the rest contributes disproportionately: a single extreme pair can raise or lower r substantially, and can even reverse its sign. The page’s advice is the practical response: if one point sits far away from the rest, check the result with and without it before trusting the number. That check is easy on this calculator, because the lists are typed in full: delete the extreme pair from both lists, recompute, and compare. If r barely moves, the outlier was harmless. If r moves a lot, the honest report is both numbers, with the outlier named, rather than one number chosen silently. A correlation that depends on a single point is a property of that point, not of the relationship, and reporting it without saying so misleads whoever reads it.

Worked checks and the cases that break the formula

The anchor pair is the hand check to memorise, because the page prints its full table and the arithmetic can be followed line by line. Means: X 3, Y 4. Products of distances from the means: 4, 0, 0, 0, 2, summing to 6. Sums of squared distances: X 10, Y 6. The denominator: √(10 × 6) = √60 = 7.746. The coefficient: 6 ÷ 7.746 = 0.7746. The r-squared: 0.7746² = 0.6000, and the shared variation is 60.0%. The reading: strong, because 0.7746 exceeds 0.7, and positive, because the sign is plus, so the lists rise together. Every number on the results panel for the anchor pair follows from those steps, and any hand check that disagrees has either paired the lists wrongly — the pairing is by position, first X with first Y, second with second, and so on — or has used different means for the two lists.

The pairing rule deserves emphasis, because it is the input error that produces a plausible-looking but wrong r. The lists must be paired by position, and they must have the same length: the calculator pairs the first X with the first Y, the second with the second, and so on, and extra values in the longer list have no partner and cannot contribute. Reordering one list while leaving the other unchanged changes every pair and therefore changes r, even though neither list’s own distribution changed at all. That is why the page’s instruction to enter paired values matters: correlation is a property of pairs, not of two separate distributions, and two lists with identical means and spreads can have any correlation from −1 to +1 depending on how they are paired. If your r ever surprises you, check the pairing first, before doubting the formula.

Finally, the case where the calculator says the correlation is undefined, which the page’s own FAQ addresses. If one list never varies — every value the same — then its distances from its mean are all zero, its sum of squared distances is zero, and the denominator of the formula becomes zero, so r has no value. That is not an error in the calculator and not a correlation of zero: a correlation of zero means two varying lists with no straight-line pattern, while an undefined correlation means the question cannot be asked, because one list carries no variation to relate to the other. The distinction matters for reporting: “r = 0” and “r is undefined” are different findings, and the second should be reported as a constant list, not as a zero correlation. If the calculator reports undefined, check whether one list is genuinely constant or whether a typing error duplicated one value across the list; the first is a finding, the second is a fix.

How many pairs do you need before trusting r?

The calculator reports n beside r for a reason: the same r means different things at different sample sizes. A perfect correlation of 1.0000 on three pairs, like the typed lists X 1, 2, 3 and Y 1, 2, 3, is a weaker finding than the same 1.0000 on thirty pairs, because three points can line up by chance in ways thirty cannot. The arithmetic is the same in both cases — the points lie exactly on a rising line — but the evidence is not, because the chance explanation is far more plausible for three points than for thirty. The same logic applies at every strength: an r of 0.8 on five pairs is suggestive, while an r of 0.8 on fifty pairs is substantial, and the difference is not in the number but in how hard it would be for chance alone to produce it. The calculator cannot tell you how much to trust r, because it does not know your field or your purpose, but it gives you n beside r so that you can judge for yourself, and any r quoted without its n should be treated as incomplete.

The practical rule is simple: the smaller the n, the more the result should be treated as a lead to follow up rather than a finding to report. With fewer than about ten pairs, a single new pair can move r substantially, so the result is fragile, and the honest report names the fragility. With several dozen pairs, r is stable against any single pair, and the result can be reported with more confidence, subject still to the straight-line limitation and the outlier check. With hundreds of pairs, even a small r can be meaningful, because a small but consistent association across many pairs is unlikely to be chance, though it may still be too small to matter in practice. The question is never only “how big is r” but also “how many pairs, and how much would one more pair change it”, and the calculator’s full output — r, r-squared, n, and both means — is designed to let you ask both questions at once.

Reporting a correlation honestly

A complete correlation report has five parts, and the calculator gives you all five. First, r itself, with its sign: 0.7746 for the anchor pair, positive and strong. Second, r-squared, or the shared variation: 0.6000, or 60.0%, so that the reader knows how much variation the straight line accounts for and how much it leaves unexplained. Third, n: 5 pairs for the anchor, so that the reader knows the result rests on five points, not fifty. Fourth, the means: X 3 and Y 4 for the anchor, so that the reader can place the data. Fifth, the checks: whether the relationship looks straight when plotted, whether any outlier drives the result, and whether the pairing is by position and complete, with no unpaired values. A report that gives only r — “the correlation was 0.77” — omits four of the five parts, and each omission hides a way the result could mislead.

The final check, plotting, deserves emphasis because it is the one check the calculator cannot do for you. A scatter plot of the pairs shows at a glance whether the pattern is straight, curved, or driven by one point, and no number, however precise, replaces that glance. The anchor pairs, plotted, show five points rising together with small wiggles, which is exactly what a strong positive correlation with 60.0% shared variation looks like: a clear upward trend with visible scatter around it. A perfect preset, plotted, shows points exactly on a line, with no scatter at all. A weak negative preset, plotted, shows points scattered with barely a downward tilt, which is what 1.0% shared variation looks like. Plot before you report, check the outlier before you trust, and quote r with its n, its r-squared, and its means: that is the whole discipline, and it fits in one sentence of a report.

When to rank first: the Spearman alternative in one page

Pearson r measures straight-line association between the values themselves. When the relationship is monotonic but curved, when the data are ranks or grades, or when a few extreme values dominate the sums, ranking the values first and correlating the ranks often describes the data better. That rank correlation is Spearman rho, and it answers a slightly different question: do the two lists rise together, regardless of whether they rise in a straight line. The companion guide works a full Spearman example with a tie, and shows where the simplified formula and the Pearson-on-ranks calculation agree and where they part.

The choice is not a matter of taste. If the question is about a linear relationship and the values are measured on a genuine scale, Pearson is the right tool and Spearman throws away information. If the question is about order, or the values are skewed enough that the largest values would decide the result alone, Spearman is the honest tool. Report which one was used, because an r and a rho with the same number mean different things, and a reader who assumes Pearson when the calculation was Spearman will misread the strength of the evidence.

When r is near zero: the checklist before believing it

A correlation near zero is a claim that needs checking, because several real relationships produce it. First, plot the data: a strong curve, a U-shape or a circle all give r near zero while being anything but unrelated, and the plot shows in a second what the number hides. Second, look for subgroups: two groups with strong opposite trends can cancel into a zero overall correlation, and the pooled number then describes neither group. Third, check the range: if one list barely varies in the sample, there is little variation for the other list to track, and the correlation is dragged toward zero by restriction of range rather than by absence of association.

Only after those three checks does a near-zero r earn its usual reading of no linear association in the data at hand. Quote it with the sample size and the plot, and say plainly whether the claim is about linearity or about association in general. The guide on reporting a correlation honestly, further up this page, sets out the wording that keeps the two claims apart.

Frequently asked questions

What is a correlation coefficient?

A correlation coefficient is a number between -1 and +1 that shows how strongly two paired lists of numbers move together in a straight-line pattern. This calculator finds the Pearson coefficient, usually written as r. A value near +1 means the lists rise together, a value near -1 means one rises as the other falls, and a value near 0 means there is little straight-line pattern.

How do you calculate the correlation coefficient?

First find the mean of each list. Then, for every pair, multiply how far the x value sits from its mean by how far the y value sits from its mean, and add those products up. Divide that sum by the square root of the two sums of squared distances. The result is r.

What is the correlation between 1, 2, 3, 4, 5 and 2, 4, 5, 4, 5?

The correlation is r = 0.7746, a strong positive relationship. Its square, r-squared, is 0.6000, which means about 60 percent of the variation in the second list matches the pattern of the first list.

What does a correlation of 0 mean?

A correlation of 0 means the two lists show no straight-line relationship. It does not prove there is no relationship at all: a curved pattern, like a U shape, can still score close to 0 because Pearson r only tracks straight-line movement.

What counts as a strong correlation?

A common guide is that an r with an absolute value of 0.7 or more is strong, between 0.3 and 0.7 is moderate, and below 0.3 is weak. It is only a guide: in some fields 0.5 is a big effect, and in others even 0.8 can be too loose to act on.

Why does the calculator say the correlation is undefined?

The correlation is undefined when every value in one list is the same, because that list never varies and its spread is zero. Dividing by that zero spread is impossible, so no r exists for that pair of lists. Change at least one value so the list varies, and the calculator will find r.

Why is a correlation of −0.10 weak, not strong?

Because strength is read from the absolute value, and the sign only gives the direction. The weak negative preset gives r = −0.1000, whose absolute value is 0.1000, below 0.3, so the reading is weak negative, with a shared variation of only 1.0%. A correlation of −0.9 would be strong, because its absolute value exceeds 0.7, and a correlation of +0.1 would be weak for the same reason. Confusing the sign with the strength is the most common error in reporting correlations.

Does a high r-squared prove that X causes Y?

No. Correlation is not causation. An r-squared of 0.6000 for the anchor pair means 60.0% of the variation in Y is associated with straight-line variation in X, which is a statement about the geometry of the two lists, not about the mechanism that produced them. A third variable could drive both, the direction could run the other way, or the association could be coincidence, and r cannot distinguish those cases. The explanation for an association must come from outside the numbers.

Why can a perfect curve give a correlation near zero?

Because Pearson r measures straight-line patterns only. Two lists related by a perfect curve, such as a U-shape where Y first falls and then rises as X rises, can have an r near zero, because no single straight line fits them, even though the relationship is exact and predictable. A low r rules out a straight-line pattern, nothing more. If data looks patterned when plotted but r is low, plot the data: the pattern is probably curved, and r was the wrong tool for it.

What is the difference between a correlation of zero and an undefined correlation?

A correlation of zero means two varying lists with no straight-line pattern. An undefined correlation means one list never varies, so its distances from its mean are all zero, its sum of squared distances is zero, and the formula’s denominator becomes zero, so r has no value. That is not an error and not a zero: it means the question cannot be asked, because one list carries no variation to relate to the other. Report it as a constant list, not as a zero correlation, and check first whether a typing error duplicated one value across the list.

When should I use Spearman instead of Pearson?

Use Spearman when the relationship is monotonic but not straight, when the data are ranks or ordered grades, or when extreme values would dominate the Pearson sums. Spearman correlates the ranks, so it asks whether the two lists rise together in order, not whether they rise in a straight line. For measured values with a genuinely linear relationship, Pearson is the better tool and Spearman discards information.

Is the correlation coefficient the same as the regression slope?

No, though they are related. The slope says how many units Y changes per unit of X, in the original units, while r is unit-free and always lies between -1 and 1. Two datasets can share the same slope with very different correlations, and the same correlation with very different slopes, because the slope also depends on the spreads of the two lists. Report both when the question is about prediction, and r alone when the question is about strength of association.

How many pairs do I need before trusting a correlation?

There is no single minimum, but small samples are fragile: with very few pairs, one point can swing r from strong to weak, and the confidence interval is wide enough to cover nearly the whole scale. As a working rule, treat any correlation from fewer than about ten pairs as suggestive only, quote it with its sample size, and check the plot for the single point doing all the work. Larger samples narrow the interval, but they do not fix a curved or subgrouped relationship.

Can I correlate a yes-or-no variable with a measurement?

Yes, with care. Coding the yes-or-no variable as 0 and 1 and computing Pearson r gives the point-biserial correlation, which measures how far apart the two groups sit relative to their spread. It is a legitimate summary, but it is bounded by the split: a very uneven split caps how large it can be. Say which coding was used and how uneven the groups are, or the number will be misread as a weak effect when it is really an uneven sample.

This calculator is an educational tool for working out Pearson correlation coefficients. It does not give statistical or research advice, and a correlation on its own never proves that one thing causes another.

↑