Mann-Whitney U Test Calculator
Compare two independent samples with a nonparametric rank-sum test and obtain the U statistic, normal Z score, and two-sided p value.
About the Mann-Whitney U test
The Mann-Whitney U test compares two independent groups by ranking their pooled observations. It is also called the Wilcoxon rank-sum test. Unlike an independent-samples t test, it does not require normally distributed measurements. It is useful for ordinal outcomes, skewed continuous data, small samples, or situations where strong outliers make a mean-based comparison questionable. The null hypothesis states that observations from the two populations have the same distribution. The calculation combines both samples, sorts every value, and assigns ranks from smallest to largest. Tied observations receive the average of the ranks they occupy. The rank total for the first sample is converted to U, and the complementary U value is computed for the second sample. This calculator reports the smaller U statistic because it is the conventional test statistic for a two-sided comparison. A small U indicates that values from one group tend to occupy consistently lower or higher ranks than values from the other. For inference, the calculator standardizes U using its null mean and variance. The variance includes a tie correction, because repeated values reduce the variability of the rank sum. It then obtains a two-sided p value from the standard normal approximation. A p value below a chosen significance threshold, commonly 0.05, is evidence against the null hypothesis. It is not the probability that the null hypothesis is true, and it does not by itself describe the size or practical importance of a difference. Interpretation needs care. If the group distributions have similarly shaped spreads, the test is often described as a comparison of locations or medians. When their shapes differ substantially, the result is more generally evidence that one distribution tends to generate larger observations. Samples must be independent: a participant should not contribute to both groups. Paired before-and-after measurements require a paired method such as the Wilcoxon signed-rank test instead. For very small samples, an exact U distribution can be preferable to the normal approximation. This page uses the transparent large-sample approximation with tie correction so its results are reproducible and easy to audit. Report sample sizes, U, the p value, an effect-size estimate, and descriptive summaries whenever possible.
Mann-Whitney examples
| Samples | Result | Interpretation |
|---|---|---|
| A: 1, 2, 3; B: 4, 5, 6 | U = 0, p about 0.0495 | Every observation in B exceeds every observation in A. |
| A: 1, 3, 5; B: 2, 4, 6 | U = 3, p about 0.5127 | The ranks interleave and provide little evidence of separation. |
| A: 10, 12, 12; B: 8, 9, 14 | U = 3 | The repeated value 12 receives an average rank and tie correction. |
How to run the U test
- Paste numeric observations for Sample A, separated by commas or spaces.
- Paste independent observations for Sample B in the second field.
- Select Calculate Mann-Whitney U to rank the combined data.
- Interpret the two-sided p value alongside the U statistic and sample context.
Mann-Whitney U FAQ
Is Mann-Whitney a test of medians?
It can be interpreted as a location or median comparison when group distributions have similar shapes. More generally, it tests whether the distributions differ in stochastic ordering.
Can the groups have different sample sizes?
Yes, equal sample sizes are not required. Both samples must still contain independent observations from their respective populations.
How are ties handled?
Tied values receive their average pooled rank. The normal-approximation variance is reduced with the standard tie correction.
What does a small p value mean?
It means the observed rank separation would be unusual under the null model. It does not measure effect size or prove a causal relationship.
Should paired data use this calculator?
No, Mann-Whitney assumes independent groups. Use a Wilcoxon signed-rank test or another paired method for matched observations.