Mann-Whitney U Calculator
This calculator computes the Mann-Whitney U statistic, the workhorse non-parametric test for comparing two independent groups when you cannot assume the data is normally distributed. Where the two-sample t-test compares means and assumes roughly normal data, the Mann-Whitney U test, also known as the Wilcoxon rank-sum test, compares the distributions using ranks, so it makes no assumption about their shape. It works by pooling both groups, ranking every value from smallest to largest, and then asking whether the values from one group tend to rank higher than those from the other. This makes it ideal for small samples, skewed data, ordinal data, and situations with outliers, where a t-test could be misleading. It is one of the most widely used tests in fields from medicine to user research. This calculator does the rank arithmetic for you. You paste the values for each of the two groups, and it pools and ranks them, sums the ranks for each group, and returns the U statistic along with U1 and U2 and the two sample sizes. The results update as you type. Use it for statistics study, for comparing two groups of non-normal data, or as a robust alternative to the t-test. The test computes a U value for each group from its rank sum, where U1 is the first group's rank sum minus the minimum possible, and U2 follows from the relationship that U1 plus U2 equals the product of the two sample sizes. The reported U is the smaller of the two, which is the value compared against critical tables or used to find a p-value. A small U indicates a large separation between the groups. This calculator provides the U statistic, the part that comes from your data; complete the test by comparing it against the appropriate critical value or p-value for your sample sizes.
Pools and ranks both groups, sums ranks, then computes U for each. Reported U is the smaller. Non-parametric, so no normality assumption. Compare against critical tables or a p-value.
How it works
Both groups are pooled and every value is ranked from smallest to largest, with ties sharing the average rank. The ranks of the first group are summed to give R1. Then U1 is R1 minus n1 times n1 plus one over two, and U2 is the product of the sample sizes minus U1. The reported statistic is the smaller of U1 and U2.
Worked example
For group 1 (1, 3, 5, 7) and group 2 (2, 4, 6, 8), the pooled ranks are 1 to 8. Group 1's values take ranks 1, 3, 5 and 7, summing to 16. U1 is 16 minus 4 times 5 over 2, which is 6. U2 is 4 times 4 minus 6, which is 10. The reported U is the smaller, 6.
Related calculators
- Two-Sample t-Test: parametric comparison.
- Spearman Correlation: rank correlation.
- Chi-Square: goodness of fit.
- Standard Deviation: spread.