Skip to content
Conyso.
Free tools · Statistics

Correlation coefficient calculator.

Paste two columns, or x,y pairs, to get the Pearson r, its r-squared, and a two-tailed significance p-value, with a live scatter plot and the least-squares trend line drawn through your points. The number tells you the strength; the plot tells you whether to trust it.

One number per line, or separated by commas or spaces. X and Y must have the same count; each X pairs with the Y on its row.

— Pearson r
n — r² — t — df — p-value — Direction —
Enter paired values to calculate.
What this number is not Correlation is not causation, and r only measures a LINEAR relationship: a strong curved pattern can have r near zero, and a single outlier can create or destroy a correlation. Always look at the scatter plot (above), not just the number.
Test the relationship properly.

Bench runs regression, checks the residuals, and flags the assumptions this simple r cannot see, free, on your real data.

Open in Bench ↗

How it works

The method.

Pearson r asks a single question: as one variable moves, does the other move with it, in a straight line? It centers each column on its own mean, multiplies the paired deviations, and scales the total by the spread of each variable, so the answer always lands between minus one and plus one regardless of the units.

The sign is the direction: positive means they rise together, negative means one falls as the other rises. The size is the strength, and squaring it gives r-squared, the share of the variation the two share. The trend line drawn on the scatter is the least-squares fit, the straight line that r is really measuring the fit of.

Because a correlation from a small sample can appear by chance, the tool also reports a significance test. It forms a t statistic from r and the sample size, then reads a two-tailed p-value from the t-distribution with n minus two degrees of freedom. A small p means a relationship this strong would rarely occur if the true correlation were zero.

x →
The line r measures the fit of.

The formula

The maths, in the open.

r = Σ(x − x̄)(y − ȳ) / √[ Σ(x − x̄)² · Σ(y − ȳ)² ]  ·  t = r √[ (n − 2) / (1 − r²) ]

Worked example. The default sample, x = 1 to 10 against a noisy upward y, gives r ≈ 0.978, so r-squared ≈ 0.956, about 96% shared variation. With n = 10 that is t ≈ 13.15 on 8 degrees of freedom, a two-tailed p ≈ 0.000001: a strong, clearly significant positive correlation. Perfectly collinear points, like y = 2x, return exactly r = 1.0.


Watch out

Common pitfalls.

The two traps are treating correlation as cause and forgetting r only sees straight lines. A perfect parabola can score r near zero, and a single stray point can manufacture or erase a strong r, which is exactly why the scatter plot sits above the number. A significant p on a tiny sample is still fragile, and a huge sample can make a trivially small r significant. Read the strength, the plot, and the p together, never one alone.


FAQ

Correlation, answered.

What is the Pearson correlation coefficient?

Pearson r measures the strength and direction of the linear relationship between two variables. It runs from minus one (a perfect downhill line) through zero (no linear relationship) to plus one (a perfect uphill line).

How do you calculate the correlation coefficient?

Subtract each column's mean from its values, multiply the paired deviations and sum them, then divide by the square root of the product of the two sums of squared deviations. That ratio is r.

What is r-squared?

R-squared, the coefficient of determination, is r multiplied by itself. It is the share of the variation in one variable that moves together with the other, from zero to one.

How do you test whether a correlation is significant?

Form the t statistic r times the square root of (n minus 2) over (1 minus r-squared), with n minus 2 degrees of freedom, then read a two-tailed p-value from the t-distribution. A small p means the correlation is unlikely to be zero by chance.

Does correlation prove causation?

No. A strong r only says two variables move together. A third factor can drive both, or the link can be a coincidence. Correlation is evidence, not proof of cause.

Is this calculator free?

Yes, free and no signup, running entirely in your browser. Nothing you paste leaves the page.



Embed this calculator

Put it on your site, free.

A clean, responsive widget that runs in your visitor's browser, no signup. Pick an accent to match your brand, then copy the snippet. The Conyso mark stays on the widget.

Accent
Powered by Conyso.