One value per line or separated by commas. The two columns must have the same length; each row is one subject measured twice.
Each value is compared with the stated median; the differences are x − m0.
Paste the differences directly, one per line or separated by commas.
RESULTS
Zeros are dropped before ranking (unlike the paired t-test, which keeps them) — a pair with no change carries no information about direction. Tied |d| values share the average rank.
Enter your paired data and press Calculate.
The Wilcoxon signed-rank test is the non-parametric alternative to the paired t-test — use it when the differences are not normal or the sample is small. Paste your before-and-after columns and get the signed-rank table, W+, W−, the exact p-value for small samples, the normal approximation for large ones, and the effect size.
This test is for PAIRED data — the same subjects measured twice, before and after. If the two groups are different people, use the Mann-Whitney U test instead. If the differences are roughly normal, the paired t-test is more powerful — use it instead.
How to use the Wilcoxon signed-rank test calculator
- Choose a mode. Paired data is the default: two columns, before and after, one row per subject. One sample vs median tests one column against a stated median m0. Differences list takes the differences directly.
- Paste your data. One value per line, or separated by commas. The before and after columns must have the same length.
- Choose the tail and α. Two-tailed is the usual choice; pick a one-tailed alternative only if you stated the direction before seeing the data. α is 0.05 by default.
- Press Calculate. The calculator drops zero differences, ranks the absolute differences, and returns W, the p-value, the median of the differences and the effect sizes.
Try it now: the calculator is pre-filled with Worked Example 1 below — nine students before and after a revision course. Press Calculate and you should get W = 1 and an exact two-tailed p-value of 0.0078.
When should you use a Wilcoxon signed-rank test?
Use this test when the data are paired and the paired t-test’s normality assumption is doubtful:
- The differences are not normal. The paired t-test assumes the differences are roughly normal. When they are skewed, heavy-tailed or contain outliers, the Wilcoxon test — which works with ranks, not raw values — is the safer choice. A Shapiro-Wilk test on the differences is the usual normality check; if it rejects normality, this is the test to use.
- The sample is small. With few pairs, normality is hard to check and a single outlier can dominate a t-test. Ranks limit that influence.
- The data are ordinal or the scale is coarse. Ranks make sense when only the order and direction of the changes matter.
- You want a test of the median difference. The Wilcoxon signed-rank test tests whether the median of the differences is zero — not whether the mean difference is zero.
It is not a test for two independent groups. For different people in each group, use the Mann-Whitney U test; for a single sample against a mean, use the one-sample t-test.
Paired t-test vs Wilcoxon: which one do you need?
Decision box: if the differences look roughly normal, use the paired t-test — it is more powerful. If the differences are skewed, have outliers, or the sample is too small to judge normality, use the Wilcoxon signed-rank test. If the data are not paired at all, use neither — use the Mann-Whitney U test for two independent groups.
| Question | Paired t-test | Wilcoxon signed-rank test |
|---|---|---|
| What does it test? | Whether the mean of the differences is zero | Whether the median of the differences is zero |
| Does it need normal differences? | Yes, roughly | No |
| Small samples | Risky if normality fails | Safer; exact p-value for n ≤ 25 |
| Outliers | Can dominate the result | Muted, because only ranks are used |
| Zero differences | Kept in the data | Dropped before ranking |
| Power when the differences are normal | Higher | Slightly lower |
How do I read W, the p-value and the effect sizes together?
- W is the smaller of W+ and W−, the sums of the signed ranks. A small W means the differences mostly point one way.
- The p-value is the probability of a W at least this extreme if the median difference were really zero. For n ≤ 25 with no ties and no zeros dropped, the calculator gives the exact p-value by enumerating all sign patterns; otherwise it uses the normal approximation with a tie correction, showing both the continuity-corrected p-value (the R convention) and the uncorrected one (SciPy) when they differ.
- The median of the differences is the typical change per pair. It is not the difference of the two medians — those are different quantities, and they can disagree.
- The matched-pairs rank-biserial is (W+ − W−)/(W+ + W−). It runs from −1 to 1: 1 means every non-zero difference is positive, −1 means every one is negative, and 0 means the positive and negative ranks balance.
- Effect size r = |z|/√n puts the result on a familiar scale: about 0.1 is small, 0.3 is medium and 0.5 is large.
- The decision compares the p-value with your α. A p-value below α rejects the null hypothesis that the median difference is zero.
Worked examples
Example 1 — nine students before and after a revision course
Before: 50, 52, 55, 58, 60, 63, 66, 69, 72. After: 49, 54, 58, 62, 65, 69, 73, 77, 81. The differences (after − before) are −1, 2, 3, 4, 5, 6, 7, 8, 9, so the ranks of |d| are 1 to 9. Only the first difference is negative, so W+ = 44, W− = 1 and W = 1. With n = 9, no ties and no zeros, the exact two-tailed p-value is 0.0078 (2 × 2/512), so we reject H0 at α = 0.05. The median of the differences is 5.00: a typical student gained 5 marks.
| Pair | Before | After | d | |d| | Rank | Signed rank |
|---|---|---|---|---|---|---|
| 1 | 50 | 49 | −1 | 1 | 1 | −1 |
| 2 | 52 | 54 | 2 | 2 | 2 | +2 |
| 3 | 55 | 58 | 3 | 3 | 3 | +3 |
| 4 | 58 | 62 | 4 | 4 | 4 | +4 |
| 5 | 60 | 65 | 5 | 5 | 5 | +5 |
| 6 | 63 | 69 | 6 | 6 | 6 | +6 |
| 7 | 66 | 73 | 7 | 7 | 7 | +7 |
| 8 | 69 | 77 | 8 | 8 | 8 | +8 |
| 9 | 72 | 81 | 9 | 9 | 9 | +9 |
Example 2 — a zero and ties
Before: 12, 15, 14, 10, 13, 16, 11, 14, 15, 12. After: 14, 16, 15, 12, 13, 18, 13, 15, 17, 14. The differences are 2, 1, 1, 2, 0, 2, 2, 1, 2, 2. One zero is dropped (n = 9). The |d| = 1 values appear 3 times and share the average rank 2; the |d| = 2 values appear 6 times and share the average rank 6.5. Every non-zero difference is positive, so W+ = 45, W− = 0 and W = 0. An exact p-value is not available (a zero was dropped and there are ties), so the calculator uses the normal approximation with the tie correction: z = −2.70 with the continuity correction, p = 0.0069; z = −2.76 without it, p = 0.0057. Either way, reject H0 at α = 0.05. The median of the differences is 2.00, the matched-pairs rank-biserial is 1.00 and r = 0.90.
How to do a Wilcoxon signed-rank test in Excel
Excel has no built-in Wilcoxon function, so the test is built by hand. Put the before values in column A and the after values in column B, then:
- Compute the differences in column C with =B2-A2.
- Rank the absolute differences with =RANK.AVG(ABS(C2),$C$2:$C$11,1) — RANK.AVG gives tied values the average rank.
- Sum the positive signed ranks with =IF(C2>0,E2,0) in column F and the negative ones with =IF(C2<0,E2,0) in column G, then take W as =MIN(SUM(F:F),SUM(G:G)).
- For the normal approximation, compute z from W, the mean n(n+1)/4 and the tie-corrected standard deviation, then get the two-tailed p-value with =2*(1-NORM.S.DIST(ABS(z),TRUE)).
The parametric counterpart is =T.TEST(array1, array2, tails, 1), where type 1 is the paired test. The Real Statistics Resource Pack provides a signed-rank test as an add-in — an add-in, not Excel itself — if you would rather not build the ranks by hand.
Frequently asked questions
When do I use Wilcoxon instead of the paired t-test?
When the differences are not roughly normal, when the sample is small, or when outliers make the mean unreliable. If the differences are roughly normal, the paired t-test is more powerful, so use that instead.
Why are zero differences dropped?
A pair with no change carries no information about direction: it cannot be ranked as positive or negative. The Wilcoxon test therefore drops zeros before ranking, unlike the paired t-test, which keeps them. The calculator always states how many zeros were dropped.
What if there are ties in the absolute differences?
Tied |d| values share the average rank. Ties also rule out the exact p-value, so the calculator switches to the normal approximation with a tie correction to the variance.
What is W+ vs W−, and why is W the smaller one?
W+ is the sum of the ranks of the positive differences and W− is the sum of the ranks of the negative differences. W is the smaller of the two, because a small W means the ranks are lopsided — most of the weight sits on one side — which is the evidence against the null hypothesis.
Why is there no exact p-value for large n?
The exact p-value counts all 2^n sign patterns. That is 512 patterns for n = 9 but over 33 million for n = 25, and it keeps doubling. Beyond n = 25 the normal approximation is used instead, and it is very accurate by then.
Can I use it on one sample?
Yes — use the One sample vs median mode. It tests whether a single sample’s median equals a stated value m0, by forming the differences x − m0 and running the same signed-rank test on them.
Sources: the paired design follows the NIST/SEMATECH e-Handbook, Analysis of paired observations; the Wilcoxon signed-rank test is the non-parametric alternative to the paired t-test for that design. The NIST Dataplot T TEST reference notes that “The sign test or the Wilcoxon signed rank test can be used for the paired case” (T TEST reference). Original paper: Wilcoxon, F. (1945), “Individual comparisons by ranking methods”, Biometrics Bulletin 1(6): 80–83.
See all 67 free statistics tools on Empirical Rule Calculators.
Next steps
๐โ Live
Hypothesis Testing Explained
The five steps of a hypothesis test, with worked z, t and chi-square examples.GuideRead the Guide โ
๐งฎโ Live
Paired T-Test Calculator
The parametric version of this test โ use it when the differences are roughly normal.CalculatorTry Calculator โ
๐โ Live
Shapiro-Wilk Test Calculator
Check whether the differences are normal enough for a t-test.CalculatorTry Calculator โ
More Tools to Explore
Keep going with the calculators that pair with the Wilcoxon test — the paired t-test, the Mann-Whitney U test, the t-distribution and confidence intervals.
Paired T-Test Calculator
The parametric version — use it when the differences are roughly normal.
Shapiro-Wilk Test Calculator
Check whether the differences are normal enough for a t-test.
One-Sample T-Test Calculator
A paired t-test is a one-sample t-test on the differences — run it here.
Mann-Whitney U Test Calculator
Two independent groups instead of the same subjects twice.
Cohen's d Calculator
Measure how big the mean difference is, not just whether it is significant.
T-Distribution Calculator
Look up any area, p-value or critical t for any degrees of freedom.
Explore All Tools →
Browse all 67 free statistics tools — every calculator on this site in one place.