Math

Correlation Calculator

Calculate Pearson correlation coefficient between two datasets.

CALCULATOR

Enter your numbers

Instant results

THE NUMORIX GUIDE

How to use the Correlation Calculator

Last reviewed September 14, 2026

What this calculator does

Compute centered products and squared deviations, then Pearson r = sum((x-xbar)(y-ybar)) / sqrt(sum((x-xbar)^2)*sum((y-ybar)^2)); report R^2 = r^2.

Formula and method

Compute centered products and squared deviations, then Pearson r = sum((x-xbar)(y-ybar)) / sqrt(sum((x-xbar)^2)*sum((y-ybar)^2)); report R^2 = r^2.

Variables and inputs

X Values default to 1,2,3,4,5 and Y Values to 2,4,5,4,5; both are comma-separated paired observations. Both lists need the same length and at least two valid entries.

Worked example

For x = 1,2,3 and y = 2,4,6: xbar=2, ybar=4; numerator = (-1)(-2)+0+1*2 = 4; squared-deviation sums are 2 and 8; denominator = sqrt(2*8) = 4; r = 4/4 = 1; R^2 = 1.

How to interpret the result

r measures direction and strength of a linear association from -1 to 1. R^2 is the squared linear association, not proof that one variable causes the other.

Common mistakes to avoid

Keep X and Y paired by row, do not interpret correlation as causation, and do not use r^2 to hide a negative direction.

Assumptions and limitations

The engine does not calculate a p-value or confidence interval and returns zero when one variable has no variation. Outliers can strongly change Pearson correlation.

Practical use and checks

Pearson correlation measures the strength and direction of a linear association between paired X and Y observations. Enter X values 1, 2, 3 and Y values 2, 4, 6 as a check; the result should be r = 1 and R-squared = 1 because every point lies on y = 2x. Reverse the Y order to 6, 4, 2 and r should be -1 while R-squared remains 1, showing why the sign must be read separately from the squared measure. Keep each X value paired with the correct Y value and use the same observation window for both lists. A correlation near zero means little linear association, not necessarily no relationship; a curve can have a strong nonlinear pattern with a small Pearson value. Correlation also does not establish causation, and a common trend, selection effect, or outlier can drive the result. The engine needs equal-length numeric lists and returns a guard value when one list has no variation, but it does not provide a p-value, confidence interval, scatterplot, or outlier diagnostic. Use the output as a prompt to inspect the data and fit a suitable model, not as permission to change a policy or claim that one variable causes another.

Sources and references

COMMON QUESTIONS

Frequently asked questions

Does a high correlation prove cause and effect?

No. Confounding variables, coincidence, or reverse causation can produce a strong association.

Why does R-squared lose the sign?

Squaring makes both positive and negative correlations nonnegative; inspect r when direction matters.