Mann-Whitney U Test Calculator
Paste two independent samples and get U, the mean ranks, and a p-value — exact for small samples without ties, from the tie-corrected normal approximation otherwise — with z, the effect size r, the rank-biserial correlation, and every rank shown. Use it when a t-test's assumptions are doubtful: skewed data, outliers, or ratings on an ordinal scale. Free, no sign-up.
0 values
0 values
Enter at least two numbers in each sample.
How to Use the Mann-Whitney U Test Calculator
- 1. Enter the two samples. Paste each group's values into its own box — numbers separated by commas, spaces, or new lines. The groups must be independent: different people, not the same people measured twice.
- 2. Choose the alternative. Two-sided is the default. Pick a one-sided alternative only if you predicted which group would be larger before seeing the data.
- 3. Decide on the continuity correction. It is on by default, matching R and SciPy, and only affects the normal approximation; the exact p-value never uses it.
- 4. Read and report. The calculator says which p-value it used and why, ranks every value, works through U and z, and builds an APA line with the effect size.
What the U Statistic Counts
Pool both samples, rank them from smallest to largest (tied values share the average of their ranks), and add up the ranks of sample 1 to get R₁. Then U₁ = R₁ − n₁(n₁ + 1)/2, which equals the number of pairs — one value from each sample — in which the sample 1 value is larger, with ties counting half. U₂ = n₁n₂ − U₁ counts the pairs the other way. If the two populations are the same, each pair is a coin flip and U₁ should sit near n₁n₂/2; a U far from that middle is evidence that one group tends to produce larger values.
That makes the test a comparison of whole distributions: the null hypothesis is that a random value from one group is equally likely to be larger or smaller than a random value from the other. It becomes a test of medians only when the two distributions have the same shape and spread and differ by a shift. Two groups with the same median but different spreads can still give a significant U (Hart, 2001).
Exact p or Normal Approximation?
For small samples the calculator enumerates the exact distribution of U — every way the ranks could split between the groups — which is precise but only valid without ties. It uses the exact method when there are no ties and both groups have 20 or fewer values. Otherwise it compares U with a normal distribution whose variance is reduced for ties, σ² = n₁n₂/12 × [(N + 1) − Σ(t³ − t) / (N(N − 1))], with an optional 0.5 continuity correction. Software differs here: R's wilcox.test computes an exact p when both samples have fewer than 50 values and no ties, SciPy uses the exact method only when one sample has 8 or fewer values, and SPSS's output leads with the asymptotic (normal-approximation) significance. When your numbers disagree slightly with a package's, check which method it used.
Worked Example: Two Interface Designs
Click Try an example to load task-completion times in minutes for two app designs: design A (n₁ = 8, median 3.7) and design B (n₂ = 9, median 5.2). There are no ties, so the exact distribution applies.
Mann-Whitney U, step by step
Ranks of design A: 1, 2, 3, 4, 6, 7, 9, 12 → R₁ = 44
U₁ = 44 − 8 × 9/2 = 8; U₂ = 72 − 8 = 64; U = 8
exact two-sided p = .0055
μ = 36, σ = 10.39, z = (8 − 36 + 0.5) / 10.39 = −2.65, r = 2.65 / √17 = .64
rank-biserial = (8 − 64) / 72 = −.78
In APA style: completion times were shorter with design A (Mdn = 3.7) than with design B (Mdn = 5.2), U = 8, z = −2.65, p = .006, r = .64. Design A was slower in only 8 of the 72 possible pairs, which is what the rank-biserial correlation of −.78 expresses: a strong tendency for design A's times to be smaller.
Mann-Whitney U or a T-Test?
| Your situation | Better choice |
|---|---|
| Roughly normal data, or 30+ per group without extreme outliers | Welch's t-test — it compares means and is slightly more powerful |
| Small samples that are clearly skewed or have outliers | Mann-Whitney U |
| Ordinal data such as Likert ratings or rankings | Mann-Whitney U |
| The same participants measured twice | Neither — use the Wilcoxon signed-rank test or a paired t-test |
Frequently Asked Questions
- Is the Mann-Whitney U test a test of medians?
- Only under an extra assumption: that the two distributions have the same shape and spread, so one is a shifted copy of the other. Without that, the test asks whether values from one group tend to be larger than values from the other. Report medians as a description, but do not claim the test compared them unless the shapes are similar.
- When should I use the Mann-Whitney U test instead of a t-test?
- When your two independent samples are small and clearly non-normal, contain influential outliers, or are measured on an ordinal scale such as ratings. With moderate or large samples and no extreme skew, Welch's t-test is usually fine and answers a question about means, which is often what you want to report.
- What is the effect size for a Mann-Whitney U test?
- Two are common. r = |z| / √N, where N is the total sample size, is read like a correlation (about .1 small, .3 medium, .5 large). The rank-biserial correlation, (U₁ − U₂) / (n₁n₂), runs from −1 to 1 and has a direct meaning: the proportion of pairs favouring one group minus the proportion favouring the other.
- How do I report a Mann-Whitney U test in APA style?
- Give each group's median (or mean rank), then U, z if you used the normal approximation, p, and an effect size: U = 8, z = −2.65, p = .006, r = .64. Italicise U, z, p, r, and Mdn; drop the leading zero from p and r. Say whether p is exact or asymptotic.
- Why does my software give a different U or p-value?
- Three reasons are common. Some programs report U₁ (R calls it W) and others the smaller of U₁ and U₂ — both are shown here. Packages switch between exact and normal-approximation p-values at different sample sizes. And some apply the continuity correction by default while others do not; toggle it here to match.
- Is the Mann-Whitney U test the same as the Wilcoxon rank-sum test?
- Yes. Wilcoxon (1945) proposed the rank-sum statistic and Mann and Whitney (1947) the U statistic; they differ by a constant, U₁ = R₁ − n₁(n₁ + 1)/2, so they give the same p-value. It is not the same as the Wilcoxon signed-rank test, which is for paired data.