Correlation Coefficient Calculator

Compute the Pearson correlation coefficient r, p-value and R² for two variables, with an interactive scatter plot and interpretation.

What is a correlation coefficient?

The Pearson correlation coefficient (r) measures the strength and direction of the linear relationship between two variables. It ranges from -1 to +1: +1 is a perfect positive relationship, -1 a perfect negative relationship, and 0 means no linear relationship.

The p-value tests the null hypothesis that the true correlation is zero. A small p-value (below 0.05) suggests the observed correlation is unlikely to be due to chance in a sample of this size.

R² (the coefficient of determination) tells you the proportion of variance in one variable that is explained by the other. For example, r = 0.7 gives R² = 0.49 — about 49% of the variance is shared.

How to use

Follow these steps:

  1. Enter your data with one pair per line, for example: 1, 2. You can use commas, spaces or semicolons to separate x and y.
  2. The calculator immediately computes r, p, R² and the regression equation, and draws a scatter plot with the best-fit line.
  3. Read the interpretation to understand the strength, direction and statistical significance of the relationship.

Worked example

Study hours and exam scores for five students:

2, 55 3, 60 4, 70 5, 75 6, 85 These five pairs give r ≈ +0.99 — a very strong positive correlation: more study hours go with higher scores. Remember: correlation does not mean causation!

Frequently Asked Questions

Have another question? Let us know.

What is the difference between correlation and causation?

Correlation means two variables move together; causation means one variable causes the other. Two variables can be strongly correlated without a causal link — a third variable (a confound) may drive both, or the relationship may be coincidental. Ice cream sales and drowning deaths both rise in summer and correlate strongly, but ice cream does not cause drowning.

What does a correlation of 0 mean?

It means there is no linear relationship between the variables — knowing one gives you no information about the other. Note that a non-linear relationship (for example, a U-shaped curve) can still exist even when r = 0.

When should I use Pearson r instead of Spearman's rho?

Pearson r assumes both variables are roughly continuous and linearly related. If your data are ranks, ordinal, or the relationship is monotonic but not linear, Spearman's rank correlation is more appropriate.

How many data pairs do I need?

For a rough estimate, at least 3 pairs can produce a value, but results become more trustworthy with more data. As a rule of thumb, treat correlations from fewer than 10 pairs with caution, and always check the p-value rather than relying on r alone.

Buy me a coffee