Skip to content
Omnikalc

Mann–Whitney U test: compare two groups without assuming normality

Enter U or the rank sum of group 1 with both group sizes to get the z statistic, the p-value from the normal approximation and the effect size.

Updated on
Your inputs

Value out of range

Value out of range

I know

Value out of range

Value out of range

Continuity correction

Results

p-value (normal approximation)

0.02949

Statistically significant: p is below α, so reject the null hypothesis
z statistic
2.177
U₁ (pairs where group 1 is larger)
15.0
U₂ = n₁n₂ − U₁
65.0
Expected U under the null hypothesis
40.0
Standard deviation of U
11.255
Rank-biserial correlation (−1 to 1)
-0.625
Probability that a value of group 1 exceeds one of group 2
18.8%
Small samples: prefer the exact U table or exact test from statistical software

What the Mann–Whitney U test does

The Mann–Whitney U test, also called the Wilcoxon rank-sum test, compares two independent groups without assuming that the data are normally distributed. Instead of the raw values, it uses their ranks: all observations are pooled, sorted and numbered from 1 to N. If one group tends to have larger values, its ranks pile up at the top. It is the usual alternative to the two-sample t-test for skewed data, ordinal scores (such as satisfaction ratings or pain scales) and small samples with outliers.

The formulas

  • U₁ = R₁ − n₁(n₁ + 1) ÷ 2, where R₁ is the sum of the ranks of group 1.
  • U₁ counts the pairs (one value from each group) in which group 1 is larger; U₂ = n₁n₂ − U₁.
  • Under the null hypothesis, U has mean n₁n₂ ÷ 2 and standard deviation √(n₁n₂(n₁ + n₂ + 1) ÷ 12).
  • z = (U₁ − mean ± 0.5) ÷ SD, where the 0.5 is the continuity correction, and the p-value comes from the normal distribution.

Example

Group 1 has 8 values and group 2 has 10, and U₁ = 15:

  • expected U: 8 × 10 ÷ 2 = 40, with an SD of √(80 × 19 ÷ 12) ≈ 11.25;
  • z = (25 − 0.5) ÷ 11.25 ≈ 2.18;
  • two-tailed p ≈ 0.029: significant at α = 0.05;
  • a value from group 1 beats a value from group 2 in only 18.8% of pairs, so group 1 tends to be lower; the rank-biserial correlation is −0.63, a large effect.

Reading the effect size

The rank-biserial correlation runs from −1 to 1: 0 means complete overlap, ±1 means every value of one group exceeds every value of the other. The “probability of superiority” U₁ ÷ (n₁n₂) is often easier to explain: it is the chance that a random member of group 1 scores higher than a random member of group 2.

Assumptions and limits

  • The two groups are independent; for paired data, use the Wilcoxon signed-rank test.
  • Observations are at least ordinal.
  • Strictly, the test compares whole distributions. It reads as a comparison of medians only when the two distributions have a similar shape.
  • With many ties, the SD should be corrected for ties; the uncorrected value used here is slightly conservative.
  • For fewer than about 20 observations in total, exact tables or software give a more accurate p-value than the normal approximation.

Frequently asked questions

When should I use the Mann–Whitney U test instead of a t-test?

When the data are skewed, ordinal or contain outliers, or the samples are small and clearly non-normal.

How do I compute U from rank sums?

U₁ = R₁ − n₁(n₁ + 1) ÷ 2, where R₁ is the sum of the ranks of group 1 in the pooled ranking.

Does the Mann–Whitney test compare medians?

Only if both distributions have the same shape. In general it tests whether values from one group tend to be larger.

Is the Mann–Whitney test the same as the Wilcoxon rank-sum test?

Yes. They are two equivalent forms of the same test and give the same p-value.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.