Statistics & probability

Wilcoxon signed-rank test calculator

Test paired measurements, or one sample against a value, with the Wilcoxon signed-rank test: V, an exact or normal p-value, a rank-biserial effect size and a pseudo-median interval.

Wilcoxon signed-rank test calculator
Esc to restore

Your inputs

Your data stays on this device: nothing is uploaded.

Two values on each line (the first and the second measurement), or one difference per line. Separate them with commas, tabs, semicolons or spaces; a first line of column names is fine, and NA or a blank marks a missing value that drops the pair. Differences are first minus second. Up to 2,000 lines.

0 for the usual paired test. For one column of values tested against a target, enter the target here.

The two settings give the same answer when there are no ties and no zero differences.

Results update as you type. Larger files run when you press Update result.

Your result

Your result will appear here.

More actions

Your inputs stay in this browser. Nothing is uploaded or saved.

A clear answer. Here’s how.

Each difference is the first value minus the second (or the single value given), minus the hypothesised median μ, which is 0 for the usual test. The absolute differences are ranked from 1, tied values sharing the average of the ranks they span, and V is the sum of the ranks of the positive differences, as R’s wilcox.test reports it. If the differences are centred on μ, each rank is equally likely to carry a plus or a minus sign, so V has mean (sum of the ranks) ÷ 2 and variance (sum of the squared ranks) ÷ 4, which are n(n + 1) ÷ 4 and n(n + 1)(2n + 1) ÷ 24 without ties or zeros. Ties and zero differences are handled in one of two ways, which follow the two recent versions of R’s wilcox.test. R up to 4.5 drops zero differences before ranking (Wilcoxon’s method) and uses the exact p-value only when there were no zeros and there are no ties; otherwise it uses the normal approximation. R 4.6 uses the exact p-value even with ties and zeros, as the permutation distribution of the signed ranks, found by counting all 2^m sign patterns of the m non-zero differences with exact integer arithmetic; the zeros stay in the ranking, where they take the lowest ranks but add nothing to V (Pratt’s treatment). With no ties and no zeros the two settings are the same. The exact p-value is used for fewer than 50 pairs, as in R. Otherwise, and in both versions, the normal approximation drops the zero differences, ranks the rest and uses z = (V − mean − c) ÷ sd, where c is a continuity correction of 0.5 (the sign of V − mean for a two-sided test, +0.5 for “first larger”, −0.5 for “first smaller”) and sd includes the correction for ties; the two-sided p-value doubles the smaller normal tail. The development version of R, the future 4.7, also keeps zeros in the normal approximation and rounds differences to seven significant digits before ranking; this tool does not follow that. Differences are computed exactly from the decimals you type, so 0.4 − 0.3 and 0.3 − 0.2 tie; R compares binary floating-point numbers, in which they do not, so R’s answer can differ where rounding noise would break a tie. The pseudo-median is the Hodges–Lehmann estimate: the median of all Walsh averages (dᵢ + dⱼ) ÷ 2 with i ≤ j, over the differences used in the test, before subtracting μ. Its two-sided interval is shown for fewer than 50 pairs with no ties or zeros, and runs from the q-th smallest to the q-th largest Walsh average, where q is the smallest integer with P(V ≤ q) ≥ (1 − level) ÷ 2, as in R’s exact interval; it is conservative, so the level it actually reaches is shown. With ties, zeros or 50 or more pairs R finds an interval and estimate by a numerical search that this tool does not reproduce, so none is given. The rank-biserial correlation is (V⁺ − V⁻) ÷ (V⁺ + V⁻), from the ranks of the non-zero differences (Kerby’s simple difference formula): +1 when every pair goes up, −1 when every pair goes down. The test assumes independent pairs and, for its median interpretation, differences that are roughly symmetric about their median; it does not test means, compare independent groups (use the Mann–Whitney tool) or compute power. It is a calculator, not a substitute for a statistician when decisions depend on the answer.

How this is checked

5 reference checks passed These 5 cases were run when this page was built, on 20 October 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.

