Skip to content
MoneyDeck

Mann-Whitney U Test Calculator

Compare two independent groups without assuming normality

Updated · Free, no signup

Separate numbers with commas, spaces or new lines.

p-value

0.0037

U statistic (smaller of U₁, U₂)

4

U₁ (group 1)

4

U₂ (group 2)

52

Rank sum R₁

32

Rank sum R₂

88

z score (normal approximation)

-2.7196

Effect size r = |z| / √N

0.702

Probability group 1 > group 2 (U₁ ÷ n₁n₂)

0.071

Decision

Reject H₀ at α = 0.05: the groups differ significantly

Method used

Exact distribution of U

n₁

7

n₂

8

  • p = 0.0037 (exact distribution of U). Median of group 1 = 14, median of group 2 = 21.5.
  • Effect size r = 0.702 (large by Cohen’s 0.1 / 0.3 / 0.5 guide); a random group-1 value beats a random group-2 value with probability 0.071.

Mean rank by group

Pooled ranking

ValueGroupRank
9Group 11
11Group 12
12Group 13
14Group 14
15Group 15
16Group 26
17Group 17
18Group 28
19Group 29
20Group 110
21Group 211
22Group 212
24Group 213
25Group 214
28Group 215

About the Mann-Whitney U Test Calculator

This Mann-Whitney U test calculator compares two independent groups using ranks instead of raw values. Paste the observations for each group and it pools and ranks them (ties get the average rank), adds up the rank sums, converts them to the U statistics and returns a p-value — exact for small samples without ties, or from the normal approximation with tie and continuity corrections for larger or tied data. It also reports the effect size r = |z| / √N, the probability of superiority and each group’s median.

The test is the go-to nonparametric alternative to the independent two-sample t-test. Use it when the data are ordinal (Likert ratings, pain scores, rankings), clearly skewed, contain outliers, or the samples are too small to trust a normality assumption. Researchers, students and analysts use it to compare things like customer satisfaction between two stores, reaction times between two treatments or test scores between two classes.

The test is also called the Wilcoxon rank-sum test or the Mann-Whitney-Wilcoxon test; the U statistic and the rank-sum W carry the same information. It assumes the observations are independent within and between groups. Strictly it tests whether one distribution tends to produce larger values than the other (stochastic dominance); it is a test of medians only when the two distributions have the same shape.

With the default inputs, the p-value is 0.0037. Change any value above to recalculate instantly.

How to use the mann-whitney u test calculator

  1. 1Paste the values for the first group into the Group 1 box.
  2. 2Paste the values for the second, independent group into the Group 2 box.
  3. 3Choose a two-tailed test or a one-tailed direction.
  4. 4Leave the method on Automatic unless you need a specific approach.
  5. 5Read the p-value and decision, then check the effect size and the ranking table.

Formula and method

U₁ = R₁ − n₁(n₁ + 1)/2 U₂ = n₁n₂ − U₁ z = (U₁ − n₁n₂/2 ∓ 0.5) ÷ σ_U σ_U² = n₁n₂/12 · [(N + 1) − Σ(t³ − t) / (N(N − 1))]

All N = n₁ + n₂ observations are pooled and ranked from smallest to largest; tied values share the average of the ranks they occupy. R₁ is the sum of group 1’s ranks, and U₁ counts how many (group 1, group 2) pairs have the group 1 value larger, with ties counting one half. Under the null hypothesis that both groups come from the same distribution, U₁ is centred on n₁n₂/2.

For small samples without ties the calculator enumerates the exact distribution of U, so the p-value is exact. Otherwise it uses the normal approximation with the tie-corrected variance shown above and, by default, a 0.5 continuity correction — the same approach as R’s wilcox.test and SciPy’s mannwhitneyu. The effect size r = |z| / √N and the probability of superiority U₁ / (n₁n₂) describe how large the difference is, independent of sample size.

n₁, n₂
Sizes of group 1 and group 2; N = n₁ + n₂
R₁
Sum of the ranks of group 1 in the pooled ranking
U₁, U₂
Mann-Whitney statistics for each group (U₁ + U₂ = n₁n₂)
t
Number of observations in each group of tied values
σ_U
Standard deviation of U under the null hypothesis

Worked examples

Reaction times under two conditions (exact test)

Group 1’s seven values take ranks summing to 32, so U₁ = 32 − 28 = 4 and U₂ = 56 − 4 = 52. With no ties and 15 values, the exact distribution of U gives a two-tailed p ≈ 0.0037, so the groups differ at α = 0.05.

Likert satisfaction ratings with ties (normal approximation)

Ratings on a 1–5 scale have many ties, so ranks are averaged and the normal approximation with tie correction is used. Store 1’s rank sum is 139.5, giving U₁ = 139.5 − 55 = 84.5. The tie- and continuity-corrected z of about 2.65 gives p ≈ 0.0081: store 1 customers rate significantly higher.

One-tailed test: is the new method faster?

Only 2 of the 36 cross-group pairs have the new-method time larger, so U₁ = 2. Of the 924 equally likely ways to split the 12 ranks, only 4 give a U₁ this small, so the exact one-tailed p = 4 / 924 ≈ 0.0043, strong evidence that the new method gives lower times.

Frequently asked questions

When should I use the Mann-Whitney U test instead of a t-test?+

Use it when the two groups are independent and the data are ordinal, strongly skewed, contain outliers, or the samples are small enough that you cannot check normality. With large, roughly normal samples the t-test is slightly more powerful.

Is the Mann-Whitney U test the same as the Wilcoxon rank-sum test?+

Yes. They are the same test expressed with different statistics: Wilcoxon’s rank sum W = R₁ and Mann-Whitney’s U₁ = R₁ − n₁(n₁ + 1)/2. Both give identical p-values.

Does the Mann-Whitney test compare medians?+

Only if the two distributions have the same shape and spread. In general it tests whether values from one group tend to be larger than values from the other, which is why the probability of superiority is a natural effect size.

How are ties handled?+

Tied values receive the average of the ranks they span, and the variance of U is reduced by the tie correction term Σ(t³ − t). Because ties break the exact distribution, the calculator switches to the normal approximation when ties exist.

Which U do I report?+

Many textbooks and tables use the smaller of U₁ and U₂ and compare it with a critical value. Software such as SciPy reports U₁ for the first group. Both lead to the same p-value; state which one you used.

What is a good effect size for the Mann-Whitney test?+

r = |z| / √N is commonly read with Cohen’s thresholds: about 0.1 small, 0.3 medium and 0.5 large. The probability of superiority (0.5 means no effect) is often easier to explain to non-statisticians.

Related tools