Wilcoxon signed-rank test calculator

Paste paired measurements, such as before and after, to test whether the differences are centred on zero without assuming normal data. Leave the second box empty to test one sample against a hypothesised median.

Numbers separated by commas, spaces or semicolons.
Same length and order as sample 1; the test uses sample 1 − sample 2. Leave empty for a one-sample test.
Used only when sample 2 is empty: the test uses each value minus this median.
Between 0 and 1, usually 0.05.
W (the smaller of W⁺ and W⁻)2
p-value0.02977
Result at α
p < α: significant, reject the null hypothesis
W⁺ (sum of ranks of positive differences)
34
W⁻ (sum of ranks of negative differences)
2
z (normal approximation)
2.1731
p-value, normal approximation
0.02977
Matched-pairs rank-biserial correlation
0.888889
Median difference
7.5
Non-zero differences used
8
Zero differences dropped
0

There are tied or zero differences, so the p-value uses the normal approximation with the tie-corrected variance.

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Paste the first measurement of each pair into Sample 1 and the second into Sample 2, in the same order.
  2. Or leave Sample 2 empty and enter a hypothesised median to test one sample.
  3. Choose the alternative hypothesis and read W, the p-value and the result.

How the test works

  1. Take each difference d = sample 1 − sample 2 (or value − median) and drop the zeros; n differences remain.
  2. Rank the absolute differences |d|, giving tied values the average of their ranks.
  3. W⁺ is the sum of ranks of positive differences and W⁻ of negative ones; W⁺ + W⁻ = n(n + 1)/2.
  4. Normal approximation: μ = n(n + 1)/4, σ² = n(n + 1)(2n + 1)/24 − Σ(t³ − t)/48, z = (W⁺ − μ ∓ ½)/σ.
  5. Effect size: matched-pairs rank-biserial correlation = (W⁺ − W⁻)/(W⁺ + W⁻).

Worked example

Blood pressure after and before for 8 people: after 125, 118, 130, 142, 121, 135, 128, 140; before 120, 117, 122, 130, 123, 126, 121, 131.

Differences: 5, 1, 8, 12, −2, 9, 7, 9. Ranks of |d|: 1 → 1, 2 → 2, 5 → 3, 7 → 4, 8 → 5, the two 9s → 6.5 each, 12 → 8. Only −2 is negative, so W⁻ = 2 and W⁺ = 36 − 2 = 34. With the tie, σ² = 8 × 9 × 17/24 − 6/48 = 50.875, σ = 7.13, z = (34 − 18 − 0.5)/7.13 = 2.17, two-tailed p = 0.030.

Tips and common mistakes

  • Keep the pairs in the same order in both boxes; shuffling one list ruins the test.
  • For two independent groups, use the Mann–Whitney U test instead.
  • Many zero differences reduce the usable sample; heavily rounded measurements are the usual cause.

Frequently asked questions

When should I use the Wilcoxon signed-rank test?

For paired measurements, such as the same people before and after a treatment, when the differences are skewed or have outliers so a paired t-test is doubtful. With the second box empty it tests one sample against a hypothesised median.

What happens to zero differences?

They are dropped before ranking, which is Wilcoxon's original method, and the number dropped is shown. Pairs with no change carry no information about direction.

Exact or normal p-value?

With no ties, no zero differences and at most 49 pairs, the calculator counts all 2ⁿ equally likely sign patterns and gives the exact p-value. Otherwise it uses the normal approximation with a tie correction and, by default, a continuity correction of ½.

Why does my software report a different W?

Programs differ: some report W⁺ (R calls it V), some the smaller of W⁺ and W⁻, some a signed sum. The calculator shows W⁺, W⁻ and the smaller one; the p-value is the same.

More in Math

All tools in this category: Math ·Updated November 4, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.