Wilcoxon signed-rank test calculator

Paste paired measurements for the same subjects, or one sample of differences. The Wilcoxon signed-rank test ranks the absolute differences and sums the signed ranks. You get W+ and W−, the exact p value for small samples without ties or zeros, the normal approximation p values, the z statistic, and the matched-pairs rank-biserial effect size.

Enter the two paired columns, or a single column of differences. The calculator returns the midranks of the absolute differences, W+ (sum of positive ranks), W− (sum of negative ranks), the exact p value when there are no ties or zeros and n is at most 30, the tie-corrected asymptotic p value, the z statistic, and the matched-pairs rank-biserial correlation r = (W+ − W−)/(n(n+1)/2). On the R documentation example, the Hamilton depression scale data of Hollander and Wolfe (1973, 29f), the page gives W+ = 5, W− = 40, the exact two-sided p value 0.0390625 and the asymptotic two-sided p value 0.0382. The table below shows each value.

Updated 2026-11-16

Calculator

Data

In paired mode the two boxes must hold the same number of values in the same order, because value 1 of Group 1 pairs with value 1 of Group 2. The page uses the differences Group 2 minus Group 1 (after minus before). Separate the values with spaces, line breaks, semicolons or a comma and a space. Enter whole or decimal numbers from -1000000000 to 1000000000, with a point as the decimal mark. The page rejects a comma between two digits, such as 1,250 or 28,50, because it cannot tell a thousands separator from a decimal comma.

The R documentation example

The example data come from the R manual for wilcox.test: the Hamilton depression scale factor measurements in 9 patients with mixed anxiety and depression, taken at the first (x) and second (y) visit after initiation of a therapy. The example is Hollander and Wolfe (1973), 29f. R runs wilcox.test(x, y, paired = TRUE, alternative = "greater") and wilcox.test(y - x, alternative = "less"), and marks the second call as the same test. R defines V as the sum of the ranks of the positive differences, so V = 40 for x − y and V = 5 for y − x. The table compares the page output with SciPy 1.13.1, with the R definition of V and with an exact enumeration. R manual, wilcox.test.

Page output versus R and exact enumeration for the documentation example
QuantityThis pageReference
W+ (sum of positive ranks of y − x)5V = 5, the statistic of wilcox.test(y - x, alternative = "less"), which sums the ranks of the positive values of y − x
W− (sum of negative ranks of y − x)40V = 40, the statistic of wilcox.test(x, y, paired = TRUE), which sums the ranks of the positive values of x − y
p, exact two-sided0.03906250.0390625 (SciPy 1.13.1 wilcoxon(x, y) and a full enumeration of all 512 sign assignments)
p, exact one-sided, y − x tends to be negativeNot shown (the page gives two-sided p values only)0.01953125 (SciPy wilcoxon(y, x, alternative = "less"))
p, asymptotic two-sided0.0381520.038151710173415135 (SciPy wilcoxon(d, method = "approx"))
z statistic−2.073221z = (W+ − 22.5)/8.440972 = −2.073221
Matched-pairs rank-biserial r−0.777778(5 − 40)/45

With n = 9 pairs and no zeros there are 2⁹ = 512 sign assignments of the ranks 1 to 9. The differences y − x are −0.952, 0.147, −1.022, −0.43, −0.62, −0.59, −0.49, 0.08, −0.01, so the absolute differences rank to 8, 3, 9, 4, 7, 6, 5, 2, 1. Only the ranks 2 and 3 add up on the positive side: W+ = 2 + 3 = 5. The two-sided exact p value counts the assignments with W+ ≤ 5 or W+ ≥ 40: 10 + 10 of 512, which is 20/512 = 0.0390625.

Zeros and ties, and what R and SciPy do

Effect size, the matched-pairs rank-biserial correlation

Alongside the p value the page reports the matched-pairs rank-biserial correlation r = (W+ − W−)/(n(n+1)/2), which runs from −1 (every difference is negative) to +1 (every difference is positive). For the R example r = (5 − 40)/45 = −0.777778. Most of the rank weight is on the pairs where the second-visit value (y) is lower than the first-visit value (x). Kerby (2014, Comprehensive Psychology, volume 3, doi 10.2466/11.IT.3.1) calls this computation "the simple difference formula", and the Wikipedia article on the Wilcoxon signed-rank test uses it as the effect size for this test.

The calculator prints the midranks of the absolute differences with every result, so you can verify the rank assignment by hand before you trust the p values.

Wilcoxon signed-rank or the paired t test?

The SciPy manual calls the Wilcoxon signed-rank test "a non-parametric version of the paired T-test". For the paired t test itself, use the paired mode of the ABWex t-test calculator. The Wikipedia article compares the test with the sign test: "The Wilcoxon test is a more powerful alternative to the sign test because it considers the magnitude of the differences, but it requires this moderately strong assumption of symmetry." Do not confuse this test with the Wilcoxon rank-sum test. The R manual runs the rank-sum test when x and y are given and paired is FALSE, and calls it "equivalent to the Mann-Whitney test". It is for two independent samples. The SciPy manual lists scipy.stats.mannwhitneyu under "See also", and ABWex offers the Mann-Whitney U test calculator for that case.

Limits and accuracy

Disclaimers

By Michael Lip, builder and maintainer of ABWex, open source at github.com/theluckystrike/abwex.com. Profile.

ABWex is a free A/B test statistics calculator from Zovo Tools. The calculation runs in your browser in JavaScript. The page does not send the numbers that you enter to a server. Published 2026-11-16.

Explore ABWex

By the same builder: GitHub, theluckystrike BeLikeNative, Grammar AI EarlyThunder, Dev Blog Bug Bounty Reality Zovo, AI Dev Tools