Correlation Coefficient Calculator

Measure how strongly two variables move together.

Correlation Coefficient Calculator tool

—
Pearson's r
—
r squared
—
Spearman's ρ
—
p-value (two-tailed)
—
Strength

About the Correlation Coefficient Calculator

Do students who study longer score higher? Do sales rise with advertising? Correlation measures how closely two variables move together, from −1 to +1. This correlation coefficient calculator gives Pearson's r, r squared and Spearman's rank correlation for paired data, with a p-value and a plain-language description of strength. Correlation alone does not prove that one thing causes the other.

Pearson's r is the covariance of X and Y divided by the product of their standard deviations: r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² Σ(y − ȳ)²). It measures linear association. Spearman's ρ applies the same formula to the ranks of the values, so it measures any consistently increasing or decreasing relationship and resists outliers; tied values get the average of their ranks. The p-value tests whether r differs from zero using t = r√(n − 2) ÷ √(1 − r²) with n − 2 degrees of freedom.

Example: for X = 1, 2, 3, 4, 5 and Y = 2, 4, 5, 4, 5, Pearson's r is about 0.774597, so r² = 0.6: 60% of the variation in Y is explained by a straight line in X. Spearman's ρ is about 0.737865. With only five pairs the p-value is about 0.124, so the correlation is not statistically significant at the 5% level despite being fairly strong.

Correlation does not prove causation. To fit the best line through the points, use the linear regression calculator; for the spread of each variable, the standard deviation calculator; and for other test statistics, the p-value calculator.

How to use the Correlation Coefficient Calculator

  1. Enter the X valuesType or paste the first variable, one value per pair.
  2. Enter the Y valuesType or paste the second variable in the same order.
  3. Read the correlationSee Pearson's r, r², Spearman's ρ and the strength.
  4. Check significanceSee the t statistic and two-tailed p-value for r.

Correlation Coefficient Calculator features

  • Pearson's r and r squared
  • Spearman's rank correlation with tie handling
  • Two-tailed p-value for r
  • Plain-English strength and direction
  • Means, covariance and counts
  • Paste columns from spreadsheets
  • Runs entirely in your browser

Common uses

  • Research and coursework data analysis
  • Checking relationships before regression
  • Comparing rankings from two judges
  • Finance: how two assets move together
  • Marketing: spend versus sales

Correlation in practice: reading r, causation, outliers and curved relationships

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

The correlation coefficient, r, measures how closely two variables move together in a straight-line pattern, on a scale from −1 to +1. It is one of the most quoted statistics in news, business and research, and one of the most misunderstood. This guide shows how to read r and r², works through an example with study hours and test scores, explains why correlation is not causation, and shows how outliers and curved patterns fool the coefficient.

Reading the number

An r close to +1 means that as one variable rises, the other tends to rise in a near straight line; close to −1, that one falls as the other rises; close to 0, that there is little straight-line relationship. As rough guides, values around 0.3 are often described as weak, 0.5 as moderate and 0.7 or more as strong, though what counts as strong depends on the field. Squaring r gives r², the share of variation in one variable that a straight line on the other explains.

A worked example: study hours and scores

A teacher records the weekly study hours and test scores of seven students: 2, 3, 5, 6, 8, 9 and 10 hours, with scores of 58, 52, 70, 64, 75, 88 and 80. The correlation is about 0.90, a strong positive relationship, and r² is about 0.82, so about 82% of the variation in scores lines up with study hours in this small group.

The teacher cannot conclude from this alone that extra study causes higher scores; motivated students may both study more and score higher for other reasons. But the pattern supports encouraging regular study, and a larger sample would make the estimate more reliable.

Correlation is not causation

Two variables can move together because a third factor drives both. Ice cream sales and drowning incidents both rise in summer, not because ice cream causes drowning but because hot weather increases both. Correlations can also arise by chance, especially when many pairs of variables are tested. Establishing causation needs experiments, natural experiments or careful reasoning about mechanisms, not just a high r.

Outliers can make or break r

