Wilcoxon Signed-Rank Test Calculator
Paired non-parametric test. Ranks absolute differences with tie correction, reports W+, W−, W, normal-approximation z and p-value, plain-language verdict, lollipop diagram and show/hide step-by-step working.
What is the Wilcoxon signed-rank test?
The Wilcoxon signed-rank test is the non-parametric alternative to the paired t-test. It answers the same question — "did the values change between the two measurements?" — but without assuming the differences follow a normal distribution. Rather than averaging the differences, it looks at the sizes of the changes (as ranks) and their signs, and checks whether increases and decreases balance out.
Because the test uses ranks, outliers, skewed differences and ordinal data (Likert ratings, pain scores) don't break it. If nearly every pair moves in the same direction — or the biggest changes all share one sign — W⁺ and W⁻ become unbalanced and the test flags a significant effect.
The Wilcoxon signed-rank test, piece by piece
Given — paired differences
The test works on the differences within each pair (Afterᵢ − Beforeᵢ). Any pair whose difference is exactly zero carries no information about direction, so it's excluded before ranking; the sample size n is what remains.
Formula — rank absolute differences
Ignore signs and rank the |dᵢ| from smallest to largest. Ties share the average of the ranks they would have occupied — the same rule as in every rank-based test. The signs come back in Step 3.
Substitute — signed rank sums
Re-attach the original signs and total the ranks separately for the positive and negative differences. W⁺ + W⁻ = n(n+1)/2 acts as an arithmetic check; the reported statistic W is the smaller of the two.
Answer — z and p-value
Once n ≳ 10, W is approximately normal with mean n(n+1)/4. Ties shrink the variance a little, and a 0.5 continuity correction sharpens the tail-probability estimate before you turn |z| into a p-value.
Assumptions and interpretation
- Paired observations. Each Before value must correspond to a specific After value on the same unit. Independent groups need Mann-Whitney instead.
- Differences are at least ordinal and continuous-ish. The absolute differences need to be rank-able. Heavily discrete data (0/1 outcomes) fit McNemar's test better.
- What it tests: whether P(d > 0) = P(d < 0). Under the extra assumption that d is symmetric around its center, this is a test that the median difference is zero.
- Effect size: the matched-pairs rank-biserial r = (W⁺ − W⁻)/(n(n+1)/2) gives a magnitude between −1 and +1 to go with the p-value.
Common mistakes
- Mixing it up with Mann-Whitney. Same author, similar name, different designs. Paired → signed-rank. Independent → rank-sum.
- Keeping zero differences. Some older software counts zeros as "half" pairs; the standard modern practice is to drop them and reduce n.
- Forgetting the tie correction. With repeated |d| values, using the uncorrected σW² inflates the standard error and makes p-values conservative.
- Reading W's sign. W = min(W⁺, W⁻) is always the smaller sum — its magnitude tells you nothing about direction. Compare W⁺ vs W⁻ (or look at the sign of z) to see which way the pairs moved.
Features of this calculator
- Two paired dataset boxes — accepts commas, spaces, tabs, new lines and values pasted from a spreadsheet.
- Automatic length check — Before and After must have the same number of values.
- Zero differences dropped with a clear note showing effective n.
- Ranking of absolute differences with tie handling (average ranks) shown in a table.
- W⁺, W⁻ and W = min(W⁺, W⁻) — plus the W⁺ + W⁻ = n(n+1)/2 sanity check.
- Normal-approximation z with a continuity correction AND a tie correction to σW².
- One-sided or two-sided p-value with a plain-language verdict at your chosen α (0.10, 0.05, 0.01).
- Lollipop chart — one bar per pair, coloured by sign — so you can see at a glance how many pairs went up vs down and by how much.
- Show/hide step-by-step working with your own numbers substituted into every formula.
- Copy the summary as text or download the result panel as a PNG.
Frequently asked questions
+Do I need normally distributed differences?
No — that's the whole point of using this test instead of the paired t-test. All it needs is that the differences are at least ordinal and (for a test of medians specifically) roughly symmetric.
+How small a sample can I use?
Technically n ≥ 6 gives enough distinct rank arrangements to reach p ≈ 0.05 two-sided. The normal approximation on this page is reliable once effective n is around 10; for smaller samples it's still directionally right but exact tables are more precise.
+Can I use one-sided?
Yes, when you have a directional hypothesis fixed before looking at the data (e.g. "the intervention should reduce scores"). Picking the direction after peeking is p-hacking.
+What if all my differences are positive?
W⁻ will be 0 and W = 0. The test will give a very small p-value — which is correct: every pair moved the same way, that's a strong signal. Just note that the normal approximation is at its worst when W is at an extreme with tiny n; a small-sample exact table is even more decisive.
+Is this the same as the sign test?
No. The sign test uses only the direction of each difference (how many + vs −), ignoring magnitude. Wilcoxon uses both direction AND rank of magnitude, so it's more powerful whenever the sizes of the changes carry information.
+Can I run it on ordinal (Likert) data?
Yes — that's a common use. Rank differences between two ratings on the same subject. Just be aware that Likert differences aren't always symmetric, so interpret as a shift in P(d > 0) rather than strictly a median difference.