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.

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

If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.

Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.

All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.

Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.

Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.

Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.

All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.

© 2019 to 2026 Calculate.co.nz. All rights reserved.