See the checks and where each expected answer comes from
  1. Case 1

    Inputs
    Alternative greater
    Expected, and what Toolmoz gave
    V (sum of positive ranks) expected 40, Toolmoz 40Sum of negative ranks expected 5, Toolmoz 5Expected V if there were no effect expected 22.5, Toolmoz 22.5P-value expected 0.01953125, Toolmoz 0.01953125Method expected Exact (signed-rank distribution), Toolmoz Exact (signed-rank distribution)Rank-biserial correlation expected 0.7777777777777778, Toolmoz 0.7777777777777778Pseudo-median (Hodges–Lehmann) expected 0.46, Toolmoz 0.4599999999999999695% interval for the pseudo-median, lower limit expected 0.01, Toolmoz 0.0195% interval for the pseudo-median, upper limit expected 0.786, Toolmoz 0.786Confidence level achieved expected 96.09375, Toolmoz 96.09375
    Where the expected answer comes from
    Hollander and Wolfe (1973) depression scores, the example in R’s wilcox.test documentation, one-sided with the first visit larger. The differences x − y are 0.952, −0.147, 1.022, 0.43, 0.62, 0.59, 0.49, −0.08, 0.01; the two negative ones rank 3 and 2 by size, so V = 45 − 5 = 40 and (40 − 5) ÷ 45 = 7/9. Of the 2^9 = 512 sign patterns exactly 10 have a negative-rank sum of 5 or less (the empty set, 1, 2, 3, 4, 5, 1+2, 1+3, 1+4 and 2+3), so p = 10/512 = 5/256 = 0.01953125. P(V ≤ 5) = 10/512 is below 0.025 and P(V ≤ 6) = 14/512 is not, so q = 6: the 6th smallest and largest of the 45 Walsh averages are 0.01 and 0.786, the median of all 45 is 0.46, and the level is 1 − 2 × 10/512
    Allowed difference
    ±1e-12
  2. Case 2

    Inputs
    Pairs, one per line 49 -67 8 16 6 23 28 41 14 29 56 24 75 60 -48
    Expected, and what Toolmoz gave
    V (sum of positive ranks) expected 96, Toolmoz 96Sum of negative ranks expected 24, Toolmoz 24P-value expected 0.041259765625, Toolmoz 0.041259765625Rank-biserial correlation expected 0.6, Toolmoz 0.6Pseudo-median (Hodges–Lehmann) expected 25, Toolmoz 2595% interval for the pseudo-median, lower limit expected 4, Toolmoz 495% interval for the pseudo-median, upper limit expected 41.5, Toolmoz 41.5Confidence level achieved expected 95.208740234375, Toolmoz 95.208740234375
    Where the expected answer comes from
    Darwin’s 15 Zea mays differences (Fisher 1935): the two negative ones, −67 and −48, rank 14 and 10 by size, so the negative-rank sum is 24 and V = 120 − 24 = 96. Enumerating all 2^15 = 32768 sign patterns, 676 have a negative-rank sum of 24 or less, so the two-sided p = 2 × 676/32768 = 169/4096 = 0.041259765625. The median of the 120 Walsh averages is 25; q = 26 (the first q with P(V ≤ q) of at least 0.025), and the 26th smallest and largest Walsh averages are 4 and 41.5, with level 1 − 2 × P(V ≤ 25), from an independent Python fractions script that enumerates the patterns
    Allowed difference
    ±1e-12
  3. Case 3

    Inputs
    Pairs, one per line x2,x1 125,110 115,122 130,125 140,120 140,140 115,124 140,123 125,137 140,135 135,145
    Expected, and what Toolmoz gave
    Zero differences expected 1, Toolmoz 1Pairs ranked expected 9, Toolmoz 9Tie groups among the absolute differences expected 1, Toolmoz 1V (sum of positive ranks) expected 27, Toolmoz 27Sum of negative ranks expected 18, Toolmoz 18Expected V if there were no effect expected 22.5, Toolmoz 22.5Standard deviation of V expected 8.4335638967165, Toolmoz 8.4335638967165z score expected 0.4742953333830018, Toolmoz 0.4742953333830018P-value expected 0.6352893188352069, Toolmoz 0.6352893188352067Rank-biserial correlation expected 0.2, Toolmoz 0.2Method expected Normal approximation with continuity and tie corrections, Toolmoz Normal approximation with continuity and tie corrections
    Where the expected answer comes from
    The example on Wikipedia’s Wilcoxon signed-rank page: pair 5 has a zero difference and is dropped, the two differences of 5 share rank 1.5, so the positive ranks are 1.5 + 1.5 + 7 + 8 + 9 = 27 and the negative ranks 3 + 4 + 5 + 6 = 18, and the page gives the rank-biserial correlation (27 − 18) ÷ 45 = 0.20. With zeros dropped the normal approximation applies: mean 9 × 10 ÷ 4 = 22.5, variance 9 × 10 × 19 ÷ 24 − (2³ − 2) ÷ 48 = 71.125, sd 8.43356, z = (27 − 22.5 − 0.5) ÷ 8.43356 = 0.47430, p = 2 × (1 − Φ(0.47430)) with Φ from math.erfc in an independent Python script
    Allowed difference
    ±1e-9
  4. Case 4

    Inputs
    Pairs, one per line x2,x1 125,110 115,122 130,125 140,120 140,140 115,124 140,123 125,137 140,135 135,145Ties and zero differences keep
    Expected, and what Toolmoz gave
    Pairs ranked expected 10, Toolmoz 10V (sum of positive ranks) expected 32, Toolmoz 32Sum of negative ranks expected 22, Toolmoz 22Expected V if there were no effect expected 27, Toolmoz 27P-value expected 0.64453125, Toolmoz 0.64453125Method expected Exact permutation test (given the tied ranks), Toolmoz Exact permutation test (given the tied ranks)Rank-biserial correlation expected 0.2, Toolmoz 0.2
    Where the expected answer comes from
    The same ten pairs with the zero kept in the ranking, as R 4.6’s exact test does: the zero takes rank 1, the two 5s share 2.5, then 7, 9, 10, 12, 15, 17 and 20 take ranks 4 to 10, so V = 2.5 + 2.5 + 8 + 9 + 10 = 32 and the negative ranks 4 + 5 + 6 + 7 = 22. The nine non-zero ranks sum to 54, so the mean is 27. Counting all 2^9 = 512 sign patterns, 165 have V of 32 or more, so p = 2 × 165/512 = 0.64453125. The rank-biserial correlation always uses the non-zero differences ranked among themselves, 0.20 as above
    Allowed difference
    ±1e-12
  5. Case 5

    Inputs
    Pairs, one per line 4,3 3,2 2,1
    Expected, and what Toolmoz gave
    V (sum of positive ranks) expected 6, Toolmoz 6Expected V if there were no effect expected 3, Toolmoz 3Standard deviation of V expected 1.7320508075688772, Toolmoz 1.7320508075688772z score expected 1.4433756729740645, Toolmoz 1.4433756729740645P-value expected 0.14891467317876594, Toolmoz 0.14891467317876594
    Where the expected answer comes from
    The tie example in R’s wilcox.test documentation, wilcox.test(4:2, 3:1, paired = TRUE): all three differences are 1 and tie at rank 2, so V = 6, mean 3 × 4 ÷ 4 = 3 and variance 3 × 4 × 7 ÷ 24 − (3³ − 3) ÷ 48 = 3.5 − 0.5 = 3. Then z = (6 − 3 − 0.5) ÷ √3 = 1.44338 and p = 2 × (1 − Φ(1.44338)) = 0.148915, with Φ from math.erfc in an independent Python script
    Allowed difference
    ±1e-9

