Mann–Whitney U test calculator
Paste values for two independent groups to compute Mann–Whitney U, exact or tie-corrected asymptotic p-values, rank-biserial correlation r and an APA 7th results sentence.
Enter observations for two independent groups
Ideal for skewed continuous outcomes, small samples or ordinal scales.
LIVE RESULT
INSTANTMann–Whitney U test
Observations must be independent within and across groups. When combined N ≤ 40 with no ties, an exact permutation p-value is computed; otherwise the tie-corrected normal approximation is used.
READY-TO-USE APA 7TH RESULTS SENTENCE
Adjust inputs above to generate a draft reporting sentence.
VISUAL DIAGNOSTIC
Group medians, interquartile ranges (Q1–Q3) and spread
Reproduce in R (wilcox.test) and Python (SciPy)
What the Mann–Whitney U test compares
The Mann–Whitney U test (also known as the Wilcoxon rank-sum test) checks whether values in one independent group tend to be systematically larger than values in another, without assuming normal distributions. All observations from both groups are pooled and ranked from 1 to N (averaging ranks for ties), and U counts how many pairwise comparisons favor each group.
U₁ = R₁ − n₁(n₁ + 1) ÷ 2, U₂ = n₁n₂ − U₁, U = min(U₁, U₂)
Rank-biserial correlation r = (U₁ − U₂) ÷ (n₁n₂)
σU = √[ (n₁n₂ / 12) × (N + 1 − Σ(t³ − t) ÷ (N(N − 1))) ]
Worked example
Comparing Group 1 (Mdn = 24, IQR = 9.00) against Group 2 (Mdn = 16, IQR = 6.50) with n₁ = 7 and n₂ = 7 gives U = 7 (U₁ = 42, U₂ = 7), exact two-tailed p = .026, rank-biserial correlation r = 0.71, and Hodges–Lehmann median difference = 8.00.
Interpreting rank-biserial correlation (r)
| Metric | What it measures | Common reading |
|---|---|---|
| Rank-biserial |r| | Proportion of favorable minus unfavorable pairs across groups | ~0.10 small · ~0.30 medium · ~0.50 large |
| Hodges–Lehmann shift | Median of all n₁ × n₂ pairwise differences (Group 1 − Group 2) | Shift estimate in original units (not always equal to Mdn₁ − Mdn₂) |
| Exact vs. asymptotic p | Exact permutation DP (no ties, N ≤ 40) vs. normal z approximation | Exact avoids normal-tail error in small samples |
Common pitfalls
- It tests stochastic dominance, not strictly medians: Only when both groups share a similar distribution shape does U test a pure median shift. Report both medians/IQRs and mean ranks.
- Paired data requires Wilcoxon signed-rank: If the same participants were measured twice, use the Wilcoxon signed-rank test calculator instead.
- Normal data comparison: Check the Welch’s and Student’s t-test calculator or read how to choose a statistical test.
Common questions
Frequently asked questions
What is the difference between Mann–Whitney U and Wilcoxon rank-sum W?
They are equivalent formulations of the same test: U shifts the rank sum R₁ by subtracting the minimum possible sum n₁(n₁+1)/2. Both yield identical p-values.
Why does the Hodges–Lehmann difference sometimes differ from Median₁ − Median₂?
Hodges–Lehmann takes the median of all n₁ × n₂ cross-group differences rather than subtracting the two group medians separately, so it aligns directly with the rank-sum test statistic.
When does this calculator switch from exact p to asymptotic p?
Whenever there are no ties and combined N ≤ 40, the calculator computes the exact permutation p-value via dynamic programming. When ties exist or N > 40, it reports the tie-corrected normal z approximation.