Correlation Coefficient Calculator
- Means over 5 pairs: X mean 3.00, Y mean 4.00.
- Sum of cross-products of deviations: 6.00. Sums of squared deviations: X 10.00, Y 6.00.
- r: 6.00 ÷ √(10.00 × 6.00) = 0.7746.
- r² = 0.6000 — that share of the variance in Y is linearly associated with X. Correlation describes linear association only and never proves causation.
Our correlation coefficient calculator computes Pearson's correlation coefficient r, the standard measure of how strongly two variables move together in a straight line. Enter your x-y pairs and the tool returns r, which ranges from -1 to 1, along with r², the coefficient of determination. An r of 1 means a perfect positive line, -1 means a perfect negative line, and 0 means no straight-line relationship. For example, the pairs (1,8), (2,6), (3,4), (4,2) give r = -1.00 — a perfect negative line — while six pairs (2,3), (4,5), (6,4), (8,8), (10,7), (12,9) give r = 0.90 with r² = 0.8163.
Pearson's r is the accepted standard because it is computed directly from each point's deviation from its mean: r = sum of (x − x-mean)(y − y-mean) divided by the square root of (sum of squared x deviations × sum of squared y deviations). This formula captures both the direction and strength of a straight-line association while scaling the result to a fixed -1 to 1 range, making results comparable across datasets. The coefficient of determination r² is the share of the variance in one variable linearly associated with the other. Common interpretation bands are above 0.7 strong, 0.4-0.7 moderate, 0.1-0.4 weak, and below 0.1 negligible, always read in the context of the field and sample size. This page shows the full formula, step-by-step workings, worked examples, and sources.
Worked examples
Strong positive association
Primary result: 0.77 — five pairs with r² = 0.6000. (5 pairs · 1 · 2 · 2 · 4 · 3 · 5 · 4 · 4 · 5 · 5 · 0 · 0)
| Pearson correlation (r) | 0.77 |
| r (4 decimals) | 0.7746 |
| Coefficient of determination (r²) | 0.6000 |
| Strength | strong (positive) |
A perfect negative line
Primary result: -1.00 — every step up in X is matched by the same step down in Y. (4 pairs · 1 · 8 · 2 · 6 · 3 · 4 · 4 · 2 · 0 · 0 · 0 · 0)
| Pearson correlation (r) | -1.00 |
| r (4 decimals) | -1.0000 |
| Coefficient of determination (r²) | 1.0000 |
| Strength | strong (negative) |
Six scattered pairs
Primary result: 0.90 — noisy but clearly rising, with r² = 0.8163. (6 pairs · 2 · 3 · 4 · 5 · 6 · 4 · 8 · 8 · 10 · 7 · 12 · 9)
| Pearson correlation (r) | 0.90 |
| r (4 decimals) | 0.9035 |
| Coefficient of determination (r²) | 0.8163 |
| Strength | strong (positive) |
What Pearson's r measures
Pearson's correlation coefficient, denoted r, quantifies both the direction and the strength of a linear association between two variables. Mathematically, r equals the sum of (x − x-mean)(y − y-mean) divided by the square root of the product of the sum of squared x deviations and the sum of squared y deviations. The coefficient always ranges from -1 to 1, where the sign indicates direction and the magnitude indicates strength. A value of exactly 1 means a perfect positive linear relationship, while -1 means a perfect negative linear relationship, with all points falling on a straight line. A value of 0 indicates no linear association.
The sign of r tells you the direction of the relationship. For example, the pairs (1,8), (2,6), (3,4), and (4,2) produce r = -1.00, representing a perfect negative line where every increase in x corresponds to a proportional decrease in y. The magnitude of r tells you how tightly the data cluster around that line. The pairs (1,2), (2,4), (3,5), (4,4), and (5,5) give r = 0.77 (0.7746 to four decimals), showing a strong positive association where the points trend upward but scatter somewhat around the line of best fit.
It is important to understand that r captures only linear association. Two scatterplots can share the same r value yet look quite different, because r does not detect curved or nonlinear patterns. A correlation coefficient calculator will return the same r for any dataset with an identical linear fit, even if the underlying data follow very different distributions. This is why visual inspection of a scatterplot should always accompany interpretation of r.
The coefficient of determination, r², expresses the share of the variance in one variable that is linearly associated with the other. For the five pairs above, r² equals 0.6000, meaning 60% of the variance is shared linearly. For the six pairs (2,3), (4,5), (6,4), (8,8), (10,7), and (12,9), r equals 0.90 and r² equals 0.8163, indicating that roughly 81.63% of the variance in one variable is linearly associated with the other. Higher r² values mean the linear model explains more of the variability in the data.
- Above 0.7: strong association
- 0.4 to 0.7: moderate association
- 0.1 to 0.4: weak association
- Below 0.1: negligible association
Worked examples
The table below shows three verified datasets that illustrate how the correlation coefficient calculator handles different patterns of association. Each dataset is processed through the same formula: Pearson's correlation coefficient r equals the sum of (x minus x-mean)(y minus y-mean) divided by the square root of (sum of squared x deviations multiplied by sum of squared y deviations). The result always falls between -1 and 1.
The first dataset, with pairs (1,2), (2,4), (3,5), (4,4), and (5,5), produces r equal to 0.7746 when rounded to four decimals, or 0.77 when rounded to two. Its r-squared value is 0.6000, meaning 60 percent of the variance in one variable is linearly associated with the other. The second dataset, with pairs (1,8), (2,6), (3,4), and (4,2), yields r equal to -1.00, a perfect negative line. Every point falls exactly on a straight line with a downward slope. The third dataset, six pairs (2,3), (4,5), (6,4), (8,8), (10,7), and (12,9), gives r equal to 0.90 with r-squared equal to 0.8163.
The r-squared value, also called the coefficient of determination, represents the share of the variance in one variable that is linearly associated with the other. In the third dataset, for example, r-squared of 0.8163 indicates that roughly 82 percent of the variance is shared linearly. These examples span the common interpretation bands used as general guidelines: above 0.7 is considered strong, 0.4 to 0.7 is moderate, 0.1 to 0.4 is weak, and below 0.1 is negligible. These bands should always be considered in the context of the specific field and sample size, because what counts as a meaningful correlation in one discipline may be trivial in another.
| Dataset pairs | r | r² |
|---|---|---|
| (1,2), (2,4), (3,5), (4,4), (5,5) | 0.7746 (0.77) | 0.6000 |
| (1,8), (2,6), (3,4), (4,2) | -1.00 | 1.0000 |
| (2,3), (4,5), (6,4), (8,8), (10,7), (12,9) | 0.90 | 0.8163 |
Reading r and r²
When you use a correlation coefficient calculator, you get two related but distinct numbers: r and r². Pearson's correlation coefficient r is calculated as the sum of (x − x-mean)(y − y-mean) divided by the square root of (sum of squared x deviations × sum of squared y deviations), and it ranges from -1 to 1. The sign tells you direction, while the magnitude tells you strength. But r can look more impressive than it deserves, which is why r² is often the more honest number.
r², the coefficient of determination, is the share of the variance in one variable linearly associated with the other. A correlation of r = 0.90 sounds very strong, but r² = 0.8163 tells you that about 82 percent of the variance is shared — meaning roughly 18 percent of the variation remains unexplained by the linear relationship. That difference matters. For example, the six pairs (2,3), (4,5), (6,4), (8,8), (10,7), (12,9) give r = 0.90 with r² = 0.8163. The pairs (1,2), (2,4), (3,5), (4,4), (5,5) give r = 0.77 (to 4 decimals, 0.7746), with r² = 0.6000 — meaning only 60 percent of the variance is shared, despite r sitting closer to 1 than to 0. The pairs (1,8), (2,6), (3,4), (4,2) give r = -1.00, a perfect negative line, with r² = 1.0000.
Common interpretation bands offer a starting point for reading these values: above 0.7 strong, 0.4 to 0.7 moderate, 0.1 to 0.4 weak, and below 0.1 negligible. These bands, however, must always be read in the context of the field and the sample size. A correlation that looks strong with five pairs may not be statistically meaningful, while the same r value with 500 pairs carries far more weight.
Significance depends heavily on the number of pairs. With only a handful of data points, even a high r can arise from chance alone. As the number of pairs grows, the same correlation becomes harder to dismiss as random noise. This is why two studies can report identical r values yet reach different conclusions about whether a relationship is real — the underlying sample size changes how much trust the number earns. Always pair your r and r² with the count of data points before drawing conclusions.
Limits of Pearson's r
A correlation coefficient calculator gives you a number between -1 and 1, but that number does not tell the whole story. Pearson's r measures only the strength and direction of a straight-line relationship. Outliers, curved patterns, and range restriction can each pull r higher or lower than the true pattern in your data warrants, so the result should always be read alongside a scatterplot.
Outliers have an outsized effect on the formula because r is built from deviations from each variable's mean. A single point far from the rest can drag r toward a stronger positive or stronger negative value, or push it closer to zero, masking a real pattern. The verified set (1,2), (2,4), (3,5), (4,4), (5,5) yields r = 0.7746, but adding one extreme pair could shift that result dramatically without changing the underlying trend among the other points.
Curved relationships are another blind spot. Two variables can move together in a clear, predictable arc and still produce a modest r because Pearson's formula captures only linear association. Likewise, range restriction — when you measure only a narrow slice of possible values — can shrink r well below what a broader sample would show. The verified pairs (1,8), (2,6), (3,4), (4,2) give r = -1.00, a perfect negative line, but perfect linearity is rare outside textbook examples. The six pairs (2,3), (4,5), (6,4), (8,8), (10,7), (12,9) produce r = 0.90 with r² = 0.8163, yet even a strong figure like that says nothing about cause.
The coefficient of determination, r², is the share of the variance in one variable linearly associated with the other. In the six-pair example, r² = 0.8163 means about 81.63 percent of the variance is linearly linked. That is descriptive, not explanatory. Correlation never proves causation: a high r can reflect a third variable, coincidence, or a sampling artifact. Common interpretation bands — above 0.7 strong, 0.4 to 0.7 moderate, 0.1 to 0.4 weak, below 0.1 negligible — must always be read in the context of the field and sample size.
FAQs
How is the correlation coefficient calculated?
Sum the products of the deviations from each mean, then divide by the square root of the product of the squared-deviation sums. For the first dataset, this gives 6.00 ÷ the square root of 60 = 0.7746. This value represents the correlation coefficient, showing how strongly the two variables move together.
What does an r of 0.77 mean?
A strong positive linear association: as X rises, Y tends to rise. Its r² of 0.6000 means about 60% of Y's variance is linearly associated with X. This indicates a meaningful relationship, though not all variation in Y is explained by X.
Can correlation be exactly -1?
Yes — when every point lies on a line with negative slope, like the second dataset's (1,8), (2,6), (3,4), (4,2). In this case, every increase in X corresponds to a proportional decrease in Y, producing a perfect negative correlation with no deviation from the line.
What is the difference between r and r²?
r gives direction and strength on a -1 to 1 scale; r² drops the sign and states the shared variance share, 0.8163 in the third dataset. While r tells you whether the relationship is positive or negative, r² focuses on how much variance the two variables share.
Does correlation prove causation?
Never by itself. Confounders, reverse causation and coincidence all produce correlations. A strong correlation suggests a relationship worth investigating further, but establishing causation requires controlled experiments, temporal ordering, and ruling out alternative explanations.
How many pairs do I need?
The arithmetic works with 3 pairs, but small samples give unstable r values; treat results from a handful of points as rough indications. More data points provide a more reliable estimate of the true correlation, reducing the impact of random variation.