Mann-Whitney U Test Calculator
Calculate the Mann-Whitney U statistic and z-score for comparing two independent groups using rank sums.
About this calculator
This calculator computes the Mann-Whitney U statistic — a non-parametric alternative to the t-test — from the two group sizes and the rank sum you assign to Group 1 after ranking every observation from both groups together: U = n₁n₂ + n₁(n₁+1)/2 − R₁ (line 9). Group 1 Size has the largest measured effect on U at the calculator's default values, ahead of Group 2 Size and Rank Sum for Group 1, because n₁ appears twice in the formula — once in the n₁n₂ product and again, squared, inside n₁(n₁+1)/2 — while Group 2 Size and Rank Sum for Group 1 each appear only once.
U' Statistic is n₁n₂ − U (line 10), which algebraically simplifies to R₁ − n₁(n₁+1)/2 once U's own formula is substituted in — Group 2 Size cancels out of that expression completely, so it has zero effect on U' even though it clearly matters for U itself. The z-score applies a continuity correction (subtracting 0.5 before dividing by the standard deviation, line 19), and the calculator does not adjust for tied ranks, which real Mann-Whitney implementations typically correct for with a variance adjustment.
Inputs
Results
U Statistic
165
Z-Score
2.16
P-Value (two-tailed, approx)
0.03
How to Use This Calculator
- Enter Group 1 Size (n₁), Group 2 Size (n₂), and Rank Sum for Group 1 (R₁).
- Review U Statistic, Z-Score, and P-Value (two-tailed, approx).
- Use U and U (min) to inform your decision.
- Use the chart to visualize the results and explore different scenarios by adjusting inputs.
How the result changes with Group 1 Size (n₁)
| Group 1 Size (n₁) | U Statistic | Z-Score | P-Value (two-tailed, approx) |
|---|---|---|---|
| 7.5 | -35.63 | 6.16 | 0 |
| 11 | 51 | 1.61 | 0.11 |
| 23 | 441 | 8 | 0 |
| 38 | 1,131 | 16.69 | 0 |
What each input means
- Group 1 Size (n₁)
- Number of observations in the first group.
- Group 2 Size (n₂)
- Number of observations in the second group.
- Rank Sum for Group 1 (R₁)
- Sum of ranks assigned to Group 1 after ranking all observations together.
How this is calculated
Worked example, using the default values
- Identify Input ParametersGroup 1 Size (n₁) = 15, Group 2 Size (n₂) = 15, Rank Sum for Group 1 (R₁) = 180 = 3 input(s) provided
- Calculate U StatisticU Statistic165 = 165
- Calculate Z-ScoreZ-Score2.1569 = 2.1569
- Calculate P-ValueP-Value = Math0.031 = 0.031
- Calculate U' StatisticU' Statistic60 = 60
- Calculate UU60 = 60
Engine last updated . Checked against 2 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.
Frequently Asked Questions
Why does Group 1 Size move the U Statistic more than Group 2 Size does?
Group 1 Size (n₁) appears twice in the formula U = n₁n₂ + n₁(n₁+1)/2 − R₁ (line 9) — once multiplying n₂ and again inside the n₁(n₁+1)/2 term — while Group 2 Size only appears once, in the n₁n₂ product. That double appearance is why a proportional change to Group 1 Size produces a larger swing in U.
Does Group 2 Size affect the U' Statistic shown?
No. U' Statistic is n₁n₂ − U (line 10), and substituting U's own formula shows the n₁n₂ term cancels exactly, leaving U' = R₁ − n₁(n₁+1)/2 — an expression with no n₂ term at all. Group 2 Size still matters for the plain U Statistic, just not for its complement.
What does the continuity correction in the Z-Score formula do?
The engine subtracts 0.5 from the absolute difference between U and its expected value before dividing by the standard deviation (line 19), a standard adjustment for comparing a discrete statistic like U against the continuous normal distribution used to estimate the p-value.
Does this calculator adjust for tied ranks?
No. The standard deviation formula (line 16) assumes no ties among the ranked observations. Real datasets with tied values technically need a variance correction that this simplified version does not apply, which can make the reported Z-Score and P-Value slightly optimistic when your data has many ties.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Kruskal-Wallis Test Calculator
Perform a Kruskal-Wallis H test to compare rank distributions across multiple independent groups.
StatisticsT-Test Calculator
Calculate the t-statistic, degrees of freedom, and approximate p-value for a one-sample t-test.
StatisticsZ-Score Calculator
Calculate the z-score (standard score) for any value in a normal distribution. Find the percentile ranking and probability associated with your data point.
More in Math & Statistics.