Home · Statistics · Inference & Tests · Mann-Whitney U Test Calculator
Mann-Whitney U Test Calculator
The Mann-Whitney U test (Wilcoxon rank-sum): a rank-based comparison of two independent samples that needs no normality assumption. The reported U belongs to the first sample.
What this calculator does
The Mann-Whitney U test (Wilcoxon rank-sum): a rank-based comparison of two independent samples that needs no normality assumption. The reported U belongs to the first sample. Every figure on this page is computed from the standard definition stated below — the same definition used in textbooks and reference tables — with no hidden rounding steps, and the method notes name the exact convention where more than one exists.
The formula and method
Both samples are ranked together, smallest first; U counts, in effect, how many cross-sample pairs have the x value ahead of the y value (ties count one half).
The headline reports the U statistic for the first sample (x), matching scipy.stats.mannwhitneyu's convention; the second sample's U is n_x·n_y − U_x.
Being rank-based, the test compares distributions (stochastic ordering), and reads as a median comparison when the two shapes are similar.
Worked example
With the example inputs this page opens with, the result is 21.0. Change any figure and the result updates with the same formula.
Quick reference
| Figure | Value |
|---|---|
| Result | 21.0 |
| U for group 2 | 4 |
| Rank sum for group 1 | 36 |
| Normal approximation z | 1.775592 |
| Two-sided p-value (normal approx.) | 7.580017% |
Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.
Common questions
When should I use the U test instead of a t-test?
When the data are ordinal, heavily skewed, or clearly non-normal, especially at small sample sizes. It tests whether values from one group tend to exceed values from the other, without assuming a distribution shape.
Why are there two U values?
U_x + U_y = n_x·n_y always: each cross pair is won by one side or the other. Software differs in which it prints — this calculator prints the first sample's, U = 21 here out of a maximum of 25.
How does the Mann-Whitney U Test Calculator work?
The Mann-Whitney U test (Wilcoxon rank-sum): a rank-based comparison of two independent samples that needs no normality assumption. The reported U belongs to the first sample. Sample x values · Sample y values → Mann-Whitney U (for sample x). The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.
What inputs does the Mann-Whitney U Test Calculator need?
Sample x values · Sample y values → Mann-Whitney U (for sample x). Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.