Skip to content

Correlation Calculator

Two columns of numbers, one question: do they move together? The correlation calculator below answers that in one step. Paste your X and Y values, and it returns the Pearson correlation coefficient, a scatter plot with the fitted line, a significance test, and a plain-English reading of what the number means for your data.

Nothing is uploaded. The whole calculation runs in your browser.

Correlation Calculator Pearson r · Spearman ρ · scatter plot · significance
Pasting two columns into the X box splits them automatically.

What the correlation coefficient actually measures

Pearson’s r measures how closely two variables track a straight line. It runs from −1 to +1. At +1 every point sits exactly on an upward line; at −1 every point sits on a downward line; at 0 there is no linear relationship at all.

r = Σ(x − x̄)(y − ȳ) ÷ √[ Σ(x − x̄)² × Σ(y − ȳ)² ]

The numerator is the covariance — it is positive when X and Y sit on the same side of their means and negative when they sit on opposite sides. Dividing by the two standard deviations strips out the units, which is why you can compare an r from a revenue-and-headcount dataset against an r from a temperature-and-humidity one.

Reading the number

|r|Typical wordingWhat it looks like on a scatter plot
0.00 – 0.10NegligibleA shapeless cloud
0.10 – 0.30WeakA faint tilt you have to squint for
0.30 – 0.50ModerateA clear tilt, wide spread
0.50 – 0.70StrongAn obvious band around the line
0.70 – 0.90Very strongA tight band
0.90 – 1.00Near perfectAlmost a line — check for duplicated variables

Treat those bands as vocabulary, not law. An r of 0.35 is unremarkable in physics and remarkable in survey research. Judge it against what is normal in your field.

r² is the number to quote to non-statisticians

Square the coefficient and you get the share of variance in Y that the linear relationship with X accounts for. An r of 0.60 sounds substantial; r² = 0.36 tells your audience that 64% of the variation still comes from somewhere else. That framing prevents a lot of over-claiming.

Assumptions worth checking first

  • The relationship is linear. Pearson’s r is blind to curves. A perfect U-shape can score near zero. Look at the scatter plot before you trust the coefficient.
  • Both variables are continuous. Ranks, ordinal scales and categories need Spearman or another measure — the calculator reports Spearman ρ alongside r for exactly this reason.
  • Outliers are handled. One extreme point can drag r from 0.1 to 0.8 in a small sample. If removing a single point changes your conclusion, your conclusion is that point.
  • The pairs are independent. Repeated measures on the same subject, or values from consecutive days, break this. Time series usually needs detrending before correlation means anything.

Significance, and what it does not tell you

The calculator reports a t statistic and a two-tailed p-value testing whether the true correlation is zero, plus a 95% confidence interval built with Fisher’s z transformation. A small p-value says the pattern is unlikely to be sampling noise. It says nothing about whether the relationship is large or useful — with n = 2,000, an r of 0.05 clears p < 0.05 and still explains a quarter of a percent of the variance.

The confidence interval is the more honest summary. If your interval runs from 0.08 to 0.71, you have evidence of a positive relationship and almost no idea how strong it is.

Correlation and causation, concretely

A strong r is consistent with several stories: X causes Y, Y causes X, a third variable drives both, the sample was selected in a way that manufactures the link, or it is coincidence. The coefficient cannot separate them. Only design — an experiment, a natural experiment, a controlled model — can.

Pearson or Spearman?

Use Pearson when both variables are numeric, roughly symmetric, and the pattern looks linear. Switch to Spearman when the data are ranks, when the relationship is monotonic but bent, or when outliers dominate — Spearman correlates the ranks instead of the raw values, so a single extreme point counts as just one more rank. When the two coefficients disagree sharply, that gap is itself a finding: it usually means curvature or an outlier.

Frequently asked questions

How many data points do I need?

Three pairs is the mathematical minimum, but estimates that small are almost meaningless. Around 30 pairs gives a usable confidence interval for a moderate correlation; smaller samples produce intervals so wide that the coefficient barely narrows anything down.

What does a negative correlation mean?

Y tends to fall as X rises. The strength is read from the absolute value, so −0.75 and +0.75 describe equally tight relationships in opposite directions.

Why did I get r = 0 when the chart clearly shows a pattern?

The pattern is probably not linear. Pearson’s r only detects straight-line association, so symmetric curves and U-shapes cancel out to near zero. Try Spearman ρ, or transform the variable first.

Can correlation be greater than 1?

No. The Cauchy–Schwarz inequality caps it at ±1. A result outside that range means a calculation error, most often a mismatch between the X and Y values.

Is my data sent anywhere?

No. Everything is computed in your browser with JavaScript, and nothing leaves the page.