Mann-Whitney U Test Calculator
Enter the raw data for two independent groups, choose your significance level and hypothesis direction, and this calculator works out the Mann-Whitney U statistic, z-score, p-value, rank-biserial effect size, and group medians. Results update as you type. The steps panel shows the full ranking and U calculation with your actual numbers.
What is the Mann-Whitney U test?
The Mann-Whitney U test (also called the Wilcoxon rank-sum test) is a non-parametric statistical method for comparing two independent groups. It tests whether one group tends to have larger values than the other without assuming the data follow a normal distribution. This makes it a robust alternative to the independent-samples t-test when normality cannot be confirmed, sample sizes are small, or the outcome variable is measured on an ordinal scale. The test works by ranking all observations from both groups together and then checking whether the ranks are distributed roughly equally or skewed toward one group.
How the U statistic is calculated
The test begins by sorting all observations from both groups into a single ranked list. Tied values receive the average of the ranks they would have occupied. The rank sum for each group is then computed separately. From the rank sums, two U values are derived: U1 = W1 - n1(n1+1)/2 and U2 = W2 - n2(n2+1)/2, where W1 and W2 are the rank sums and n1, n2 are the sample sizes. These always sum to n1 * n2. The test statistic U is the smaller of U1 and U2. For statistical inference, U is converted to a z-score using the normal approximation: z = (U1 - n1*n2/2) / sqrt(var_U), where the variance accounts for any tied ranks via a correction factor. A continuity correction of 0.5 in the numerator improves accuracy for small to moderate samples.
Effect size and how to report results
Statistical significance (the p-value) tells you how likely the data are under the null hypothesis, but it does not tell you the practical size of the difference. The rank-biserial correlation r = 1 - 2U/(n1*n2) is a natural effect size for the Mann-Whitney U test. It ranges from -1 to 1 and can be interpreted using Cohen's rough benchmarks: |r| below 0.1 is negligible, 0.1-0.3 is small, 0.3-0.5 is medium, and above 0.5 is large. In a results section, report the test statistic (U), z, p-value, and r. For example: "Group 1 (Mdn = 16.5) scored significantly higher than Group 2 (Mdn = 11), U = 14, z = 1.96, p = 0.050, r = 0.43."
When to use the Mann-Whitney U test
Use this test when you have two independent groups and you want to compare a single continuous or ordinal outcome variable. The Mann-Whitney U test is appropriate when the normality assumption of the t-test is violated (for example, with Likert-scale data, reaction times, or small samples), when you have outliers that would distort a mean-based analysis, or when your data are ordinal ranks rather than interval measurements. Unlike the t-test, it does not require equal variances. The main assumption is that observations within and between groups are independent. If you have paired or matched data, use the Wilcoxon signed-rank test instead. For three or more groups, consider the Kruskal-Wallis test.
Effect size interpretation (rank-biserial r)
| |r| range | Effect size | Interpretation |
|---|---|---|
| 0.00 - 0.09 | Negligible | The groups are nearly indistinguishable in ranking |
| 0.10 - 0.29 | Small | A small but potentially meaningful difference in rank ordering |
| 0.30 - 0.49 | Medium | A moderate difference worth further investigation |
| 0.50 and above | Large | A substantial difference in rank distributions |
Commonly used thresholds for interpreting the magnitude of the rank-biserial correlation effect size (r) in the Mann-Whitney U test. Based on Cohen (1988) conventions adapted for non-parametric tests.
Frequently asked questions
What is the difference between Mann-Whitney U and the Wilcoxon rank-sum test?
They are the same test. The Mann-Whitney U version focuses on counting how often a value from one group outranks a value from the other group, while the Wilcoxon rank-sum version focuses on the sum of ranks in the smaller group. Both approaches produce mathematically equivalent results and identical p-values. The two names reflect who introduced each formulation.
What is U1 + U2 always equal to?
U1 + U2 always equals n1 * n2, the product of the two sample sizes. This is a useful check: if your U1 and U2 do not sum to n1 * n2, there is an error in the ranking or formula.
When should I use a one-tailed vs. two-tailed test?
Use a two-tailed test when you have no prior reason to expect which group should be larger - it detects a difference in either direction. Use a one-tailed test only when you have a strong, pre-specified directional hypothesis (for example, you predicted before collecting data that Group 1 would score higher). One-tailed tests have more power in the predicted direction but miss effects in the opposite direction. Most published research uses two-tailed tests unless a directional hypothesis was registered in advance.
What does the p-value mean in this test?
The p-value is the probability of observing a U statistic at least as extreme as the one calculated, assuming the null hypothesis is true (that the two groups come from the same distribution). A small p-value (below your chosen alpha, typically 0.05) means this result would be unlikely by chance alone, giving reason to reject the null hypothesis. It does not measure the size of the effect or the probability that the null hypothesis is true.
What is rank-biserial correlation (r) and how large should it be?
Rank-biserial correlation r is an effect size that measures how consistently one group outranks the other. It equals 1 - 2U/(n1*n2) and ranges from -1 (Group 2 always wins) to +1 (Group 1 always wins), with 0 meaning the groups rank equally often. Conventions from Cohen (1988), adapted for rank tests, suggest |r| of 0.1 is small, 0.3 is medium, and 0.5 is large. Unlike the p-value, r does not depend on sample size, so it is essential to report alongside the p-value.
Does the Mann-Whitney U test compare medians?
Strictly speaking, the Mann-Whitney U test compares rank distributions, not medians. If the two distributions have the same shape and spread, a significant result implies a difference in location (medians), but if the shapes differ, the test is comparing the probability that a random draw from Group 1 exceeds a random draw from Group 2 (the "probabilistic index"). In practice, researchers often describe the test in terms of medians and should report both group medians alongside the test result.
What is the continuity correction and should I use it?
The continuity correction subtracts 0.5 from the numerator of the z-score (i.e., uses |U - E(U)| - 0.5) before dividing by the standard deviation. Because U is a discrete statistic approximated by a continuous normal distribution, this correction improves the accuracy of the p-value, especially with small or moderate sample sizes. It is recommended by most introductory statistics texts for n below about 25 per group. For large samples the difference is negligible.