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.
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:
- 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.
- 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. - 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.
- 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 ton(n−1)(2n+5)/18with no ties). The tool reportsz = S/√Var(S)and the two-tailed p-valueerfc(|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
Frequently asked questions
Sources & references
- Kendall, M.G. (1938) — “A New Measure of Rank Correlation,” Biometrika 30(1–2), 81–93
- scipy.stats.kendalltau — reference implementation for τ-b, the tie-corrected variance, and the two-tailed p-value
- NIST/SEMATECH e-Handbook of Statistical Methods — rank correlation, tie handling, and the normal-approximation significance test
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
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.