Mann-Whitney U Test Calculator
Compare two independent samples that aren't normally distributed. Paste your numbers to get the U statistic, an exact or tie-corrected p-value, an effect size, and every ranking step — all in your browser, no signup.
How it works
The Mann-Whitney U test — equivalently the Wilcoxon rank-sum test — asks whether one of two independent groups tends to produce larger values than the other. It is the non-parametric alternative to the two-sample t-test: instead of comparing means, it compares the whole distributions by rank, so skew, outliers, and ordinal data don't break it.
- Rank the pooled data.All N = n₁ + n₂ observations from both groups are sorted together and ranked 1…N. Tied values receive the average of the ranks they span — two values tied for ranks 5 and 6 each become 5.5 (Mann & Whitney, 1947).
- Sum the ranks. R₁ is the total rank of sample A, R₂ of sample B. As a check, R₁ + R₂ must equal N(N+1)/2.
- Form the U statistics.
U₁ = R₁ − n₁(n₁+1)/2and U₂ = n₁n₂ − U₁. The reported statistic is U = min(U₁, U₂). This tool also recomputes U₂ directly from R₂ as an independent cross-check. - Exact p-value (small, tie-free samples). When both groups have 20 or fewer values and there are no ties, the exact null distribution of U is enumerated with the recurrence c(m, n, u) = c(m−1, n, u−n) + c(m, n−1, u), and the p-value is the share of arrangements at least as extreme as yours over C(N, n₁) total arrangements.
- Normal approximation (ties or larger samples). Otherwise the test uses μ_U = n₁n₂/2 and the tie-corrected standard deviation σ_U =
√((n₁n₂/12)·[(N+1) − Σ(tⱼ³−tⱼ)/(N(N−1))]), where tⱼ is the size of each group of tied values (NIST e-Handbook). The z-score (with an optional ±0.5 continuity correction toward the mean) is read against the standard-normal distribution.
Two effect sizes accompany the verdict: the rank-biserial correlation r = (U₁ − U₂)/ (n₁n₂), bounded in [−1, 1], and the common-language effect size (CLES) = U/(n₁n₂), the probability that a randomly picked value from one group beats one from the other. Every step above runs client-side, so nothing you paste leaves your device.
Worked examples
Frequently asked questions
Sources & references
- Mann, H. B. & Whitney, D. R. (1947) — On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other (Annals of Mathematical Statistics)
- NIST/SEMATECH e-Handbook of Statistical Methods — normal approximation, tie correction, and continuity correction
- Wilcoxon, F. (1945) — Individual Comparisons by Ranking Methods (Biometrics Bulletin)
The formulas and both worked examples on this page were last cross-checked against these sources — and against a SciPy reference case — on 2026-07-09.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.