Home / Tools / Correlation Calculator

Correlation Calculator

A correlation calculator tells you how strongly two variables move together, and in which direction. Paste your two columns of numbers below and read the Pearson r, Spearman rho or Kendall tau-b off a live scatter plot, together with a confidence interval, a p-value and the number of pairs used. Pick Pearson for a straight-line link, Spearman or Kendall when the data are ranked, skewed or have outliers.

I want to measure a straight-line relationship (Pearson r)

Your two columns
Try:
n = 0
Hypothesis
CI level
-

-

Scatter

How this correlation is computed
1
2
3
4
The same test in R

  

No data leaves your browser Verified against R's cor.test() Free, no sign-up

How strong is a correlation?

A correlation coefficient runs from -1 (a perfect downhill line) through 0 (no linear or monotonic trend) to +1 (a perfect uphill line). The size of the number is a rough guide to strength, not a hard rule; the thresholds below (Evans, 1996) are common in the social sciences, but what counts as strong depends on your field.

Absolute valueRough strengthReading
0.00 to 0.19Very weak / negligibleLittle to no consistent trend; treat as no relationship until more data.
0.20 to 0.39WeakA slight trend you can see in the scatter but not rely on.
0.40 to 0.59ModerateA clear trend with plenty of scatter around it.
0.60 to 0.79StrongA tight, dependable trend.
0.80 to 1.00Very strongPoints hug the line; near-deterministic.

Two cautions sit behind every number this tool prints. First, correlation is not causation: two variables can move together because one drives the other, because a hidden third variable drives both, or by chance. A coefficient alone cannot tell these apart. Second, a coefficient can miss the shape of a relationship. Anscombe's quartet is the classic warning: four datasets with the same Pearson r near 0.82 that look completely different, one a clean line, one a smooth curve, one a single outlier bending the line. Try the "Curved trap" example above and watch Pearson r sit near zero on a perfect parabola. Always read the scatter plot, not just the number.

Pearson vs Spearman vs Kendall

MethodMeasuresBest forTies & outliersIn R
Pearson rStrength of a straight-line relationshipLinear, roughly normal numeric dataSensitive to outliers; assumes no strong ties issuecor.test(x, y)
Spearman rhoAny monotonic relationship, on the ranksOrdinal, skewed or curved-but-monotonic dataRobust to outliers; exact p only without tiescor.test(x, y, method = "spearman")
Kendall tau-bConcordant minus discordant pairsSmall samples, many ties, ordinal ratingsTie-corrected denominator; preferred with heavy tiescor.test(x, y, method = "kendall")

All three are computed above for your data so you can compare them. When Pearson and Spearman disagree sharply, suspect an outlier or a curved relationship and trust the rank methods. When you have ordinal ratings or a small, heavily tied sample, Kendall tau-b is usually the safest choice.

Frequently asked questions

How do I calculate the correlation between two columns of data?

Paste your two columns into the box, one pair per row, separated by a tab, comma or space. The calculator lines the columns up, drops any row where either value is missing (pairwise deletion), then reports Pearson r, Spearman rho or Kendall tau-b with a confidence interval, a p-value and a scatter plot, all updating as you type. Paste more than two columns and a picker lets you choose which is X and which is Y.

What is the difference between Pearson, Spearman and Kendall correlation?

Pearson r measures a straight-line relationship and assumes roughly linear, roughly normal data. Spearman rho is Pearson r computed on the ranks, so it captures any monotonic relationship and resists outliers. Kendall tau-b counts concordant minus discordant pairs, is also rank-based, corrects for ties, and is preferred for small or heavily tied samples. Use Pearson for linear numeric data, Spearman or Kendall for ordinal, skewed or outlier-prone data.

Does a strong correlation mean one variable causes the other?

No. Correlation measures how two variables move together, not why. A high coefficient can come from a genuine cause, a hidden confounder, reverse causation or coincidence. Correlation is necessary but not sufficient evidence for causation; establishing cause needs an experiment or a careful causal design. A coefficient can also miss a strong but curved relationship, so always look at the scatter plot.

How is the confidence interval for the correlation calculated?

For Pearson r the interval uses the Fisher z transformation: z = atanh(r) is approximately normal with standard error 1 / sqrt(n - 3), so the interval is tanh(z +/- z* / sqrt(n - 3)), exactly what cor.test() reports. Spearman and Kendall have no simple exact interval, so this tool reports the coefficient with an exact or approximate p-value instead; base cor.test() likewise returns no interval for the rank methods.

How does the calculator handle tied ranks?

Ties matter for the rank methods. For Spearman, R gives an exact permutation p-value only when there are no ties; with ties it uses a large-sample t approximation, and this tool matches that behaviour. For Kendall, tau-b carries a tie correction in its denominator, and when ties are present or the sample is large the p-value comes from a tie-corrected normal approximation. The tool states which path was used for your data.

Does this correlation calculator match R?

Yes. Every coefficient, statistic, confidence interval and p-value is checked against R's cor.test() across more than sixty datasets, including tied ranks, the minimum n of three, perfect correlations, near-zero cases, missing-value patterns and outliers. Pearson, Spearman with the AS 89 exact algorithm and Kendall with the exact null distribution all match R to at least six significant figures.

Go deeper