Wilcoxon Signed-Rank Test Calculator
Test whether the median difference between two paired samples is zero. Paste your “before / after” (or “A / B matched”) data below. The tool will remove zero differences, rank the absolute differences (with ties), compute W+ and W−, and give an exact two-sided p-value for n ≤ 15 non-zero pairs or a normal approximation for larger n.
Non-zero pairs (n)
—
Pairs with diff = 0 are removed
W+
—
Sum of positive signed ranks
W−
—
Sum of negative signed ranks
Test statistic (T)
—
T = min(W+, W−)
p-value (two-sided)
—
—
z (approx.)
—
Used when n is large
How the Wilcoxon signed-rank test works
This is a non-parametric alternative to the paired t-test. It does not assume that the differences are normally distributed, only that they are symmetrically distributed.
- Compute differences: di = Bi − Ai.
- Remove pairs where di = 0.
- Rank the absolute differences |di| from smallest to largest (average ranks for ties).
- Assign each rank the sign of its original difference.
- Sum positive ranks → W+, sum negative ranks (absolute) → W−.
- Test statistic: T = min(W+, W−).
Exact vs. normal approximation
For very small samples the exact distribution is preferred. This tool enumerates all 2ⁿ sign patterns if n ≤ 15 and returns the exact two-sided p. For n > 15 it uses the usual normal approximation:
Mean: \( \mu_T = \frac{n(n+1)}{4} \)
Variance: \( \sigma_T^2 = \frac{n(n+1)(2n+1)}{24} \times \text{tie correction} \)
z: \( z = \frac{T - \mu_T - 0.5}{\sigma_T} \) (two-sided p = 2(1 − Φ(|z|)))
FAQs
What if I get p very close to 0?
It means the observed rank pattern is very unlikely under the null that median difference = 0.
Can I use it for Likert scales?
Yes, Wilcoxon is often used for ordinal paired data like Likert 1–5 before/after.
Full original guide (expanded)
If you report results academically, include: test used (Wilcoxon signed-rank), sample size after removing zeros, W value (often the smaller), and p-value (exact or approximate). Example: “A Wilcoxon signed-rank test showed that the training increased scores, T = 5, n = 10, p = 0.031 (two-tailed).”