Correlation Calculator (Pearson, Spearman & Significance)

This free correlation calculator finds the Pearson correlation coefficient r, Spearman’s rank correlation rs and Kendall’s tau-b from two lists of paired data. Paste two columns from Excel or Google Sheets and you get r, r², the covariance, the p-value for testing whether the correlation is significant, a confidence interval for ρ, a scatter plot, the step-by-step working with your numbers, an APA-style sentence and the exact TI-84 keystrokes. Everything runs in your browser and updates as you type.

Contents

How to Use the Correlation Calculator

  1. Enter your paired data. In X, Y pairs, put one pair per line, or paste two columns straight from a spreadsheet. Two rows (x on the first, y on the second) also work. Use Separate X and Y lists if your data is in L1/L2 form. A header row is skipped automatically.
  2. Pick a method. Pearson r for straight-line relationships between measurements, Spearman rs for ranks, ordinal data or curved-but-monotonic patterns, Kendall τ for small samples with many ties.
  3. Read the results. The coefficient, r², two-sided p-value and confidence interval appear at the top, with a plain-English verdict, a table comparing all three methods and the scatter plot.
  4. Only have summary numbers? The Summary stats / r and n tab computes r from n, Σx, Σy, Σx², Σy² and Σxy, or tests a correlation you already know (for example r = 0.45 with n = 30).

Rows where one value is blank or not a number (such as NA) are left out, and the calculator tells you how many complete pairs it used. Copy share link saves your data in the URL.

Pearson Correlation Coefficient Formula

Pearson’s r measures how closely the points follow a straight line:

r = Σ(x − x̄)(y − ȳ) / √[Σ(x − x̄)² · Σ(y − ȳ)²] = Sxy / √(Sxx · Syy)

The same value comes from the computational form used in many textbooks:

r = [nΣxy − ΣxΣy] / √([nΣx² − (Σx)²] · [nΣy² − (Σy)²])

Equivalently, r is the sample covariance divided by the product of the standard deviations: r = sxy / (sx sy), where sxy = Sxy / (n − 1). Covariance has units (x-units × y-units), so it is hard to judge; dividing by the standard deviations turns it into a unit-free number between −1 and +1.

Worked Example: Hours Studied vs Exam Score

The calculator opens with this example (8 students):

Hours studied x2356891012
Exam score y6570727880858492
  1. Sums: n = 8, Σx = 55, Σy = 626, Σx² = 463, Σy² = 49,538, Σxy = 4,517.
  2. Means: x̄ = 6.875, ȳ = 78.25.
  3. S values: Sxy = 4,517 − 55 × 626 / 8 = 213.25; Sxx = 463 − 55² / 8 = 84.875; Syy = 49,538 − 626² / 8 = 553.5.
  4. r = 213.25 / √(84.875 × 553.5) = 0.9839, so r² = 0.9680: about 97% of the variation in scores is shared with hours studied.
  5. Covariance: sxy = 213.25 / 7 = 30.464.
  6. Test: t = 0.9839 × √6 / √(1 − 0.9680) = 13.475 with df = 6, two-sided p = 0.0000104. The 95% confidence interval for ρ is 0.910 to 0.997.

In APA style: r(6) = .98, p < .001, 95% CI [.91, .997]. Spearman’s rs for the same data is 0.976 and Kendall’s τ-b is 0.929 (p = 0.0004, exact).

Spearman Rank Correlation (and How Ties Work)

Spearman’s rs is simply Pearson’s r computed on the ranks of x and of y. It measures whether y tends to rise (or fall) as x rises, even if the pattern is curved, and it is far less sensitive to outliers.

With no ties the shortcut formula is exact:

rs = 1 − 6Σd² / [n(n² − 1)]

where d is the difference between the two ranks of each pair. In the worked example only scores 85 and 84 swap places, so Σd² = 2 and rs = 1 − 12 / 504 = 0.976.

