Professor Digitalfor studentsSign in

Mann-Whitney U Test: When to Use It, Worked Example and Reporting

Reviewed by Prof. Dr. Alexander Holtermann · Updated 16 October 2026 · 6 min read

The Mann-Whitney U test compares two independent groups using ranks. It is the non-parametric alternative to the independent-samples t-test.

Key takeaways

  • Use the Mann-Whitney U test (also Wilcoxon rank-sum test) for two independent groups when the outcome is ordinal or metric but clearly non-normal in small samples.
  • It ranks all values together and compares the rank sums: U₁ = R₁ − n₁(n₁ + 1) / 2; the smaller of U₁ and U₂ is reported.
  • For larger samples U is converted to z with a correction for ties; the effect size is r = |z| / √N.
  • Strictly, it tests whether values in one group tend to be larger than in the other (stochastic dominance). Only if both distributions have the same shape is it a test of medians.
  • Report medians (and IQRs) or mean ranks with U, z, p and r, for example U = 3, z = −2.78, p = .005, r = .74.

When to use the Mann-Whitney U test

The Mann-Whitney U test (Mann & Whitney, 1947) compares two independent groups. Unlike the t-test, it does not use the raw values but their ranks, so it needs no normality assumption and is robust to outliers. The equivalent Wilcoxon rank-sum test gives the same p-value; the names are often used interchangeably.

  • The outcome is ordinal, for example a single Likert item or a rating from 1 to 10.
  • The outcome is metric but clearly non-normal and the groups are small (roughly under 30 per group).
  • There are outliers that you cannot remove for substantive reasons.
  • Not for paired data: use the Wilcoxon signed-rank test for before/after measurements of the same people.
  • Not for three or more groups: use the Kruskal-Wallis test.

How the test works

The procedure is simple enough to do by hand for small samples.

  • 1. Pool both groups and rank all values from smallest (rank 1) to largest.
  • 2. Give tied values the average of the ranks they occupy.
  • 3. Sum the ranks in each group: R₁ and R₂. Check: R₁ + R₂ = N(N + 1) / 2.
  • 4. Compute U₁ = R₁ − n₁(n₁ + 1) / 2 and U₂ = n₁n₂ − U₁. The test statistic U is the smaller of the two.
  • 5. For small samples, compare U with a table of critical values (or an exact p-value); for larger samples, use the normal approximation: z = (U − n₁n₂ / 2) / σ_U.

Worked example: stress ratings before two exam formats

Fourteen students rate their stress on a scale from 1 to 10. Seven took an online exam, seven an in-person exam.

Online: 3, 5, 4, 6, 2, 5, 4 (median 4) In person: 6, 7, 5, 8, 7, 6, 9 (median 7)

Value23445556667789
GroupOnOnOnOnOnOnInOnInInInInInIn
Rank123.53.566699911.511.51314

Exact or asymptotic p-value?

There are several ways to get the p-value, and different programs choose differently, which can confuse students comparing results.

MethodExample resultWhen used
Normal approximation with tie correctionp = .005Larger samples; default in many programs; used by the significance calculator
Normal approximation with continuity correctionp = .007Default in some programs, including R’s wilcox.test with ties
Exact p-valuep = .004 (ignoring ties)Small samples without ties

What exactly does the test compare?

Many textbooks say the Mann-Whitney test “compares medians”. That is only true if both distributions have the same shape and spread and differ only in location. In general it tests whether a randomly chosen value from one group tends to be larger than one from the other: P(X > Y) ≠ 0.5.

This probability is a useful effect size in itself, sometimes called the common-language effect size: U / (n₁n₂). Here, the chance that a randomly chosen online student reports more stress than a randomly chosen in-person student is 3 / 49 = .06. The related rank-biserial correlation is 1 − 2U / (n₁n₂) = 1 − 6 / 49 = .88.

Mann-Whitney U or t-test?

With normally distributed data, the t-test is slightly more powerful; the Mann-Whitney test has about 95% of its efficiency. With heavy tails or outliers, the Mann-Whitney test can be considerably more powerful. With larger samples (about 30 or more per group) and moderate skewness, both work, and the t-test has the advantage of reporting means and a CI of the mean difference.

CriterionIndependent t-test (Welch)Mann-Whitney U test
Outcomemetricordinal or metric
Normality neededapproximately, or n ≥ 30 per groupno
Robust to outliersnoyes
Comparesmeansrank distributions
Effect sizeCohen’s dr = |z| / √N or rank-biserial r

How to report the Mann-Whitney U test in APA style

Report the medians (with IQR) or mean ranks of both groups, U, z (for the normal approximation), the exact p-value and an effect size. Mention the tie correction if the software applied it.

Doing this in SPSS, R or JASP

The test statistic is labelled differently: SPSS reports U, R reports W (equivalent to U for the first group), JASP reports W as well. The p-values agree, apart from small differences between exact and approximate methods.

ProgramHow to run it
SPSSAnalyze → Nonparametric Tests → Independent Samples, or Legacy Dialogs → 2 Independent Samples (Mann-Whitney U)
Rwilcox.test(score ~ group, data = df)
JASP / jamoviT-Tests → Independent Samples T-Test; tick Mann-Whitney and the rank-biserial effect size

Frequently asked questions

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

When the outcome is ordinal, or metric but clearly non-normal in small groups, or when outliers would distort the means. For two independent groups only.

Is the Mann-Whitney U test the same as the Wilcoxon test?

The Mann-Whitney U test and the Wilcoxon rank-sum test are equivalent. The Wilcoxon signed-rank test is a different test for paired data.

Does the Mann-Whitney test compare medians?

Only if both distributions have the same shape. In general it tests whether values in one group tend to be higher than in the other. Reporting medians is still common and helpful.

What effect size should I report?

r = |z| / √N, with .10, .30 and .50 as small, medium and large; alternatively the rank-biserial correlation or the common-language effect size U / (n₁n₂).

What is the minimum sample size?

The test can be computed with very small groups, but with fewer than about 4 per group it cannot reach p < .05 two-sided. Power analysis for a t-test, plus about 15% more cases, is a common planning rule.

Sources and further reading

  • Mann, H. B., & Whitney, D. R. (1947). On a test of whether one of two random variables is stochastically larger than the other. The Annals of Mathematical Statistics, 18(1), 50–60.
  • Howell, D. C. (2013). Statistical Methods for Psychology (8th ed.). Wadsworth Cengage Learning.
  • Gravetter, F. J., & Wallnau, L. B. (2017). Statistics for the Behavioral Sciences (10th ed.). Cengage.

Your university’s examination regulations and style guide always take precedence.

Related articles