What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

Pairs, one per line
first,second
1.83,0.878
0.50,0.647
1.62,0.598
2.48,2.05
1.68,1.06
1.88,1.29
1.55,1.06
3.06,3.14
1.30,1.29
Column separator
Detect automatically
Alternative
The differences are not centred on the hypothesised value (two-sided)
Hypothesised median difference
0
Ties and zero differences
As R up to 4.5: drop zero differences; exact p-value only without zeros or ties
P-value
Exact for fewer than 50 pairs where the setting above allows it, otherwise the normal approximation
Confidence level for the pseudo-median
95%

Example result

Pairs read
9
Pairs with a missing value (left out)
0
Zero differences
0
Pairs ranked
9
Tie groups among the absolute differences
0
V (sum of positive ranks)
40
Sum of negative ranks
5
Expected V if there were no effect
22.5
P-value
0.03906
Method
Exact (signed-rank distribution)
Rank-biserial correlation
0.7778
Median difference
0.49
Pseudo-median (Hodges–Lehmann)
0.46
95% interval for the pseudo-median, lower limit
0.01
95% interval for the pseudo-median, upper limit
0.786
Confidence level achieved
96.09%

Differences are first − second, and “positive” means above zero. The p-value is exact: all 2^9 sign patterns of the ranks are counted. The matched-pairs rank-biserial correlation, (V⁺ − V⁻) ÷ (V⁺ + V⁻) = 0.778, is an effect size from −1 to +1 that uses the ranks of the non-zero differences. The test assumes independent pairs and differences that are roughly symmetric about their median; it does not test means. The interval is R’s exact one for the pseudo-median (always two-sided).