Boneyard Tools

Correlation Coefficient Calculator

Paste your data as x,y pairs, one per line, and this calculator returns the Pearson correlation coefficient r, its square r squared, and the number of pairs used. r runs from -1 for a perfect downward line to +1 for a perfect upward line, with 0 signalling no straight-line link. It reads two numbers per line separated by a comma, tab or space, so you can drop columns straight from a spreadsheet.

How to find the correlation coefficient

  1. Type or paste your paired data into the box, one x,y pair on each line.
  2. Separate the two numbers on a line with a comma or a space, for example 3, 5.
  3. Read the Correlation r card for the strength and direction of the relationship.
  4. Check the r squared card for the share of variance the linear fit explains.
  5. Confirm the Pairs (n) count matches the number of observations you entered.
  6. Use the Copy result button to grab r, r squared and n as plain text.

Examples

A moderate positive relationship

1, 2
2, 4
3, 5
4, 4
5, 5
r = 0.774597, r squared = 0.6, n = 5

A perfect straight line up

1, 2
2, 4
3, 6
r = 1, r squared = 1, n = 3

A perfect inverse relationship

1, 10
2, 8
3, 6
4, 4
r = -1, r squared = 1, n = 4

Frequently asked questions

What does the correlation coefficient mean?

Pearson r measures the strength and direction of a straight-line relationship between two variables. A value near +1 means they rise together, near -1 means one falls as the other rises, and near 0 means no linear pattern. The tool labels the result as very weak through very strong for you.

What is the difference between r and r squared?

r squared is r multiplied by itself, so it is always between 0 and 1. It is the proportion of variance in one variable explained by a linear fit to the other. An r of 0.774597 gives an r squared of 0.6, meaning the fit accounts for 60 percent of the variation.

Does correlation prove causation?

No. A high r shows two variables move together, not that one causes the other. A hidden third factor can drive both at once, and a real cause can even hide behind a near-zero r if the true relationship is curved rather than straight.

How should I format the paired data?

Put one pair on each line with exactly two numbers, separated by a comma, a tab or a space. Blank lines are skipped. A line with one number, three numbers or any non-numeric token is rejected with a message telling you which line to fix.

How many pairs do I need?

At least two, and both columns must be the same length so every x has a matching y. Two points always give an r of exactly +1 or -1, so use more observations before you read anything meaningful into the strength.

Why do I get an error about no spread?

Correlation is undefined when one variable never changes. If every x is the same, or every y is the same, its standard deviation is zero and the formula would divide by zero, so the tool reports that the correlation cannot be computed.

Is this a sample or a population correlation?

They are identical for Pearson r. The sample divisor of n minus 1 and the population divisor of n cancel out in the ratio, so you get the same number either way and do not need to choose.

Can it detect a curved relationship?

Only the straight-line part of it. Pearson r can be near zero for a strong but curved pattern, such as a U shape. Plot your points first, and if the trend bends, treat a low r as a sign that a linear measure is the wrong tool rather than proof of no link.

Is my data private?

Yes. The calculation runs entirely in your browser using JavaScript, and nothing you paste is sent to a server, so confidential figures never leave your device.

Learn more

Related tools