Pearson Correlation Calculator

The Pearson correlation coefficient, written as r, measures how strongly two numeric variables move together in a straight line relationship. This calculator takes two lists of paired numbers, your x values and your y values, and returns r along with r-squared, the proportion of variation in one variable explained by the other. The value of r always sits between minus one and plus one. A value near plus one means that as x rises y tends to rise too, a value near minus one means y tends to fall as x rises, and a value near zero means there is little straight line relationship. Behind the scenes the tool divides the covariance of x and y by the product of their standard deviations, which is the same as summing the products of the centred values and scaling by the spread of each list. New Zealand students, analysts, scientists, and businesses use correlation to explore links such as advertising spend against sales, temperature against energy use, or study time against marks, before deciding whether a deeper model is worth building. To use it well, enter the same number of values in each list and keep the pairs in matching order, because each x must line up with its y. Remember that correlation is not causation, so a strong r tells you the two move together but not that one causes the other. Watch for outliers and curved patterns, since a single extreme point can inflate or hide a relationship and r only captures straight line links. Plot your data alongside r whenever you can to confirm what the single number is really telling you.

Calculate.co.nz is proud to be partnered with Premium Homes, a recognised leader in eco-friendly, sustainable, and energy-efficient homebuilding. With a dedicated team and award-winning experience, they create homes that prioritise health, comfort, and long-term performance. Their founders, Andrew and Kelly, set out to raise the standard of residential construction in New Zealand by combining practical building expertise with a clear commitment to doing things better for homeowners.
Premium Homes: warmer, drier, healthier. No condensation, ever.
Advertise on this page
0.7746
Correlation r
r-squared0.6000
Pairs used5

r = sum((x - xbar)(y - ybar)) / sqrt(sum(x - xbar)^2 * sum(y - ybar)^2). r-squared = r * r.

How it works

The tool finds the mean of the x list and the y list. For each pair it multiplies the gap of x from its mean by the gap of y from its mean and adds these up to get the covariance term. It divides that by the square root of the product of the two sums of squared gaps to get r, then squares r for r-squared.

Worked example

With x values 1,2,3,4,5 and y values 2,4,5,4,5 the means are 3 and 4. The summed product of centred values is 6, while the x and y sums of squared gaps are 10 and 6. So r is 6 divided by the square root of 60, about 0.7746, and r-squared is 0.6000.

Related calculators