Wilcoxon Signed-Rank Calculator

The Non-Parametric Alternative to the Paired T-Test

When before-and-after measurements are paired — the same patients before and after treatment, the same products before and after a process change — but the differences don't look normally distributed, the Wilcoxon signed-rank test steps in. It ranks the absolute size of each paired difference, then checks whether positive or negative differences dominate those ranks, without assuming anything about the shape of the underlying distribution.

The Formula

W+ = sum of ranks with positive differences
W− = sum of ranks with negative differences
W = min(W+, W−)
z = (W − meanW) / σW (continuity-corrected)
meanW = n(n+1)/4, σW tie-corrected

Zero differences are dropped before ranking, and n refers to the count of non-zero differences.

Worked Example

Before: 10, 12, 9, 15, 11, 14. After: 12, 13, 8, 17, 10, 16.

Wilcoxon signed-rank test result
QuantityValue
Differences (before − after)−2, −1, 1, −2, 1, −2
W+4.0
W−17.0
W4.0
z−1.2865
Two-tailed p-value0.1983

Computed directly from the calculator's ranking and continuity-corrected formula.

Where This Calculation Matters

  • Pre/post intervention studies — measuring symptom scores, performance metrics, or ratings before and after a treatment when the differences are skewed or contain outliers.
  • Small paired samples — with limited pairs, verifying that differences are normally distributed is often impossible, making this test a safer default than the paired t-test.
  • Ordinal paired data — comparing ranked or ordinal ratings collected from the same subjects under two conditions.
Note: The normal approximation used here needs at least six non-zero paired differences to be reliable, which is why the calculator enforces that minimum.

How to Use This Calculator

  1. Enter the "before" values as a comma-separated list (at least 6 paired observations).
  2. Enter the matching "after" values as a comma-separated list, in the same order.
  3. Select Calculate to get the W statistic, z-score, and two-tailed p-value.

Related Calculations

When normality of the differences can be assumed, use the Paired T-Test Calculator instead. For two independent (unpaired) groups, see the Mann-Whitney U Test Calculator.