Signed-rank for before-and-after data, rank-sum (Mann-Whitney U) for two groups: exact p-values, the typical shift in your own units, and an answer one outlier cannot overturn.
Wilcoxon Test Calculator - Signed-Rank and Mann-Whitney U
Signed-rank for before-and-after data, rank-sum (Mann-Whitney U) for two groups: exact p-values, the typical shift in your own units, and an answer one outlier cannot overturn.
Parameters
Enter data for calculations
💡 Fill in all required fields to unlock the calculate button
Wilcoxon signed-rank and rank-sum tests, with the p-value and the typical shift
Pain scores for ten patients before and after a course of physical therapy: 7 6 8 5 7 9 6 8 7 6 and then 4 5 6 5 3 7 5 6 4 6. Paste both lists, choose paired, and the calculator returns p = 0.0078, V = 36 and a typical change of -2 points. Eight patients improved, two stayed the same, nobody got worse, and that pattern alone is what the test weighs.
The same tool runs the other Wilcoxon test, the rank-sum test for two separate groups, known in most software as the Mann-Whitney U test. Both work on ranks instead of raw values, so a single wild measurement cannot drag the answer around. Up to 50 pairs or 60 values in total the p-value is exact, counted over every possible arrangement of the ranks; above that it uses the normal approximation with the usual corrections.
A t-test and a rank test on the same data, before and after
Before: a t-test on skewed timings
- One slow participant at 190 seconds pushes group A's mean up by 16.75 seconds
- The standard deviation balloons with it, and Welch's t falls to 1.67
- p = 0.1387: "no difference", although 63 of the 64 cross-group comparisons point the same way
After: the rank-sum test
- 190 seconds is simply the largest rank, the same rank 70 seconds would get
- W = 63 of a possible 64, typical shift -12.5 seconds
- p = 0.0003, the same value the data give without the outlier
The numbers come from checkout times for two page designs, eight people each: design A 48 52 61 45 58 190 50 55, design B 38 41 44 36 47 40 43 39. Replace 190 with 56 and Welch's t-test gives p = 0.0002. The rank test does not move.
The form, from test type to alpha
- Test - paired (signed-rank) when the same people, pages or samples were measured twice; independent (rank-sum, Mann-Whitney) when the two lists come from different subjects. This decides the whole test, not just a detail of it.
- First series - the before values, or group 1. Separate numbers with spaces, commas or new lines, or paste a spreadsheet column. Use a dot for decimals.
- Second series - the after values, or group 2. In paired mode the order must match the first list, subject for subject, and the lengths must be equal.
- Alternative hypothesis - two-sided, or one-sided with the second series higher or lower. One-sided only when the direction was written down before the data existed.
- Significance level - 0.05 by default, 0.01 for many comparisons, 0.10 for a first look.
- Read the result - p and the verdict first, then the typical shift, the statistic in R's notation, the effect size r and, in paired mode, every pair with its signed rank.
How the rank arithmetic gets to a p-value
Independent: rank all values together, U1 = R1 - n1(n1 + 1) / 2, U2 = n1 n2 - U1
p = share of all equally likely rank arrangements at least as extreme as yours
What one outlier does to each test
Five data sets, each run through this calculator and through the matching t-test (paired t, or Welch's t for two groups). The last column is what the rank test protects you from.
| Data | t-test p | Wilcoxon p | Typical shift | What happened |
|---|---|---|---|---|
| Pain scores, 10 pairs | 0.0019 | 0.0078 | -2 points | clean data, both agree; the rank test cannot go below 2/28 |
| Page load, 8 pages, all faster | below 0.0001 | 0.0078 | -0.35 s | both significant |
| Same, one page broke: 2.6 s to 9.8 s | 0.5450 | 0.1641 | -0.3 s | t-test's mean change flips to +0.6 s slower; the rank test still sees 7 of 8 pages faster |
| Checkout times, 8 vs 8, no outlier | 0.0002 | 0.0003 | -12 s | both significant |
| Same, one participant at 190 s | 0.1387 | 0.0003 | -12.5 s | the t-test loses the effect, the rank test keeps it |
The price of that protection shows in the first row. With clean, roughly normal data a t-test extracts a little more from the same numbers, and in tiny samples the rank test has a hard floor. That is the whole trade: some efficiency on well-behaved data in exchange for answers that one bad measurement cannot overturn.
The smallest p each sample size can ever reach
Because the p-value counts arrangements, it has a floor: the case where every change points the same way, or every value of one group beats every value of the other. Below these sizes, 0.05 two-sided is out of reach no matter how strong the effect is.
| Paired, nonzero pairs | Smallest two-sided p | Two groups | Smallest two-sided p |
|---|---|---|---|
| 4 | 0.1250 | 3 and 3 | 0.1000 |
| 5 | 0.0625 | 3 and 5 | 0.0357 |
| 6 | 0.0313 | 4 and 4 | 0.0286 |
| 7 | 0.0156 | 4 and 6 | 0.0095 |
| 8 | 0.0078 | 5 and 5 | 0.0079 |
Pairs with no change do not count toward the left column. Ten pain scores with two unchanged patients behave like a study of eight, which is why the first example sits exactly on the 0.0078 floor.
Rank tests: the questions that keep coming up
Related tools
Interquartile Range Calculator
Q1, Q3 and outliers of each series before you compare them - See calculator
Fisher's Exact Test Calculator
When the outcome is yes or no rather than a measurement - See calculator
Median Calculator
The middle value of each series, the natural companion to a rank test - See calculator
Standard Deviation Calculator
How spread out each series is, and how much one outlier inflates it - See calculator
Average Calculator
Mean, median and mode side by side for a quick look at skew - See calculator
Percentage Calculator
Turning a typical shift into a percent change from the baseline - See calculator