Skip to content
K Knidox Search…
Statistics · Nonparametric

Mann-Whitney U Test

Compare two independent groups without assuming normality — U, z, p, and effect size.

Values separated by commas or spaces.
The groups do not need to be the same size.
Mann-Whitney U
1Up < .05

n₁ = 7, n₂ = 7. U₁ = 1, U₂ = 48; the smaller is reported.

Normal approximation
z = -3.003

Two-tailed p = 0.0027, no ties present.

Rank-biserial correlation
0.959r

Effect size for the difference in ranks, running from −1 to 1.

With fewer than about 10 cases per group the normal approximation is rough — compare U against an exact critical-value table rather than relying on the p-value here.

The Mann-Whitney U test ranks both groups together and compares their rank sums. For two groups of 7 whose ranks sum to 29 and 76, U = 1, giving z = −3.00 and a two-tailed p of .003 — strong evidence the groups differ.

A t-test that does not need normality

The independent-samples t-test compares means and assumes the data are roughly normal within each group. When that assumption fails — small samples, skewed distributions, ordinal outcomes like Likert responses — the Mann-Whitney U test answers a similar question using ranks instead of raw values.

The procedure is simple enough to do by hand. Pool both groups, rank every value from smallest to largest, then add up the ranks belonging to each group. If the groups are alike, their rank sums will be close to what equal sharing would predict. If one group sits systematically higher, its rank sum is inflated and U falls towards zero.

What the test actually compares

It is often described as comparing medians, but that is only exact when the two distributions have the same shape. In general the test compares stochastic dominance: the probability that a randomly chosen value from one group exceeds one from the other. Where the shapes differ markedly, a significant result means the distributions differ, not necessarily that the medians do.

U₁ = R₁ − n₁(n₁ + 1) ÷ 2 μ_U = n₁n₂ ÷ 2 σ_U = √( (n₁n₂ ÷ 12) × ((N + 1) − Σ(t³ − t) ÷ (N(N − 1))) ) z = (U − μ_U) ÷ σ_U

R₁ is the rank sum of group 1, N the combined sample size, and t the size of each group of tied values. The smaller of U₁ and U₂ is conventionally reported.

Worked example: 7 versus 7

Rank together, sum by group, then standardise:

  1. 1
    Pool and rank all values. Combine both groups and rank from lowest to highest. Tied values share the average of the ranks they would occupy.
  2. 2
    Sum the ranks within each group. Group 1 sums to 29 and group 2 to 76, across 14 values in total.
  3. 3
    Convert rank sums to U. U₁ = 29 − (7 × 8 ÷ 2) = 29 − 28 = 1; U₂ = 76 − 28 = 48. Report the smaller, U = 1.
  4. 4
    Find the expected U. μ = 7 × 7 ÷ 2 = 24.5, with a standard deviation of 7.83 for this data.
  5. 5
    Standardise. z = (1 − 24.5) ÷ 7.83 = −3.00, giving a two-tailed p of .003.
  6. 6
    Report an effect size. The rank-biserial correlation is 1 − 2U ÷ (n₁n₂) = 1 − 2 ÷ 49 = .96, a very large effect.

Choosing between the parametric and nonparametric test

The nonparametric option costs a little power when normality genuinely holds, and gains a great deal when it does not.

SituationTest to use
Two independent groups, roughly normalIndependent-samples t-test
Two independent groups, skewed or ordinalMann-Whitney U
Two paired measurements, roughly normalPaired t-test
Two paired measurements, skewed or ordinalWilcoxon signed-rank
Three or more independent groups, skewedKruskal-Wallis H

Ties, small samples, and reporting

Tied values get the average of the ranks they would have occupied, and ties reduce the variance of U. This calculator applies the standard tie correction, which matters most when the outcome has few distinct values — a five-point Likert scale across 40 respondents produces a great many ties.

The p-value here comes from a normal approximation, which is reliable once both groups have roughly 10 or more observations. Below that, compare U against an exact critical-value table instead; with very small samples the approximation can be noticeably off.

For reporting, give U, the sample sizes, the z if you used the approximation, the exact p, and an effect size. Medians with interquartile ranges describe the groups better than means here, since the test itself is not about means.

Does the Mann-Whitney test compare medians?
Only when both distributions have the same shape. In general it tests stochastic dominance — whether values from one group tend to exceed those from the other — so a significant result means the distributions differ, not necessarily the medians.
When should I use it instead of a t-test?
When the data are ordinal, clearly skewed, or the samples are too small to judge normality. If normality holds the t-test is slightly more powerful, but the difference is small and the Mann-Whitney test is far more robust when it does not.
Which U should I report?
Conventionally the smaller of U₁ and U₂, alongside both sample sizes. Some software reports U₁ by default, so state which group it refers to if there is any ambiguity.
How are ties handled?
Tied values receive the average of the ranks they would otherwise occupy, and the variance of U is reduced by a correction term. This matters most for Likert-type outcomes, where ties are common.
Is the p-value reliable for small samples?
The normal approximation used here is dependable from about 10 observations per group. Below that, compare U with an exact critical-value table rather than relying on the approximate p-value.
What effect size goes with this test?
The rank-biserial correlation, computed as 1 − 2U ÷ (n₁n₂), which runs from −1 to 1. Some fields report r = z ÷ √N instead; either is acceptable if you say which you used.
Do the groups need to be the same size?
No. Unequal group sizes are handled directly by the formula, since the expected value and variance of U both account for n₁ and n₂ separately.