Solved.tools: Free Online Calculators & Tools

We use cookies for analytics and advertising. Learn more about our cookie policy

Correlation Coefficient Calculator

Last updated: 5 August 2026

Reviewed by Gavin Meiring, Lead research and primary author · Doctoral Candidate (Corporate Governance) · Research and drafting assisted by AI

Pearson r0.7745966692
Sample size (n)5
StrengthStrong (positive)
Pearson correlation r = Σ((x−x̄)(y−ȳ)) / √(Σ(x−x̄)²·Σ(y−ȳ)²). Range −1 to +1. ±1 = perfect, 0 = no linear correlation.
Was this helpful?


Correlation Coefficient Calculator

The correlation coefficient calculator computes the Pearson product-moment correlation coefficient (r), Spearman's rank correlation (ρ), and Kendall's tau (τ) for paired data. It is used by statisticians measuring linear association, by data scientists exploring feature relationships, by social scientists testing hypotheses about variable links, by finance professionals computing asset correlations, by biologists studying gene expression relationships, by psychologists assessing test validity, by students learning statistics, and by anyone wanting to quantify the relationship between two measured variables. Correlation is one of the most common, and most misused, statistics in science, so understanding exactly what it measures is essential.

How to Use the Correlation Calculator

  1. Enter paired x and y values as comma-separated lists (must be the same length).
  2. Choose the correlation type: Pearson (linear), Spearman (rank-based), or Kendall (concordance).
  3. Click Calculate to see the coefficient, p-value, and scatter plot.
  4. The result panel also reports the coefficient of determination (r²) and a basic interpretation.

The Formulas

Pearson correlation:

r = Σ((xᵢ − x̄)(yᵢ − ȳ)) / √(Σ(xᵢ − x̄)² × Σ(yᵢ − ȳ)²)

r ranges from −1 (perfect negative) through 0 (no linear association) to +1 (perfect positive).

Spearman rank correlation:

Compute the ranks of x and y separately, then apply the Pearson formula to the ranks. ρ is a non-parametric measure of monotonic association.

Kendall's tau:

τ = (number of concordant pairs − number of discordant pairs) / (n × (n−1) / 2)

Measures the proportion of pairwise concordances. More reliable to outliers than Pearson.

Coefficient of determination:

r² = r² (squared Pearson r). Represents the proportion of variance in y explained by x (in a linear regression sense).

Worked Examples

Example 1, Pearson correlation (strong positive)

Data: (1, 2), (2, 4), (3, 5), (4, 4), (5, 6) x̄ = 3, ȳ = 4.2

Σ(x − x̄)(y − ȳ) = (−2)(−2.2) + (−1)(−0.2) + (0)(0.8) + (1)(−0.2) + (2)(1.8) = 4.4 + 0.2 + 0 + (−0.2) + 3.6 = 8.0 Σ(x − x̄)² = 4 + 1 + 0 + 1 + 4 = 10 Σ(y − ȳ)² = 4.84 + 0.04 + 0.64 + 0.04 + 3.24 = 8.8

r = 8.0 / √(10 × 8.8) = 8.0 / √88 = 8.0 / 9.381 = 0.853

Strong positive correlation. r² = 0.728, so about 73% of the variance in y is explained by x.

Example 2, Pearson correlation (no relationship)

Data: (1, 3), (2, 1), (3, 4), (4, 2), (5, 3) x̄ = 3, ȳ = 2.6

Σ(x − x̄)(y − ȳ) = (−2)(0.4) + (−1)(−1.6) + (0)(1.4) + (1)(−0.6) + (2)(0.4) = −0.8 + 1.6 + 0 − 0.6 + 0.8 = 1.0 Σ(x − x̄)² = 10 Σ(y − ȳ)² = 0.16 + 2.56 + 1.96 + 0.36 + 0.16 = 5.2

r = 1.0 / √(10 × 5.2) = 1.0 / √52 = 1.0 / 7.211 = 0.139

Weak correlation; essentially no linear relationship.

Example 3, Spearman correlation (monotonic but non-linear)

Data: (1, 1), (2, 4), (3, 9), (4, 16), (5, 25), y = x²

Pearson r ≈ 0.984 (high, since y is monotonically increasing with x) Spearman ρ = 1.0 (perfect, since ranks are identical)

This shows Spearman captures monotonic association even when the relationship isn't linear.

Example 4, Kendall's tau

same data as example 3, all pairs are concordant (x increases → y increases): τ = 1.0 (perfect concordance)

For data (1, 5), (2, 3), (3, 4), (4, 1), (5, 2), random ordering: τ ≈ −0.6 (negative)

Interpreting Correlation Coefficients

While interpretations vary by field, rough guidelines for |r|:

| |r| | Strength | |----|---------| | 0.0 - 0.2 | Very weak / negligible | | 0.2 - 0.4 | Weak | | 0.4 - 0.6 | Moderate | | 0.6 - 0.8 | Strong | | 0.8 - 1.0 | Very strong |