Ties: tied values share the average of the ranks they occupy. Two values tied for 2nd and 3rd both get 2.5; three values tied for 5th–7th all get 6. Once there are ties, the shortcut formula is no longer exact, so this calculator always uses Pearson’s formula on the averaged ranks, the same as SciPy, R and SPSS. Example: x = 1, 2, 2, 3, 4, 4, 4, 5, 6, 7 and y = 2, 1, 3, 3, 5, 4, 6, 6, 8, 7 give rs = 0.9381, while the shortcut would give 0.9394.

Kendall’s Tau-b

Kendall’s tau looks at every pair of points. A pair is concordant if x and y move in the same direction and discordant if they move in opposite directions. Tau-b corrects for ties:

τb = (C − D) / √[(n₀ − n₁)(n₀ − n₂)]

Here n₀ = n(n − 1)/2, and n₁ and n₂ count the tied pairs in x and in y. The example data has 27 concordant pairs and 1 discordant pair, so τb = 26 / 28 = 0.929. For small samples without ties the calculator gives the exact p-value; otherwise it uses the tie-corrected normal approximation (as SciPy’s kendalltau and R’s cor.test do).

Pearson vs Spearman vs Kendall: Which to Use

MethodMeasuresUse it whenOutliers
Pearson rStraight-line (linear) associationBoth variables are measurements and the scatter plot looks roughly linearSensitive
Spearman rsMonotonic association, on ranksOrdinal data (ratings, Likert scales), skewed data, curved but always-increasing patternsRobust
Kendall τ-bConcordant minus discordant pairsSmall samples or many ties; easy to explain as a probabilityRobust

If Pearson and Spearman disagree a lot, look at the scatter plot: there is usually an outlier or a curve. A perfect U-shape can give r ≈ 0 even though x and y are strongly related.

Is the Correlation Significant? t-Test, p-Value and Critical r

To test H₀: ρ = 0 (no correlation in the population) against ρ ≠ 0:

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

The two-sided p-value comes from Student’s t distribution. This is exactly the test the TI-84 runs in LinRegTTest, and the test behind the slope p-value in the linear regression calculator. For a refresher on p-values, see the hypothesis test calculator.

Critical values of r (two-sided): |r| must be larger than these to be significant.

n (pairs)α = 0.05α = 0.01
50.8780.959
80.7070.834
100.6320.765
150.5140.641
200.4440.561
300.3610.463
500.2790.361
1000.1970.256

Significant does not mean strong: with n = 100, r = 0.2 is significant at 5% but x explains only 4% of the variation in y.

Confidence Interval for r (Fisher z)

r is not normally distributed, so the interval uses Fisher’s z transformation:

z = ½ ln[(1 + r)/(1 − r)],   SE = 1/√(n − 3),   CI = tanh(z ± z* · SE)

z* is 1.96 for 95% (choose 80% to 99.9% in the calculator). The interval is not symmetric around r, and it needs at least 4 pairs. For the example, z = 2.4062, SE = 0.4472, giving 0.910 to 0.997.

How to Interpret r: Strength and Direction

|r|Common label
0.00 – 0.19Very weak
0.20 – 0.39Weak
0.40 – 0.59Moderate
0.60 – 0.79Strong
0.80 – 1.00Very strong

The sign gives the direction: positive means y tends to increase with x, negative means it tends to decrease. These labels are a convention (Evans, 1996), not a rule. Cohen’s guidelines call 0.1 small, 0.3 medium and 0.5 large, and in physics a correlation of 0.9 might be disappointing. Always remember that correlation is not causation: a third variable can drive both.

r vs r²: What Is the Difference?

r shows direction and strength of the linear relationship (−1 to +1). r², the coefficient of determination, is the proportion of the variance in y explained by the straight line (0 to 1). r = 0.5 sounds “half”, but r² = 0.25 means only 25% of the variation is shared. r² loses the sign, so always report r for correlation. To fit and use the line itself, use the linear regression calculator.

