Skip to content

Pearson Correlation Calculator

Measure how strongly two numeric variables move together in a straight-line pattern.

What this answers

This calculator answers "how strong is the straight-line relationship between these two variables, and in which direction?" Pearson's r ranges from negative 1 (a perfect decreasing straight-line relationship) through 0 (no linear relationship) to positive 1 (a perfect increasing one). It captures only linear association: two variables can have a strong, obvious curved relationship and still produce an r near 0.

How it is calculated

r is the ratio of how x and y vary together (their covariance) to the product of how much each varies on its own (their individual standard deviations), which normalizes the result to always fall between negative 1 and positive 1 regardless of the original units. This calculator also reports a significance test (whether r differs from 0) using a t distribution with n minus 2 degrees of freedom, and a confidence interval for r itself built from Fisher's z transformation, the standard method since r's own sampling distribution is not normally shaped near the extremes.

Worked example

For x equal to 1, 2, 3 and y equal to 2, 4, 6: y is exactly twice x every time, a perfect increasing linear relationship, so r equals exactly 1. Try that input above and confirm the calculator returns r = 1. Now try changing one y value slightly and watch r drop below 1, since even a small deviation from a perfect line reduces the correlation.

Assumption audit

Calculated from your data: the number of paired observations, and whether either variable has zero variance (which makes r undefined, since there is no variation to correlate against).
Evidence to review: the shape of the relationship. Use the Histogram Maker or a scatter plot to check for curvature or extreme values before trusting r as a summary. A single extreme point can inflate or deflate r substantially.
You must verify: that the pairing between each x and y value is correct and meaningful, and that any apparent relationship is not driven by both variables sharing a common cause rather than one influencing the other.

What this result does not mean

Correlation alone does not establish that changes in one variable cause changes in the other. A strong r can arise from direct causation, reverse causation, a shared underlying cause, or pure coincidence in a small sample, and this calculator cannot distinguish between those explanations. A significant p-value means the data provide evidence that r differs from 0, not that the relationship is strong or useful; check the actual value of r and its confidence interval for that.

Limitations

Pearson correlation measures only linear association and is sensitive to extreme values. For a monotonic but nonlinear relationship, or data with meaningful outliers, a rank-based alternative such as Spearman correlation better reflects the actual pattern in your data.