Wilcoxon Signed-Rank Test Calculator

StatisticsLast updated: August 22, 2026

The Wilcoxon signed-rank test examines the difference between two measurements taken from the same subjects (before and after, two different methods, matched pairs). It is the nonparametric counterpart of the paired samples t-test and does not require the differences to be normally distributed; it only asks that they can be ranked.

The test uses both the sign and the magnitude order of the differences: the differences are computed, pairs with a difference of zero are dropped, the absolute values of the remaining differences are ranked, and the rank sum of the positive differences (W⁺) is compared with that of the negative ones (W⁻). This calculator reports W⁺, W⁻, the reported T = min(W⁺, W⁻), the tie-corrected z, the two-tailed p, the r effect size, a Hodges-Lehmann confidence interval for the median difference, and a table of the differences and signed ranks.

Each value belongs to one subject; the order in the two measurements must refer to the same person.
Enter the same number of values as in measurement 1; the ith value is the second measurement of the ith subject.
The 'Asymp. Sig. (2-tailed)' row in SPSS is based on the uncorrected z.
Sets the false-positive risk. In the social sciences the common choice is 5%.

Wilcoxon Signed-Rank Test Formulas

Differences:        dᵢ = x₂ᵢ − x₁ᵢ  (pairs with dᵢ = 0 are dropped)
Ranking:            |dᵢ| ranked from smallest to largest, average ranks for ties
Rank sums:          W⁺ = Σ (ranks where dᵢ > 0) ,  W⁻ = Σ (ranks where dᵢ < 0)
Test statistic:     T = min(W⁺, W⁻)   and   W⁺ + W⁻ = n(n+1)/2
Expected value:     μ_W = n(n+1) / 4
Standard deviation: σ_W = √[ n(n+1)(2n+1)/24 − Σ(t³ − t)/48 ]
z statistic:        z = (W⁺ − μ_W) / σ_W
Effect size:        r = |z| / √(2n)   (alternative convention: |z| / √n)
Median estimate:    Δ̂ = median[(dᵢ + dⱼ)/2] ,  i ≤ j  (Walsh averages)

Dropping the zero differences is Wilcoxon's classic approach; Pratt's method keeps those pairs in the ranking and gives a slightly different p. Σ(t³ − t) is the variance correction for tied absolute differences. The p-value is computed with the normal approximation; for n < 10 the exact table should be used.

How to Calculate

  1. Paste the two measurements taken from the same subjects into the separate boxes, in the same order: the ith values must belong to the same person.
  2. The two measurements must contain the same number of values; if data is missing for a subject, remove that pair entirely.
  3. Choose which p-value to report: use the uncorrected version if you are comparing with SPSS output.
  4. Set the significance level (α); the confidence interval for the median change is computed at the 1 − α level.
  5. In the signed-rank table, review which pairs increased, which decreased, and which were dropped for having a zero difference.
  6. Read the r effect size and the box plot of the differences alongside T, z, and p; significance alone does not show the practical importance of a change.

Worked Examples

Achievement scores before and after training

Eleven of the 12 pairs increased and none decreased; one pair had a difference of zero and was dropped, leaving an effective n = 11. With W⁺ = 66, W⁻ = 0, T = 0, and z = 2.949, p = 0.003, so the post-training scores are significantly higher. The median of the differences is 6.00 and r = 0.629, a large effect; the 95% confidence interval for the median change runs from 4.50 to 7.00 points.

T test statistic: 0.0 · Positive rank sum (W⁺): 66.0 · Negative rank sum (W⁻): 0.0

No difference between two measurement methods

Five of the 10 pairs increased and five decreased; W⁺ = 28, W⁻ = 27, and T = 27. With z = 0.052 and p = 0.958, there is no systematic difference between the two methods. The median of the differences is 0 and r = 0.012, a negligible effect; the 95% confidence interval for the median change runs from -1.50 to 2.00 and contains zero.

T test statistic: 27.0 · Positive rank sum (W⁺): 28.0 · Negative rank sum (W⁻): 27.0

A small sample with an outlier — with continuity correction

The measurement fell for all eight patients: W⁺ = 0, W⁻ = 36, and T = 0. With the continuity correction z = -2.466 and p = 0.014, the decrease is significant. Although the 42-unit extreme drop in one patient distorts the mean, the rank-based test is unaffected by it; the median of the differences is -7.50 and r = 0.634, a large effect. The 95% confidence interval for the median change runs from -24.50 to -5.50.

T test statistic: 0.0 · Positive rank sum (W⁺): 0.0 · Negative rank sum (W⁻): 36.0

Frequently Asked Questions

What is the difference between the Wilcoxon signed-rank test and the Mann-Whitney U test?
The Wilcoxon signed-rank test is for dependent (matched) measurements: the same subject is measured twice. The Mann-Whitney U test compares two groups that are independent of each other. The confusion in naming comes from the Mann-Whitney U test also being known as the 'Wilcoxon rank-sum test'; the two tests are different and are chosen according to the design.
What happens to pairs whose difference is zero?
Under Wilcoxon's classic approach these pairs are dropped entirely and the effective sample shrinks; this calculator follows the same route and reports how many pairs were dropped. Pratt's method instead includes the zero differences in the ranking and subtracts them from the rank sums, which produces a slightly more conservative p. When there are many zero differences the power of the test falls sharply; in that case the precision of the measurement needs to be improved.
When should I use this test instead of the paired samples t-test?
Wilcoxon is preferred when the distribution of the differences departs clearly from normality, when the sample is small (n < 30), or when there are outliers among the differences. If the data is on an ordinal scale (a pain score, a satisfaction rating), the mean of the differences is not meaningful in the first place, so Wilcoxon is the correct choice. When normality holds, the paired samples t-test is slightly more powerful.
How do I get the same result in SPSS, R, and Excel?
In SPSS, follow Analyze → Nonparametric Tests → Related Samples; the 'Asymp. Sig. (2-tailed)' in the output is the uncorrected p-value from this calculator. In R, wilcox.test(x2, x1, paired = TRUE, correct = FALSE) gives the same z and p; adding conf.int = TRUE also prints the Hodges-Lehmann confidence interval. Excel has no built-in function, so the ranks have to be set up by hand.
What assumptions does the test rest on?
The pairs must be independent of each other, the differences must be at least on an ordinal scale, and for the median difference to be interpretable the distribution of the differences should be roughly symmetric around the median. Normality is not required. If the symmetry assumption is also doubtful, the sign test, which uses only the signs, is preferable; because it discards the magnitude of the differences, however, it is less powerful.
Why is the effect size reported in two different ways?
There are two conventions in the literature: Field's r = |z|/√(2n) uses the total number of observations (2n, since each subject is measured twice); the other convention uses the number of pairs, r = |z|/√n. The second produces a larger value. Stating clearly in your methods section which convention you used prevents results from being compared incorrectly.
What should I use for more than two repeated measurements?
If the same subjects were measured under three or more conditions, use the Friedman test; applying Wilcoxon to every pairwise comparison inflates the Type I error rate. If Friedman is significant, pairwise comparisons can be made with Wilcoxon and a Bonferroni correction. The parametric alternative is repeated measures ANOVA.