A correlation coefficient summarizes in one number how closely two quantitative variables move together. Height and shoe size, temperature and ice-cream sales, revision time and grades: when one goes up, does the other tend to go up (positive correlation), go down (negative correlation), or do neither?
This page works as a Pearson correlation calculator and a Spearman calculator at once. From your list of pairs it returns:
- Pearson's r, the classic product-moment coefficient that measures the strength of a linear relationship, from −1 to +1;
- a plain-language strength rating (weak, moderate, strong…) with the direction;
- r², the share of variance the two variables have in common;
- the t statistic with degrees of freedom and the two-tailed p-value for testing whether the true correlation is zero;
- Spearman's ρ, the rank correlation, which captures any monotonic relationship and resists outliers, with an approximate p-value;
- a table showing the rank of every value, ties sharing the average rank.
The steps show each formula with your numbers.
How to use this calculator
- Enter one pair per row: the two measurements taken on the same individual, day or item. The order of the rows does not matter, but the pairing does.
- Add rows as needed (at least 3, up to 200). Blank rows are skipped; a row with only one value is flagged.
- Read r at the top, its strength rating, then the p-value. Compare with ρ: if they differ a lot, look for outliers or a curved pattern.
- Open the table to see the ranks used for Spearman's coefficient.
Swapping the x and y columns does not change r or ρ: correlation is symmetric, unlike linear regression.
The formula
Pearson's r is the covariance divided by the product of the standard deviations:
To test (no correlation in the population), compute
which follows a Student distribution with degrees of freedom; the p-value is .
Spearman's ρ is Pearson's r applied to the ranks of the data, tied values receiving the average of the ranks they occupy. Without ties it reduces to , where is the difference of ranks. The calculator always uses the rank-Pearson form, which is exact with ties.
Worked example
On ten summer days a lemonade stand records the daily high temperature (°C) and the cups sold — the default data: (18, 42), (21, 50), (23, 47), (23, 58), (26, 61), (28, 66), (30, 64), (31, 75), (33, 80), (35, 78).
The calculator finds : a very strong positive linear relationship. Then , so about 91.8 % of the day-to-day variation in sales goes with temperature.
The significance test gives with 8 degrees of freedom, and a two-tailed p-value of 1.3 × 10⁻⁵, far below 0.05: a correlation this strong is very unlikely to arise by chance in ten days.
The two days at 23 °C are tied, so each receives rank 3.5. Spearman's coefficient is , close to r, which confirms that the relationship is monotonic and not driven by one extreme day.
How strong is my correlation?
| Size of r (sign ignored) | Usual description |
|---|---|
| below 0.1 | negligible, no linear relationship |
| 0.1 to 0.3 | weak |
| 0.3 to 0.5 | moderate |
| 0.5 to 0.7 | strong |
| 0.7 to 1 | very strong |
These bands follow Cohen's widely used conventions (0.1 small, 0.3 medium, 0.5 large), but they are only a guide: in physics a correlation of 0.9 may be disappointing, while in psychology 0.3 can be important. Strength and significance are different things: with 1,000 pairs, is "significant" yet negligible; with 5 pairs, may not be significant.
Pearson or Spearman?
Use Pearson when both variables are numeric, the relationship looks like a straight line on a scatter plot and there are no extreme outliers; its significance test also assumes approximately normal data. Use Spearman for ranks or ordinal scales (satisfaction from 1 to 5), for a relationship that rises steadily but curves, or when one or two outliers would dominate Pearson's r. A large gap between r and ρ is itself a warning sign worth investigating.
Remember that a correlation, however strong, does not prove causation: hot weather drives lemonade sales, but a hidden third variable often explains both and .
Frequently asked questions
How do I use a Pearson correlation calculator?
Enter your paired observations, one (x, y) pair per row, and read r at the top. It ranges from −1 (perfect negative line) through 0 (no linear relationship) to +1 (perfect positive line). The p-value tells you whether r differs significantly from zero.
What is a good correlation coefficient?
It depends on the field. As a rough guide, |r| above 0.5 is strong and above 0.7 very strong. What matters is whether the relationship is large enough to be useful for your question, and whether it is statistically significant given your sample size.
What does a negative correlation mean?
That high values of x go with low values of y, and vice versa — for example car age and resale price. The sign gives the direction; the size of |r| gives the strength. r = −0.8 is as strong as r = +0.8.
How many pairs do I need for a reliable correlation?
The calculator needs at least 3, but small samples give very unstable estimates: with 5 pairs, even r = 0.85 is only borderline significant. Aim for 30 or more pairs if you want a reasonably precise estimate of r.
Why are Pearson’s r and Spearman’s ρ different?
Pearson measures linear association on the raw values; Spearman measures monotonic association on the ranks. A curved but steadily rising pattern, or a single outlier, can make them differ. If ρ is much higher than r, the relationship is probably monotonic but not linear.
Sources
- OpenStax, Introductory Statistics 2e, §12.4 Testing the Significance of the Correlation Coefficient
- NIST Dataplot Reference Manual, CORRELATION
- NIST Dataplot Reference Manual, RANK CORRELATION INDEPENDENCE TEST (Spearman ρ)
- NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.3.26 Scatter Plot
Last updated: