01
How to use the calculator
- Paste the values of each group into its box. The groups can have different sizes.
- Read U and the p value. They update as you type.
- Report the medians and the effect size alongside the p value.
02
When to use the Mann-Whitney U test
- Two independent groups. For paired or before-and-after data use the Wilcoxon signed-rank test.
- The outcome is ordinal (ratings, scores) or is a measurement that is clearly skewed or has outliers, especially in small samples.
- If the data are close to normal, the t-test is slightly more powerful. For three or more groups use the Kruskal–Wallis test.
03
How U is calculated
Rank all values from both groups together, giving tied values the average of their ranks. With R₁ the sum of ranks in group 1:
U₁ = R₁ − n₁(n₁ + 1) ÷ 2, U₂ = n₁n₂ − U₁, U = the smaller of the two
U₁ is the number of pairs (one value from each group) in which the group 1 value is the larger, counting ties as half.
p value. When there are no ties and n₁ × n₂ is at most 400, the calculator counts every possible arrangement of the ranks and reports the exact p. Otherwise it uses the normal approximation, with a correction for ties in the variance and a continuity correction of 0.5:
z = (|U₁ − n₁n₂/2| − 0.5) ÷ √( n₁n₂/12 × [ (N + 1) − Σ(t³ − t) ÷ (N(N − 1)) ] )
04
Worked example
The calculator opens with group 1: 5.1, 4.9, 5.6, 5.8, 6.0 and group 2: 4.1, 4.5, 4.3, 4.8, 4.0. Every value in group 1 is larger than every value in group 2, so group 1 holds ranks 6 to 10 (sum 40) and group 2 ranks 1 to 5 (sum 15).
U₁ = 40 − 15 = 25, U₂ = 0, U = 0
Only 2 of the 252 ways to split ten ranks into two groups of five are this extreme, so the exact two-sided p is 2 ÷ 252 = 0.0079. Reported as: U = 0, p = .008, r = 1.00, with medians 5.6 and 4.3.
05
Effect size: rank-biserial correlation
r = (U₁ − U₂) ÷ (n₁ × n₂)
It runs from −1 to +1. A value of +1 means every group 1 value exceeds every group 2 value, 0 means the groups overlap completely, and r = 0.5 means that group 1 wins 75% of all pairwise comparisons.
06
What the test does and does not show
The test asks whether values in one group tend to be larger than values in the other. It is a comparison of medians only when the two distributions have the same shape; with different shapes or spreads, a significant result can occur even when the medians are equal. Look at the data before describing the result as a difference in medians.
07
Common mistakes with the Mann-Whitney U test
- Using the normal approximation for small groups. For the worked example it gives p = 0.012; the exact p is 0.0079.
- Switching to a t-test on data with an extreme value. Change the 6.0 in the example to 60: the Welch t-test p goes from 0.0027 to 0.34, while the Mann-Whitney p stays 0.0079.
- Analysing paired data as two groups. Five subjects measured twice, each 1 unit higher the second time (10, 20, 30, 40, 50 then 11, 21, 31, 41, 51), give a Mann-Whitney p of 0.69; the Wilcoxon signed-rank test on the pairs gives 0.037 (a normal approximation, since every difference is the same).
Trust
How this page is checked
- The calculation runs on code with automated tests against worked reference values. Every number in the examples on this page was produced by that same code, not typed by hand.
- The formulas and conventions used are stated on the page, so you can reproduce the result yourself or compare it with your own software.
- Sources: Mann and Whitney (1947), On a test of whether one of two random variables is stochastically larger than the other.
- Last reviewed by the Sciloom team, Zebra Nine Studio Inc. It is a tool for research and teaching, not a substitute for a statistician, a validated lab method or medical advice.
Cite this page
Sciloom. (2026). Mann-Whitney U test calculator. Zebra Nine Studio Inc. https://sciloom.si/mann-whitney-u-test-calculator
Frequently asked questions
What is the Mann-Whitney U test used for?
To compare two independent groups when the data are ordinal or not normally distributed. It tests whether values in one group tend to be larger than in the other.
Is the Mann-Whitney U test the same as the Wilcoxon rank-sum test?
Yes. They are two forms of the same test and give the same p value. The Wilcoxon signed-rank test is a different test, for paired data.
Which U value do I report?
Most often the smaller of U₁ and U₂, which the calculator labels U. Software differs, so the calculator shows both.
What sample size does the test need?
It works with very small groups, but there is a floor: with three values in each group the smallest possible two-sided p is .10, and with four in each it is .029. The exact p value is used whenever there are no ties and the groups are small.