Skip to main content

Correlation calculator

Paste two paired columns for Pearson r, its p-value, and r² — plus a confidence interval on the correlation itself, which is the number that tells you how precisely you have measured the relationship.

Hypothesis direction

Paste your paired X and Y values

You get the p-value, the effect size, and a confidence interval together — because a p-value on its own does not tell you whether the result matters.

Keep the pairs aligned

Each row is one observation measured on two variables, so the order of the two columns has to match: the third X must belong with the third Y. Copying two columns straight out of a spreadsheet preserves that automatically; sorting one column and not the other destroys it silently, and the calculator has no way to detect it.

The two boxes must therefore hold the same number of values. If they do not, the pairing is broken somewhere and the calculator says so rather than truncating to the shorter column — quietly dropping the tail would produce a correlation for a dataset you do not have.

Strength and significance are different questions

This is the characteristic error with correlations, so it is worth stating with numbers. The p-value asks whether r is distinguishable from zero. r itself asks how strong the relationship is. Sample size drives the first and has nothing to do with the second.

nrpVariance shared
100.600.06736%
200.440.05219%
1000.200.0464%
10000.070.0270.5%

Every row in the bottom half clears p < 0.05 while describing a weaker relationship than the row above it. The top row describes a relationship strong enough to be worth acting on and fails the threshold. Report both numbers, always.

The interval on r

The confidence interval is computed through Fisher's z transformation, which is why it is not symmetric around r — the sampling distribution of a correlation is skewed, more so as r approaches ±1, and a symmetric interval would run past 1 for strong correlations.

It is the most useful number on the panel, because it shows how little a small sample pins down. Twelve observations giving r = 0.5 produce an interval running from roughly −0.10 to 0.83: the data are compatible with no relationship at all and with a very strong one. That is a different finding from r = 0.5 with n = 200, and the p-value alone will not distinguish them.

What Pearson r cannot see

It measures linear association only. A perfect parabola — as tidy a relationship as exists — returns r ≈ 0. A relationship that is strong at low values and flat at high ones gets averaged into something middling. Neither shows up in the coefficient.

It is also fragile to outliers. In a sample of twenty, one stray point can manufacture a correlation of 0.6 out of noise, or flatten a real one to nothing. Anscombe's quartet — four datasets with identical means, variances and correlations but completely different shapes — exists to make exactly this point. Plot your data before trusting the number.

If the relationship is monotonic but curved, or the data are ordinal or heavily skewed, use Spearman's rank correlation. If you already have r and only need the p-value, the correlation to p-value converter takes r and n directly.

Frequently asked questions

How do I calculate a correlation from raw data?

Paste your X values in one box and the matching Y values in the other, in the same order. The calculator computes Pearson r, tests it against zero, and reports r² and a confidence interval on r. The two columns must have the same number of values — each row is one observation measured twice, and a mismatch means the pairing is broken.

What does the p-value tell me about a correlation?

Only whether the relationship is distinguishable from zero. It is not a measure of strength — that is r. The two routinely disagree: with n = 1000, an r of 0.07 is significant (p = 0.027) and explains half a percent of the variance; with n = 10, an r of 0.60 explains 36% and is not significant (p = 0.067). Sample size drives significance; r drives importance.

What is a good correlation coefficient?

It depends entirely on the field. In physics, r = 0.9 might indicate a problem with the apparatus; in psychology, r = 0.3 is a solid finding; in economics, r = 0.2 between two macro series can be meaningful. Squaring helps calibrate: r = 0.5 means the two variables share 25% of their variance and 75% is something else.

What is the difference between r and r²?

r runs from −1 to +1 and carries the direction of the relationship. r² runs from 0 to 1, drops the sign, and gives the proportion of variance the two variables share. r² is usually the more sobering number: a correlation of 0.4, which sounds respectable, accounts for 16% of the variation and leaves 84% unexplained.

What does Pearson r assume?

That the relationship is linear, and that it is not being driven by a handful of points. A perfect parabola gives r near zero despite a deterministic relationship, and one outlier can create or destroy a strong correlation in a small sample. Plot your data before trusting the coefficient. For monotonic-but-curved relationships, or ordinal and heavily skewed data, Spearman's rank correlation is the better tool.

Does a significant correlation mean one variable causes the other?

No, and no p-value however small changes that. A correlation is consistent with X causing Y, Y causing X, a third variable causing both, a selection effect in how the data were gathered, or coincidence. Establishing causation needs an experiment or a design that rules the alternatives out — the correlation is where that work starts, not where it finishes.