Math
Correlation Coefficient Calculator
Compute Pearson, Spearman, or Kendall correlation between paired (x, y) values. Returns r, sample size, means, standard deviations, covariance, the least-squares regression line for Pearson, and a strength and direction label.
Correlation Coefficient
Separate x and y with a comma, tab, semicolon, or space. Needs between 3 and 200 pairs and at least 2 different x and y values.
Pearson measures a linear fit. Spearman and Kendall measure monotonic agreement on the ranks.
pearson r
0.92
very strong, positive (p less than 0.01)
Sample size (n)
6
Mean x
3.5
Mean y
4.83
SD x
1.87
SD y
2.04
Covariance
3.5
Least-squares regression line
y = 1x + 1.33
Slope (m)
1
Intercept (b)
1.33
Frequently Asked Questions about the Correlation Coefficient Calculator
What does the correlation coefficient r tell you?
The correlation coefficient r summarizes the strength and direction of the relationship between two variables in a single number from -1 to +1. A value near +1 means the two variables move together almost perfectly; near -1 means one rises as the other falls; near 0 means there is no consistent pattern. The sign gives direction, the magnitude gives strength. The exact endpoints -1 and +1 only happen when every point lies on a straight line (Pearson) or on a perfectly monotonic curve (Spearman, Kendall).
What is the difference between Pearson, Spearman, and Kendall?
Pearson measures the strength of a linear relationship and uses the raw values, so it is sensitive to outliers and assumes the relationship is roughly straight. Spearman ranks both variables first and then runs Pearson on the ranks, so it captures any monotonic relationship (always rising or always falling) even when the curve is bent. Kendall tau counts how many pairs of observations are concordant (same order in both variables) versus discordant; it is the most robust to ties and small samples but is more conservative, so its values are usually smaller in magnitude than Spearman on the same data.
Does correlation imply causation?
No. A high r only means the two variables move together, not that one causes the other. Ice cream sales and shark attacks both rise in summer because hot weather drives swimming and ice cream consumption separately, but neither drives the other. To establish causation you need a controlled experiment or a careful causal-inference design that rules out confounders, reverse causation, and selection effects. Correlation is a clue, never proof.
How does sample size affect significance?
Small samples can produce surprisingly large correlations by chance, so a Pearson r of 0.8 from 4 observations is much weaker evidence than the same r from 40. The p-value adjusts for this: the t statistic is r * sqrt(n - 2) / sqrt(1 - r squared), and larger n makes it easier to clear the significance threshold. Conversely, in very large samples even a tiny r (say 0.05) can come out statistically significant without being practically meaningful, so always look at the magnitude of r alongside the p-value.
Worked example: r = 0.95 between height and weight, what does it mean?
Take 10 adults and plot weight (lb) against height (in). A Pearson r of 0.95 means weight and height move together very tightly: taller people are almost always heavier, and the points cluster around a clean straight line with little scatter. R squared (0.95 squared = 0.9025) tells you about 90 percent of the variation in weight is explained by height. The remaining 10 percent comes from everything else, like build, muscle mass, and body composition. The regression line, for example weight = 5.2 x height - 175, lets you predict a weight from a new height, but only inside the range of heights you sampled.