Correlation Coefficient Calculator
Enter paired X and Y data to instantly get Pearson's correlation coefficient (r) and see a scatter plot of the relationship.
Calculator verified • Last updated: August 2026
Your Data, Plotted
Points that trend up-and-to-the-right suggest a positive relationship; down-and-to-the-right suggests negative. The tighter the points hug an imaginary line, the stronger the correlation — a scattered cloud means little to no relationship.
How to Calculate the Correlation Coefficient
Pearson's correlation coefficient (r) measures how closely two variables move together in a straight-line (linear) pattern. It's calculated by comparing how far each X and Y value deviates from its own mean, multiplying those deviations together, and normalizing by the spread of each variable.
r: Pearson's correlation coefficient, the result, ranging from -1 to +1.
xi, yi: each individual paired X and Y value in the dataset.
x̄, ȳ: the mean of all X values and the mean of all Y values.
The result always falls between -1 and +1. A value of +1 means a perfect positive linear relationship (as X increases, Y increases proportionally); -1 means a perfect negative relationship; 0 means no linear relationship at all.
r vs. r-Squared
Squaring r gives the coefficient of determination (r²), which is always positive and represents the proportion of variance in Y that's explained by X's linear relationship with it. An r of 0.8 gives an r² of 0.64 — meaning 64% of the variability in Y can be accounted for by its linear relationship with X, while the remaining 36% is due to other factors or randomness.
Correlation Is Not Causation
A strong correlation only shows that two variables tend to change together — it says nothing about why. The relationship might be direct causation, reversed causation, coincidence, or both variables might be driven by a third factor entirely (a classic example: ice cream sales and drowning incidents both rise in summer, but neither causes the other — heat drives both).
When Pearson's r Isn't the Right Tool
Pearson's r only detects linear relationships — two variables can have a strong curved (nonlinear) relationship and still produce an r close to 0. It's also sensitive to outliers, which can inflate or deflate the coefficient. Always look at the scatter plot alongside the number; a chart makes patterns and outliers Pearson's r alone can hide immediately visible.
A Brief History of the Correlation Coefficient
The mathematical foundation for measuring correlation traces back to Francis Galton in the 1880s, who was investigating the relationship between the heights of parents and their children and needed a way to quantify how strongly two variables moved together. Galton's student and collaborator Karl Pearson formalized this into the precise mathematical formula still used today, publishing it in 1896 — which is why it's called the Pearson correlation coefficient. The famous phrase "correlation is not causation" and the broader skepticism it represents developed over subsequent decades as statisticians and scientists repeatedly encountered spurious correlations — cases where two unrelated variables happened to move together, often because both were driven by a hidden third factor, or simply by chance in a large enough dataset.
Common Correlation Mistakes
Assuming a strong correlation means one variable causes the other is by far the most common and consequential error — a correlation can arise from direct causation, reverse causation, a shared underlying cause, or pure coincidence, and the coefficient itself can't distinguish between these. Trusting Pearson's r without ever looking at a scatter plot is another frequent mistake, since r only measures linear relationships and can report a near-zero value even when two variables are strongly related in a curved, non-linear way. Treating a moderate correlation (say, r = 0.4) as "no relationship" is a third — moderate correlations are common and can still be practically meaningful, especially in fields like the social sciences where relationships are rarely extremely strong.
Correlation Terms You Should Know
Pearson's r — the standard correlation coefficient measuring the strength and direction of a linear relationship between two variables, ranging from -1 to 1.
Coefficient of Determination (r-squared) — the square of r, representing the proportion of variance in one variable explained by the other.
Confounding Variable — a hidden third factor that influences both variables being studied, potentially creating a correlation without either one causing the other.
Spurious Correlation — a statistically real but practically meaningless correlation, often arising by chance or through an unrelated confounding factor.
Frequently Asked Questions
What does the correlation coefficient r mean?
Pearson's r measures the strength and direction of a linear relationship between two variables, ranging from -1 (perfect negative) to +1 (perfect positive). A value near 0 means little to no linear relationship.
What is the difference between r and r-squared?
r measures both the strength and direction of a linear relationship. R-squared (r²), always positive, represents the proportion of variance in one variable explained by the other — an r of 0.7 gives an r² of 0.49, meaning about 49% of the variance is explained.
Does correlation imply causation?
No. A strong correlation only shows that two variables tend to move together — it doesn't show that one causes the other. The relationship could be coincidental, reversed, or driven by a third, unmeasured variable.
What counts as a "strong" correlation?
As a rough guide, |r| below 0.1 is negligible, 0.1–0.3 is weak, 0.3–0.5 is moderate, 0.5–0.7 is strong, and above 0.7 is very strong. These thresholds vary by field, so treat them as general guidance rather than a strict rule.