A single extreme point can create a strong correlation where none exists, or hide one that does. Always plot the data before trusting r. If one point sits far from the others, calculate r with and without it, and report both if the difference matters. Rank-based correlation, Spearman's coefficient, is less sensitive to outliers because it uses the order of the values rather than the values themselves.

Curved relationships

The coefficient measures straight-line relationships only. A U-shaped pattern, such as performance rising with moderate stress and falling with extreme stress, can have an r close to zero despite a strong relationship. A scatter plot reveals such shapes at once. When the pattern curves but always rises or always falls, Spearman's correlation captures it better than Pearson's.

Restricted ranges

Correlations look weaker when the range of one variable is limited. Among students admitted to a selective university, entrance test scores may correlate only weakly with later grades, partly because the admissions process removed lower scorers. The same test might show a much stronger correlation across all applicants. Remember the range of the data when interpreting r.

Sample size

With small samples, correlations can be large by chance. A correlation of 0.6 from 8 data points is much less convincing than the same value from 200. Statistical tests and confidence intervals for r take the sample size into account and help judge whether a correlation is likely to be real.

Common mistakes

  • Treating correlation as proof of cause and effect.
  • Calculating r without looking at a scatter plot.
  • Missing curved relationships because r is near zero.
  • Over-interpreting correlations from very small samples.

Related tools

To fit a line through the data, use Linear Regression Calculator. For testing significance, try P-Value Calculator, and for spread, Standard Deviation Calculator.

Correlation in spreadsheets

In Excel and Google Sheets, =CORREL(range1, range2) returns Pearson's correlation coefficient for two columns of paired data, and =PEARSON does the same. For Spearman's rank correlation, rank both columns with RANK.AVG and then apply CORREL to the ranks. Adding a scatter chart beside the calculation lets you check visually that the coefficient matches the pattern.

Correlation matrices

With many variables, analysts calculate a correlation matrix showing r for every pair, often displayed as a colour-coded heat map. It quickly reveals which variables move together, such as different sales figures across product lines. But with many pairs, some strong-looking correlations will appear by chance, so treat unexpected patterns as ideas to investigate rather than conclusions.

Reporting a correlation

When reporting a correlation, give the coefficient, the number of data points and, ideally, a confidence interval or p-value, such as "r = 0.90, n = 7". Mention whether you used Pearson's or Spearman's coefficient and describe the pattern in words. A short sentence such as "students who studied more tended to score higher" helps readers understand what the number means without overstating it.

Limits

Calculations are exact for the data entered; correlation describes association, not causation.

Frequently asked questions

What does the correlation coefficient tell you?

The strength and direction of a linear relationship between two variables. r = 1 is a perfect positive line, r = −1 a perfect negative line, and r = 0 means no linear relationship.

What is a strong correlation?

Rules of thumb vary by field, but |r| above about 0.7 is usually called strong, 0.4 to 0.7 moderate, 0.2 to 0.4 weak and below 0.2 negligible. Significance also depends on the sample size.

What is the difference between Pearson and Spearman correlation?

Pearson measures straight-line relationships using the actual values. Spearman uses ranks, so it captures any monotonic relationship and is less affected by outliers and non-normal data.

What does r squared mean?

The proportion of the variance in Y explained by a linear relationship with X. An r of 0.8 gives r² = 0.64, meaning 64% of the variation is accounted for by the line.

Does correlation mean causation?

No. Two variables can be correlated because one causes the other, because a third factor drives both, or by coincidence. Ice cream sales and drownings both rise in summer without one causing the other.

How many data points do I need?

At least three to compute r, but small samples give unreliable results: a strong r can occur by chance with five points. Thirty or more pairs give a much more trustworthy estimate.

How is the p-value for a correlation calculated?

From t = r√(n − 2) ÷ √(1 − r²), compared with a t distribution with n − 2 degrees of freedom. A small p-value means a correlation this strong would be unlikely if the true correlation were zero.

Can I calculate correlation in Excel?

Yes. CORREL or PEARSON returns Pearson's r, and RSQ returns r squared. Excel has no built-in Spearman function; rank both columns with RANK.AVG first and then apply CORREL to the ranks.