Wilcoxon Signed-Rank Test Calculator

Wilcoxon signed-rank test for paired data or one sample: W+, W−, z and an exact p-value for up to 100 pairs, with ties and zeros handled.

Use a point for decimals (1.5), no thousands separators, and separate numbers with spaces or a comma and a space.
Differences are first − second.
Choose this before looking at the data.

Results

p-value (two-sided, exact)
0.0398
What this means
If the differences were symmetric around zero, signed ranks this unbalanced would be unusual (p below 0.05). This is evidence that the median difference is not zero, not proof.
W (the smaller of W+ and W−)
16.00
W+ (sum of ranks of positive differences)
16.00
W− (sum of ranks of negative differences)
75.00
Non-zero differences used (n)
13
Zero differences dropped
0
z (normal approximation)
-2.0616
p-value from the normal approximation (two-sided)
0.0392
Mean of W+ under the null, n(n + 1)/4
45.50
Standard deviation of W+ (tie-corrected)
14.3091
Median of the differences (zeros included)
-3.1
Ties
No ties among the |differences|
Method
Exact: every one of the 2ⁿ ways to put + or − signs on the ranks is counted, so the p-value does not rely on an approximation.

How it’s calculated

The Wilcoxon signed-rank test is the rank-based alternative to the paired t-test (or the one-sample t-test). It tests whether the median difference is zero without assuming the differences are normally distributed. Work out each difference, drop any that are exactly zero, rank the remaining differences by size ignoring their signs (tied sizes share the average rank), then add up the ranks of the positive and of the negative differences.

d = first − second (or value − hypothesized median) W+ = sum of ranks of positive d W− = sum of ranks of negative d W+ + W− = n(n + 1)/2 W = min(W+, W−) normal approximation: mean = n(n + 1)/4 variance = n(n + 1)(2n + 1)/24 − Σ(t³ − t)/48 (t = size of each group of tied ranks) z = (W+ − mean) / √variance

For up to 100 non-zero differences the calculator gives the exact p-value: under the null hypothesis each rank is equally likely to be positive or negative, so it counts all 2ⁿ sign patterns (with the tied ranks as they are) and finds how many give a W+ at least as extreme. The normal approximation, with an optional continuity correction, is shown as well.

Example (Handbook of Biological Statistics, LibreTexts): aluminium in the wood of 13 poplar clones, August against November. The differences have no ties and no zeros; the positive ones (5.6, 2.2, 1.2) have ranks 8, 5 and 3, so W+ = 16 and W− = 91 − 16 = 75. The exact two-sided p-value is 2 × 163/8192 = 0.0398, matching the book (W = 16, P = 0.040). The normal approximation gives z = −2.06 and p = 0.039. These are the default values.

A small p-value says the signs of the ranks are too unbalanced to be chance alone if the true median difference were zero. It does not tell you how large the difference is.

Frequently asked questions

When should I use the Wilcoxon signed-rank test instead of a paired t-test?

When the differences are clearly non-normal, for example strongly skewed or with outliers, especially in small samples. If the differences look roughly normal, the paired t-test is usually more powerful.

What happens to zero differences?

They are dropped and n is reduced, which is Wilcoxon’s original method and the one in most textbooks. The count of dropped zeros is shown. Some software uses other conventions, so p-values can differ slightly when there are zeros.

Is the exact p-value still exact with ties?

Yes, conditionally: it enumerates all sign patterns using the tied (average) ranks actually observed, which is the standard exact permutation test. Tables of critical values assume no ties, so they can differ slightly.

How is this different from the sign test?

The sign test only counts how many differences are positive. The signed-rank test also uses how large each difference is, through its rank, so it is usually more powerful.

Embed this calculator

Add this free calculator to your own website. Copy the code below into your page’s HTML:

Need this calculator branded, changed or built around your own prices?See custom business solutions →

Sources

Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.

Added · Last updated · How we check our calculators

Spotted a mistake or missing option? Report a problem· Suggest a calculator