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

    Same subjects twice, or two separate groups

    Spaces, commas or new lines between values

    Same order and length as the first when paired

    Two-sided unless the direction was fixed in advance

    The false-alarm rate you accept

    Form progress0 / 5 fields

    💡 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

    1. 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.
    2. 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.
    3. 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.
    4. 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.
    5. Significance level - 0.05 by default, 0.01 for many comparisons, 0.10 for a first look.
    6. 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

    Paired: d = after - before, drop d = 0, rank |d|, T+ = sum of ranks where d > 0
    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
    The pain scores, by hand. Changes: -3, -1, -2, 0, -4, -2, -1, -2, -3, 0. Two zeros drop out, leaving 8 pairs. Ranking the sizes 1, 1, 2, 2, 2, 3, 3, 4 gives midranks 1.5, 1.5, 4, 4, 4, 6.5, 6.5, 8. Every change is negative, so T+ = 0 and V = 36. Of the 28 = 256 ways to attach signs, exactly one gives T+ = 0 and one gives the mirror image, so p = 2/256 = 0.0078.
    The checkout times, by hand. Pooled and ranked, design B holds ranks 1 to 7 and 9 (rank 8 is design A's 45 seconds). R2 = 37, so U2 = 37 - 36 = 1 and U1 = 64 - 1 = 63. Only one pair out of 64 has a B time longer than an A time. Among the 12,870 ways to split sixteen ranks into two groups of eight, so few are that lopsided that p = 0.0003.
    The typical shift. For paired data it is the median of all averages (di + dj) / 2 with i ≤ j, the Hodges-Lehmann estimate; for two groups, the median of all n1 n2 differences between a group 2 value and a group 1 value. It answers "by how much", which the p-value does not.

    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
    40.12503 and 30.1000
    50.06253 and 50.0357
    60.03134 and 40.0286
    70.01564 and 60.0095
    80.00785 and 50.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

    Is the Wilcoxon rank-sum test the same as the Mann-Whitney U test?
    Yes, two names for one test. Wilcoxon wrote it with rank sums, Mann and Whitney with U counts, and U = R - n(n + 1)/2 turns one into the other. For design A and B above, R1 = 99 and U1 = 63; either one gives p = 0.0003.
    When should I use Wilcoxon instead of a t-test?
    When the data are ordinal (ratings, pain scales, Likert items), clearly skewed (times, incomes, counts), or small with a value you cannot vouch for. With large, symmetric, clean samples the t-test is slightly more powerful and reports a mean difference, which some readers want.
    Does the rank-sum test compare medians?
    Only if both groups have the same shape and differ by a shift. In general it tests whether a value from one group tends to be larger than a value from the other, which the calculator prints as the probability of superiority. In the checkout data that probability is 1.6% for design B beating design A.
    Why does my V differ from another program's T or W+?
    Programs pick different sums. R's wilcox.test reports V, the sum of ranks where series 1 minus series 2 is positive; SPSS and many textbooks report the smaller of the two sums, T. The calculator shows both sums, so any of them can be read off. The p-value is the same whichever you use.
    What happens to ties and to pairs with no change?
    Pairs with a change of exactly zero are dropped, as in Wilcoxon's original test, and the result says how many. Equal values share the average of their ranks. The exact p-value is then computed over those midranks, where R would switch to a normal approximation and print a warning, so small samples with ties can differ from R in the third decimal.
    What effect size should I report?
    The calculator gives r = |z| / √n, with n the number of nonzero pairs or the total number of values, and the Hodges-Lehmann shift in the original units. Common rough bands for r are 0.1 small, 0.3 medium, 0.5 large. Some texts divide by the total number of measurements in paired designs instead, which gives a smaller r for the same data.

    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

    Similar calculators from this section