These are rough. In physics, |r| = 0.7 might be considered weak; in social sciences, |r| = 0.3 might be exciting.

Correlation is not causation. A high correlation between two variables doesn't mean one causes the other. Confounding variables, reverse causation, and coincidence can all produce high r values.

When to Use Each Method

Pearson r: Linear relationships, continuous data, roughly normal distributions. The most commonly used.

Spearman ρ: Monotonic but non-linear relationships, ordinal data, or data with outliers.

Kendall's τ: Small samples, many ties in ranks, when you want a more interpretable measure of concordance.

Hypothesis Testing on r

Test the null hypothesis that the true correlation is 0:

t = r × √((n − 2) / (1 − r²))

with df = n − 2. Compare to t-distribution. The calculator returns a p-value automatically.

For example, with n = 30 and r = 0.4: t = 0.4 × √(28 / (1 − 0.16)) = 0.4 × √(28/0.84) = 0.4 × √33.33 = 0.4 × 5.77 = 2.31 df = 28, p-value ≈ 0.029 (significant at 0.05).

Common Mistakes

Confusing correlation with causation. A high r between ice cream sales and drowning deaths doesn't mean ice cream causes drowning; both rise with summer heat.

Fitting a line through uncorrelated data. If r is near 0, a regression line is meaningless.

Using Pearson for non-linear data. Pearson measures only linear association. Two variables can be perfectly related (e.g., y = x²) but have r ≈ 0 if the relationship is non-monotonic.

Ignoring outliers. A single outlier can dramatically change r. Spearman or Kendall are more reliable.

Extrapolating beyond the data range. Strong correlation within a range doesn't imply the relationship holds outside.

Where Correlation Shows Up

Finance. Asset correlations are central to portfolio construction. Two assets with r = 1 provide no diversification; r = 0 gives full diversification benefit.

Epidemiology. Correlation between risk factors and disease outcomes is the first step in cohort studies. (Causation requires more rigorous designs.)

Machine learning. Feature correlation analysis helps identify redundant predictors. Highly correlated features can be removed or combined.

Quality control. Correlation between process variables can indicate whether one measurement predicts another.

Psychology. Test-retest reliability, validity coefficients, factor analysis, all rely on correlation.

Frequently Asked Questions

What is correlation? A statistical measure of the linear (or monotonic) association between two variables. The most common measure is Pearson's r, ranging from −1 to +1.

What does r = 0 mean? No linear association. Variables can still be related non-linearly (e.g., y = x² has r ≈ 0 for x symmetric around 0).

What does r² mean? The proportion of variance in y explained by x. r = 0.7 means r² = 0.49, so 49% of y's variance is attributable to x (in a linear regression sense).

What is the difference between correlation and regression? Correlation quantifies the strength of association; regression fits a line to predict y from x. They are related but distinct. r is symmetric in x and y; regression slope depends on which is the predictor.

Why is "correlation ≠ causation" so important? Many real-world associations are coincidental or driven by confounding factors. A correlation between X and Y doesn't establish that X causes Y, even if the correlation is strong and statistically significant.

How many data points do I need? A common rule is at least 30 observations for stable Pearson estimates. For Spearman or Kendall, fewer can work. Always plot the data first.

What if my data has outliers? Spearman or Kendall are more reliable to outliers than Pearson. Removing outliers changes r substantially, investigate before deleting.

Can correlation be greater than 1? No. Pearson r is mathematically bounded to [−1, +1]. Values outside this range indicate calculation errors.


**Q:**Can the Correlation Coefficient Calculator be used for professional or commercial purposes?A: Yes, the Correlation Coefficient Calculator The Correlation Coefficient Calculator provides mathematically correct results that are suitable for professional, commercial, and educational use. the Correlation Coefficient Calculator formulas used are well-established and validated against reference standards.

**Q:**How often are the formulas behind the Correlation Coefficient Calculator updated? When standards change (e.g., new physical constants, revised tax brackets, updated standards), the Correlation Coefficient Calculator is updated to reflect the current authoritative source. Each calculator's references section, including the Correlation Coefficient Calculator, lists the specific sources used.

References

  • Pearson, K. "Notes on regression and inheritance in the case of two parents" (1895), Proceedings of the Royal Society of London 58: 240-242.
  • Spearman, C. "The Proof and Measurement of Association between Two Things" (1904), American Journal of Psychology 15: 72-101.
  • Kendall, M. G. "A New Measure of Rank Correlation" (1938), Biometrika 30: 81-93.
  • Rodgers, J. L. & Nicewander, W. A. "Thirteen Ways to Look at the Correlation Coefficient" (1988), The American Statistician 42: 59-66.
  • Cohen, J. Statistical Power Analysis for the Behavioral Sciences, Lawrence Erlbaum.