Skip to content

Wilcoxon Signed-Rank Test Calculator

Paste two matched columns, such as pain scores before and after treatment…

Paste two matched columns, such as pain scores before and after treatment, to test the change by rank when a paired t-test’s normal curve doesn’t fit.

Read 10 values; left out the header row (“Pain before”).

Read 10 values; left out the header row (“Pain after”).

More optionsTwo-sided, 95% confidence
Hypothesis
Confidence level

The significance level is 1 − the confidence level (0.05 at 95%).

ExampleP-value

0.0078

Pain after is lower than Pain before in 8 of 10 pairs (2 unchanged); typical change −2 (Hodges–Lehmann). Significant at the 5% level (p < 0.05).

Paste your own numbers to test them.

Pain before n = 10Pain after n = 10

Each line joins one pair, from before to after; straight-down lines are pairs that didn’t change.

Every value W+ could take if each change were equally likely to go up or down; the lit bars are as extreme as yours or more.

W+ · W−
0 · 36
Rank-biserial r
−1
Method
Exact, all 256 sign patterns
How this works: 9 sources,

How this works

Method

The Wilcoxon signed-rank test is the rank-based partner of the paired t-test: the same before-and-after or matched data, judged by the ranks of the changes rather than their average. It suits ratings such as a 0 to 10 pain score, small samples, or changes with a long tail. In the example, ten patients rated their pain before and after a course of physiotherapy; eight felt better, two felt the same and nobody felt worse. Full method

How it’s tested

2 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.

Privacy

On your device. Nothing you enter or open leaves this browser. About privacy labels

Changes

  • First published: live curves with draggable cut-offs, and tests on pasted data (t-tests, ANOVA, chi-square, Fisher’s exact, correlation, regression, A/B), checked against SciPy.

Every change on What’s new

How we make toolsReport a mistake

How the Wilcoxon signed-rank test works

The Wilcoxon signed-rank test is the rank-based partner of the paired t-test: the same before-and-after or matched data, judged by the ranks of the changes rather than their average. It suits ratings such as a 0 to 10 pain score, small samples, or changes with a long tail. In the example, ten patients rated their pain before and after a course of physiotherapy; eight felt better, two felt the same and nobody felt worse.

Work out each pair’s difference, drop the pairs that didn’t change, and rank the rest by size, ignoring the sign, with ties sharing the average rank. W+ adds up the ranks of the increases and W− the ranks of the decreases. If the treatment did nothing, each difference would be as likely to go up as down, so W+ would sit near n(n + 1)/4. Here every remaining change is a decrease, so W+ = 0 and W− = 36, as extreme as eight changes can be.

With few pairs the p-value is exact: the page counts all 2ⁿ ways the signs could have fallen (256 here), as SciPy does for up to 13 pairs with ties, or up to 50 without. Larger samples use the normal approximation with a tie correction. The Hodges–Lehmann estimate, the median of every pairwise average of the differences, gives the typical change in the data’s own units: 2 points of pain here.

W+ = Σ ranks of |dᵢ| with dᵢ > 0 · under no change, E(W+) = n(n + 1)/4

Exact critical values of W (two-sided, 5%)

With n changed pairs and no ties: the smaller of W+ and W− must be at most this value for p ≤ 0.05, with the exact p-value at that value, from all 2ⁿ sign patterns.

With n changed pairs and no ties: the smaller of W+ and W− must be at most this value for p ≤ 0.05, with the exact p-value at that value, from all 2ⁿ sign patterns.
Pairs (n)Sign patternsCritical WExact p at it
532none—
66400.0313
712820.0469
825630.0391
951250.0391
101,02480.0488
124,096130.0425
1532,768250.0479
201,048,576520.0484
2533,554,432890.0483
Show all 11 rows
301,073,741,8241370.0497

Common questions

Wilcoxon signed-rank or paired t-test?

The paired t-test when the differences are roughly symmetric and measured on a real scale; it tests the mean change. The signed-rank test when the data are ratings, the sample is small and skewed, or a few large changes would dominate a mean. On the example both agree; the t-test’s p is about 0.0015.

What happens to pairs with no change?

They are dropped, Wilcoxon’s original rule and SciPy’s default, and the page says how many. With many unchanged pairs, report them too: “8 improved, 2 unchanged, none worse” says more than a p-value.

Is this the same as the Wilcoxon rank-sum test?

No. The rank-sum test (Mann-Whitney U) compares two independent groups. The signed-rank test is for paired data: the same people or things measured twice.