Correlation Coefficient Calculator (Pearson r)
A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call
Free correlation coefficient calculator. Paste two lists of numbers to get Pearson's r, R², the strength and direction of the relationship, and the t statistic.
- R²
- 0
- Strength
- 0
- Pairs
- 0
- t statistic
- 0
- Sample covariance
- 0
Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.
How to use the correlation coefficient calculator
- Paste the X values into the first box: numbers separated by commas, spaces or new lines.
- Paste the Y values into the second box, in the same order, so each X has a matching Y.
- Read the results. The correlation coefficient calculator shows Pearson's r, R², a description of the strength and direction of the relationship, the number of pairs, the t statistic and the sample covariance.
You need at least three pairs of values. You can copy columns straight from a spreadsheet.
What is the correlation coefficient?
Pearson's correlation coefficient, r, measures the strength and direction of the straight-line (linear) relationship between two variables. It ranges from −1 to +1:
- r = +1: a perfect positive relationship: as X rises, Y rises exactly in proportion.
- r = 0: no linear relationship.
- r = −1: a perfect negative relationship: as X rises, Y falls exactly in proportion.
The formula
r = Σ(x − x̄)(y − ȳ) ÷ √[Σ(x − x̄)² × Σ(y − ȳ)²]
where x̄ and ȳ are the means of X and Y. The numerator measures how the two variables move together; the denominator scales it so the result is always between −1 and 1.
For X = 1, 2, 3, 4, 5 and Y = 2, 4, 5, 4, 5:
- Means: x̄ = 3, ȳ = 4
- Σ(x − x̄)(y − ȳ) = 6
- Σ(x − x̄)² = 10, Σ(y − ȳ)² = 6
- r = 6 ÷ √60 = 0.775
How strong is the correlation?
A common rule of thumb for the absolute value of r:
| |r| | Description | |---|---| | 0.9 to 1.0 | Very strong | | 0.7 to 0.9 | Strong | | 0.5 to 0.7 | Moderate | | 0.3 to 0.5 | Weak | | 0 to 0.3 | Very weak or none |
These labels vary between fields: in physics, r = 0.9 might be considered poor, while in social science, r = 0.3 can be meaningful.
R² (the coefficient of determination)
R² = r²
R² is the proportion of the variation in Y that can be explained by a straight-line relationship with X. With r = 0.775, R² = 0.60, so about 60% of the variation in Y is explained by X. Our linear regression calculator finds the line itself.
Is the correlation significant?
With small samples, a strong-looking r can happen by chance. The t statistic tests whether r is significantly different from zero:
t = r × √((n − 2) ÷ (1 − r²)), with n − 2 degrees of freedom.
For r = 0.775 and n = 5: t = 2.12 with 3 degrees of freedom, which is not significant at the usual 5% level (the critical value is about 3.18). With more data, the same r would be significant. Look up the p-value for your t statistic in a t-table or statistics software.
Correlation is not causation
A strong correlation doesn't mean one variable causes the other. Common reasons for correlations without causation:
- A third variable: ice cream sales and drowning incidents both rise in summer because of hot weather, not because one causes the other.
- Reverse causation: the direction of cause may be the opposite of what you assume.
- Coincidence: with enough variables, some will correlate by chance.
To show causation, you generally need controlled experiments or careful study designs.
Limitations of Pearson's r
- It only measures linear relationships. Two variables can be strongly related in a curve (such as a U-shape) and still have r close to 0. Always plot your data.
- Outliers can distort r dramatically, in either direction.
- Restricted ranges can hide relationships.
- It assumes both variables are numeric and roughly continuous.
For ranked data or relationships that are consistent but not linear, Spearman's rank correlation is often more suitable.
Covariance
The calculator also shows the sample covariance, Σ(x − x̄)(y − ȳ) ÷ (n − 1). Covariance shows the direction of the relationship but depends on the units of measurement, which is why the correlation coefficient (which standardises it) is easier to interpret.
A worked example
Jordan runs a small online shop and wants to know whether ad spend is related to sales. Over eight weeks:
- Ad spend (X): 1, 2, 3, 4, 5, 6, 7, 8 (hundreds)
- Sales (Y): 52, 55, 61, 60, 68, 70, 75, 79 (hundreds)
In the correlation coefficient calculator: r = 0.99, R² = 0.98, a very strong positive correlation, with t = 15.7 on 6 degrees of freedom, which is highly significant.
Jordan is careful not to assume the ads caused all of the increase: these weeks were also in the run-up to a holiday. Jordan plans a test with ads paused for a week to check.
Who uses a correlation coefficient calculator
Students use it for statistics, psychology and science courses. Researchers use it to explore relationships in data. Marketers and analysts use it to see which metrics move together. Business owners use it to look for patterns in sales, costs and customer behaviour.
Need more customers from Google?
This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. DeepRit is a Google Ads agency that does PPC and nothing else: we build the campaigns, block the searches that waste money, write the ads, set up conversion tracking and send you a short report every week. Request a free PPC audit and we will show you, in dollars, what we would fix first.
Always look at the scatter plot
Before trusting a correlation, draw a scatter plot of the data. The statistician Francis Anscombe famously built four small data sets with almost exactly the same correlation coefficient, about 0.82, and the same regression line. When plotted, they look completely different. One is a neat linear cloud, one is a smooth curve, one is a straight line with a single outlier, and one is a vertical column with one far-off point. The correlation coefficient alone can't tell these apart, but a quick picture can. Use the correlation coefficient calculator together with a chart, not instead of one.
Outliers and their effect
A single extreme point can change Pearson's r dramatically. In a small data set, one outlier far from the others can turn a weak correlation into a strong one, or hide a strong one. If you see an outlier, check whether it's a data entry error. If it's genuine, report the correlation both with and without it, so readers can see how much it matters. Spearman's rank correlation, which works on the ranks of the data rather than the raw values, is much less sensitive to outliers and is a useful companion figure.
Restricted range
Correlations look weaker when the data cover only a narrow range. Suppose height and weight are strongly correlated across all adults. If you only measure professional basketball players, who are all tall, the correlation within that group will be much weaker, because there's little variation in height. Before concluding that two variables are only weakly related, check whether your sample covers the full range of values you care about.
Sample size
With very few data points, a correlation coefficient can be large purely by chance. With five points, r = 0.8 isn't statistically significant at the usual 5% level. With fifty points, r = 0.3 is. The correlation coefficient calculator reports a t statistic so you can judge whether your r is likely to be more than chance. As a rule, collect as much data as you reasonably can, and be cautious about any strong claim based on a handful of observations.
Reporting a correlation
When you report results from a correlation coefficient calculator, give the value of r, the number of data points and, where relevant, the significance level. For example: "Weekly study hours and exam scores were strongly positively correlated, r = 0.82, n = 30." Avoid language that implies cause, such as "study hours increase scores", unless your study design supports it.
Entering data correctly
The correlation coefficient calculator needs pairs: each x value must line up with the y value measured for the same person, day or item. If one list is sorted and the other isn't, or one value is missing, the pairs no longer match and the result is meaningless. Check that both lists have the same number of values before calculating.
Sources and further reading
- Pearson correlation coefficient on Wikipedia: formula, properties and tests.
- Correlation does not imply causation on Wikipedia: common pitfalls.
- NIST/SEMATECH: e-Handbook of Statistical Methods, a reference for statistical techniques.
Frequently asked questions
How do I calculate the correlation coefficient?
r = Σ(x − x̄)(y − ȳ) ÷ √[Σ(x − x̄)² × Σ(y − ȳ)²]. Paste your data into the calculator to do it instantly.
What does r = 0.8 mean?
A strong positive linear relationship: as one variable rises, the other tends to rise.
What's the difference between r and R²?
r measures the strength and direction of the relationship; R² (r squared) is the share of variation explained by it.
Does correlation prove causation?
No. A third factor, reverse causation or chance can produce correlations.
How many data points do I need?
At least three, but more data gives more reliable results.
Is the correlation coefficient calculator free?
Yes. It's free, needs no sign-up, and works in your browser.
Free PPC audit
See where your ad budget leaks.
We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.