How to Find the Correlation Coefficient on a TI-84

  1. Turn diagnostics on (once): press 2nd 0 (CATALOG), scroll to DiagnosticOn, press ENTER twice. On a TI-84 Plus CE with OS 5.3 or later you can also press MODE and set STAT DIAGNOSTICS to ON. Without this, r and r² are not shown.
  2. Enter the data: STAT 1 (Edit), type x into L1 and y into L2.
  3. Run LinReg: STAT ▶ (CALC) 4 LinReg(ax+b), Xlist L1, Ylist L2, Calculate. For the example the screen shows r² = .9680118352 and r = .9838759247.
  4. p-value: STAT ◀ (TESTS), F:LinRegTTest, β & ρ ≠ 0, Calculate. It shows t = 13.47, p = 1.04E−5 and r.
  5. Spearman: the TI-84 has no Spearman command. Enter the ranks (the calculator above lists them for your data, with averaged ties) into L3 and L4 and run LinReg(ax+b) L3,L4; the r shown is rs.

The calculator prints these keystrokes with your own numbers. Practise them on our TI-84 Plus CE calculator online. For the mean and standard deviation of each list on its own, use the standard deviation calculator.

Why This Correlation Calculator Is Different

  • Three coefficients at once: Pearson, Spearman (correct average-rank ties) and Kendall tau-b, compared side by side with a note when they disagree.
  • Full inference: t, df, two-sided p-value, and a Fisher-z confidence interval at any level from 80% to 99.9%, plus an APA-style sentence.
  • TI-84 keystrokes with your own lists, the screen values you should see, and the rank lists for Spearman on a calculator. No other top-ranking correlation calculator does this.
  • Paste anything: two columns, two rows, separate lists, headers and blank cells. Or start from Σ sums or a known r and n.
  • Step-by-step working using your numbers, with a deviations table for Pearson and a rank table with d² for Spearman.
  • Checked against SciPy and NumPy (pearsonr, spearmanr, kendalltau and covariance) on more than 400 datasets, including ties, perfect correlations and n = 2.

Correlation Calculator FAQ

Find the means of x and y, then r = Σ(x − x̄)(y − ȳ) / √[Σ(x − x̄)² · Σ(y − ȳ)²]. Paste your data above to see every step with your own numbers, or on a TI-84 turn DiagnosticOn and run LinReg(ax+b) L1, L2.

It depends on the field. As a rough guide, |r| of 0.8 or more is very strong, 0.6–0.8 strong, 0.4–0.6 moderate and below 0.4 weak. In social sciences r = 0.3 can be important, while lab measurements often expect r above 0.95.

A negative r means that as x increases, y tends to decrease, for example hours of screen time and sleep. The strength is judged by the size of |r|, so r = −0.8 is just as strong as r = +0.8.

Use Spearman when the data are ranks or ordinal ratings, when the relationship is curved but always increasing or decreasing, or when outliers or strong skew would distort Pearson’s r. Use Pearson for roughly linear relationships between measurements.

Compute t = r√(n − 2)/√(1 − r²) with n − 2 degrees of freedom and find the two-sided p-value. If p is below your α (usually 0.05), the correlation is statistically significant. The calculator does this automatically and shows the critical value of r.

r is the correlation coefficient (−1 to 1) and shows direction and strength. r² is the coefficient of determination (0 to 1), the share of the variation in y explained by a straight line in x. r = 0.7 gives r² = 0.49, so 49%.

Diagnostics are off. Press 2nd 0 for the CATALOG, choose DiagnosticOn and press ENTER twice (or set STAT DIAGNOSTICS to ON in MODE on a TI-84 Plus CE with newer OS). Then run LinReg(ax+b) again.

No. A strong correlation only shows that two variables move together. A hidden third variable, reverse causation or pure coincidence can all produce it. Establishing cause needs an experiment or careful study design.

Ti84CalcPro is not affiliated with or endorsed by Texas Instruments. TI-84 Plus CE is a trademark of Texas Instruments.