induwara.lk
induwara.lkStatistics · Data science

Kendall's Tau Correlation Calculator

Paste two columns of numbers to get Kendall's τ-a and τ-b (rank correlation), the full concordant/discordant pair breakdown, and a significance test (z and two-tailed p-value) — with proper tie correction. Matched to scipy.stats.kendalltau, runs entirely in your browser — no signup, nothing uploaded.

By Induwara AshinsanaUpdated Jul 8, 2026
Kendall's tau correlation

Numbers separated by commas, spaces, or new lines. Paste two Excel columns here to fill both.

Must have the same count as X — each X needs a matching Y.

Examples
Coefficient
Significance
Decimals
Kendall's τ-a
0.6000
Range −1 to 1 · n = 5
τ-a (uncorrected)
0.6000
S / [n(n−1)/2]
τ-b (tie-corrected)
0.6000
No ties — equals τ-a
Interpretation
Strong positive

Pair breakdown

n (points)
5
Total pairs n₀
10
n(n−1)/2
Concordant C
8
Discordant D
2
S = C − D
6
Tied in X (n₁)
0
Tied in Y (n₂)
0
Tied in both
0

Significance test

S (score)
6
Var(S)
16.6667
z-score
1.4697
p-value (two-tailed)
0.1416
At α = 0.05Not significant

Small sample (n = 5): the normal approximation is rough below about 10 points. For a definitive result on few pairs, use an exact permutation test or a Kendall critical-value table.

Cross-check. τ-b from tie-group counting is 0.6000; recomputing it straight from the concordant/discordant/tied pair tallies gives 0.6000. The two independent routes reconcile, matching scipy.stats.kendalltau.

Paired data

#xᵢyᵢ
11.00002.0000
22.00001.0000
33.00004.0000
44.00003.0000
55.00005.0000

Method: classify all n(n−1)/2 pairs, S = C − D; τ_a = S/n₀, τ_b = S/√((n₀−n₁)(n₀−n₂)); significance via z = S/√Var(S) with the tie-corrected Var(S) — Kendall (1938) / Kendall & Gibbons (1990) / NIST e-Handbook, matched to scipy.stats.kendalltau. Nothing leaves this page.

How it works

Kendall's τ (tau) measures the strength and direction of the monotonicassociation between two paired variables by comparing every possible pair of observations. Introduced by Maurice Kendall in 1938, it runs from −1 (a perfectly reversed order) through 0 (no monotonic association) to +1 (a perfectly matching order). Unlike Pearson's r it uses only the order of the values, so it is resistant to outliers and to curved-but-monotonic relationships.

For n observations there are n(n−1)/2 unordered pairs. The tool walks all of them in four steps:

  1. Parse and pair. Each box is tokenised on commas, spaces, and new lines, coerced to numbers, and checked: both columns must be the same length with at least 3 pairs. Non-numeric tokens are named in a clear error rather than silently dropped.
  2. Classify each pair. For a pair (i, j) with a = sign(xⱼ−xᵢ) and b = sign(yⱼ−yᵢ): it is concordant when a·b > 0, discordantwhen a·b < 0, tied in X when a = 0, and tied in Ywhen b = 0. Kendall's score is S = C − D.
  3. Compute τ. With no ties, tau-a applies:τ_a = S / [n(n−1)/2]When values tie, tau-a can no longer reach ±1, so the tie-corrected tau-b is used instead:τ_b = S / √[(n₀ − n₁)(n₀ − n₂)]where n₀ = n(n−1)/2, n₁ = Σ tₖ(tₖ−1)/2 over tied groups in X, and n₂ = Σ uₗ(uₗ−1)/2 over tied groups in Y. With no ties n₁ = n₂ = 0 and τ_b = τ_a, so Auto mode reports τ-a; when ties appear it switches to τ-b.
  4. Significance. Under the null hypothesis that the true τ is 0, the score S is asymptotically normal with mean 0 and the tie-corrected variance Var(S) of Kendall & Gibbons (which reduces to n(n−1)(2n+5)/18 with no ties). The tool reports z = S/√Var(S) and the two-tailed p-value erfc(|z|/√2). The normal approximation is reliable for n ≳ 10; for smaller samples it is labelled approximate, and an exact permutation test is preferable.

As a credibility check the calculator recomputes τ-b a second way — straight from the concordant/discordant/tied pair tallies instead of the tie-group counts — and confirms both routes agree to floating-point precision, matching scipy.stats.kendalltau. A strong τ is evidence of monotonic association, never of causation on its own. For a straight-line fit on raw values use the Pearson correlation calculator; for the squared-rank-gap form of rank correlation use the Spearman correlation calculator.

Worked examples

No ties (n = 5) — X = [1, 2, 3, 4, 5], Y = [2, 1, 4, 3, 5]

  1. X is strictly increasing, so each pair is concordant when Y rises, discordant when Y falls
  2. Of the 10 pairs: concordant C = 8, discordant D = 2 → S = 6
  3. τ-a = S / [n(n−1)/2] = 6 / 10 = 0.60 (no ties, so τ-b = 0.60 too)
  4. Var(S) = 5·4·15 / 18 = 16.6667; z = 6/√16.6667 = 1.4697
  5. p = erfc(1.4697/√2) = 0.1416 → not significant at α = 0.05 (expected for n = 5)

With ties (n = 5) — X = [1, 1, 2, 3, 3], Y = [1, 2, 2, 3, 4]

  1. Of the 10 pairs: C = 7, D = 0, tied in X only = 2, tied in Y only = 1
  2. S = 7, n₀ = 10, n₁ = 2 (the two 1's and two 3's in X), n₂ = 1 (the two 2's in Y)
  3. τ-a = 7 / 10 = 0.700
  4. τ-b = 7 / √[(10−2)(10−1)] = 7 / √72 = 0.8250 → Auto mode reports τ-b
  5. The tie correction pulls τ-b above τ-a, exactly why it matters with real data

Perfect positive (n = 5) — X = [1, 2, 3, 4, 5], Y = [2, 4, 6, 8, 10]

  1. Every pair is concordant → C = 10, D = 0, S = 10
  2. τ-a = τ-b = 10 / 10 = 1 (a perfect matching order)
  3. Var(S) = 16.6667; z = 10/√16.6667 = 2.4495
  4. p = erfc(2.4495/√2) = 0.0143 → significant at α = 0.05
  5. Note z stays finite at τ = 1 — Kendall's normal test is well defined at ±1

Frequently asked questions

Sources & references

The formulas on this page — including the Kendall & Gibbons (1990) tie correction and tie-adjusted variance — were last cross-checked against these sources on 2026-07-08. Kendall's τ is a stable mathematical definition, so this tool needs no rate or schedule updates; only the worked examples are periodically re-reconciled against SciPy.

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want to suggest an improvement?

Email me at [email protected] — most fixes ship within 24 hours.