Correlation Coefficient Calculator

In short: Pearson’s r for two sets of paired numbers — do they rise together, fall together, or ignore each other? The textbook dataset below (1–5 against 2, 4, 5, 4, 5) gives r = 0.77. Paste your own pairs and get r, r², the regression line and a plain-language strength reading.

What Pearson’s r measures

The Pearson correlation coefficient compresses a scatterplot into one number between -1 and +1. The construction is worth seeing once: for each pair, multiply how far x sits from its mean by how far y sits from its mean; add those products up; then divide by the spread of x and the spread of y multiplied together — r = Σ(x - x̄)(y - ȳ) / √(Σ(x - x̄)² x Σ(y - ȳ)²). Pairs where both values are on the same side of their means push r up; pairs on opposite sides push it down; the division rescales the result so that a perfect straight-line relationship gives exactly ±1 whatever the units. That unit-freedom is the point: height in centimetres against weight in kilos correlates exactly as height in inches against weight in pounds.

Reading the result, the conventions most textbooks use: |r| under 0.1 is negligible, 0.1–0.3 weak, 0.3–0.5 moderate... in practice many fields call 0.5–0.7 moderate-to-strong and above 0.7 strong, and this page uses bands of 0.1 / 0.3 / 0.5 / 0.7 with the sign read separately (negative simply means one series falls as the other rises — an inverse relationship, not a weak one). The companion figure r² is often the more honest headline: it is the share of y’s variance the line accounts for. An r of 0.77 sounds commanding; its r² of 0.60 says 40% of what moves y is something else entirely. Report both.

The regression line, and the traps

The same sums produce the least-squares line through the points: slope = Σ(x - x̄)(y - ȳ) / Σ(x - x̄)², intercept = ȳ - slope x x̄. It is the line that minimises the squared vertical misses, and it always passes through the point of averages (x̄, ȳ) — a free arithmetic check. Three traps deserve their fame. Correlation is not causation: ice-cream sales and drowning correlate beautifully, both driven by summer. r only sees straight lines: a perfect U-shaped relationship can score r ≈ 0, which is why Anscombe’s quartet — four datasets with identical r and wildly different shapes — is pinned above statisticians’ desks; plot your data. Outliers steer r hard: one wild pair in a small sample can manufacture or destroy a correlation, so check the result with the suspicious point removed. Range restriction is the quiet fourth trap: correlate height with basketball success among NBA players only, and you will “prove” height hardly matters.

A worked example

X = 1, 2, 3, 4, 5 and Y = 2, 4, 5, 4, 5 — the dataset in the box. Means: x̄ = 3, ȳ = 4. Deviations multiply out to a cross-sum of 6; Σ(x - x̄)² = 10 and Σ(y - ȳ)² = 6. So r = 6 / √(10 x 6) = 6 / 7.746 = 0.7746, r² = 0.60, and the line is y = 2.2 + 0.6x (slope 6/10, intercept 4 - 0.6 x 3). A strong positive correlation by the usual bands — and the honest summary is the pair together: r = 0.77, with the line explaining 60% of the variance in y. Those five points and their figures were verified in Node before this page was written.

Frequently asked questions

What does a correlation of 0.77 mean?

A strong positive linear relationship: as x rises, y tends to rise, and the points cluster fairly tightly around a rising straight line. The stricter statement uses the square: r² = 0.60, so about 60% of the variation in y is accounted for by its linear relationship with x, and 40% belongs to other causes and noise. What it never means, by itself, is that x causes y — a third variable, coincidence in a small sample, or y causing x are all still on the table.

Can correlation be outside -1 and +1?

No — the formula is built so it cannot. The numerator (the summed cross-products of deviations) can never exceed the denominator (the two spreads multiplied) in magnitude; that is the Cauchy–Schwarz inequality doing quiet work. If a tool or spreadsheet hands you an r of 1.4, something upstream is broken — mismatched pairs, a text value read as zero, or the same column correlated against a shifted copy of itself.

What if my relationship is curved?

Pearson’s r will undersell it, possibly to zero: r measures straight-line association only. A perfect parabola sampled symmetrically scores r ≈ 0 while being completely predictable. If a plot shows a curve, the standard moves are to transform a variable (logs straighten many growth curves), or to use Spearman’s rank correlation, which correlates the ranks instead of the values and catches any relationship that consistently rises or consistently falls, curved or not. Plot first; the number second.

How many pairs do I need for a meaningful correlation?

The formula will happily run on three pairs, but the result means little: with tiny samples, chance alone produces large |r| often — with 5 pairs, an |r| above about 0.88 is needed before the correlation is statistically significant at the 5% level, and with 10 pairs the bar is about 0.63. As a working rule, treat r from under 15–20 pairs as a hint rather than a finding, and be extra suspicious of a beautiful r in a small sample — small samples are where beautiful accidents live.

Why do the X and Y lists need the same length?

Because correlation is a property of pairs. Each x must have its own y — the same student’s height and weight, the same day’s temperature and ice-cream sales. If the lists differ in length, at least one observation is unpaired and the pairing of the rest is guesswork, so this calculator refuses rather than silently dropping values. If your data arrives as two columns, paste them in the same order, row by row, and count the rows before you trust the answer.

Related tools

Pearson’s product-moment formula as in standard statistics texts, checked on 24 November 2026. Everything is calculated in your browser — nothing you type is sent anywhere.