Skip to content

Mann-Whitney U Test Calculator

Paste two groups of ratings or skewed measurements to compare them by rank with the…

Paste two groups of ratings or skewed measurements to compare them by rank with the Mann-Whitney U test, which needs no normal distribution.

Read 12 values; left out the header row (“New design”).

Read 11 values; left out the header row (“Old design”).

More optionsTwo-sided, 95% confidence
Hypothesis
Confidence level

The significance level is 1 − the confidence level (0.05 at 95%).

ExampleP-value

0.0022

A value from New design beats one from Old design 87.5% of the time (ties count half); medians 7.5 and 5. Significant at the 5% level (p < 0.05).

Paste your own numbers to test them.

New design n = 12Old design n = 11

Every value is a dot and the box is the middle half, split at the median.

The distribution the statistic follows if there were no difference; the shaded area beyond it is the p-value.

U (New design), U (Old design)
115.5, 16.5
Rank-biserial r
0.75
Method
Normal approx., ties corrected
How this works: 9 sources,

How this works

Method

The Mann-Whitney U test (also called the Wilcoxon rank-sum test) compares two independent groups by rank, not by mean. It suits ratings on a 1 to 10 scale, waiting times with a long tail, or small samples where you can’t trust a normal curve. In the example, people rated a new app design and an old one; the new design’s ratings sit clearly higher, with medians of 7.5 and 5. Full method

How it’s tested

2 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.

Privacy

On your device. Nothing you enter or open leaves this browser. About privacy labels

Changes

  • First published: live curves with draggable cut-offs, and tests on pasted data (t-tests, ANOVA, chi-square, Fisher’s exact, correlation, regression, A/B), checked against SciPy.

Every change on What’s new

How we make toolsReport a mistake

How the Mann-Whitney U test works

The Mann-Whitney U test (also called the Wilcoxon rank-sum test) compares two independent groups by rank, not by mean. It suits ratings on a 1 to 10 scale, waiting times with a long tail, or small samples where you can’t trust a normal curve. In the example, people rated a new app design and an old one; the new design’s ratings sit clearly higher, with medians of 7.5 and 5.

Rank every value from both groups together, smallest first, with ties sharing the average rank. Add up the first group’s ranks and turn the sum into U = R₁ − n₁(n₁ + 1)/2. U counts, over every pair of one value from each group, how many the first group wins, with ties as half a win. Divided by n₁ × n₂, it is the chance that a random value from the first group beats one from the second, a plain-language effect size.

For small groups without ties the p-value is exact: the page counts every way the ranks could have split between the groups, as SciPy does when either group has 8 or fewer values. Otherwise it uses the normal approximation with corrections for ties and for continuity. Ratings almost always have ties, so the example uses the approximation.

U₁ = R₁ − n₁(n₁ + 1)/2 · U₁ + U₂ = n₁n₂ · P(A beats B) = U₁ ÷ (n₁n₂)

Exact critical values of U (two-sided, 5%)

For two groups of the sizes shown with no ties: the smaller U must be at most this value for p ≤ 0.05, with the exact p-value at that U. Counted from every possible split of the ranks.

For two groups of the sizes shown with no ties: the smaller U must be at most this value for p ≤ 0.05, with the exact p-value at that U. Counted from every possible split of the ranks.
Group sizesPairs (n₁n₂)Critical UExact p at it
3 and 51500.0357
4 and 41600.0286
4 and 62420.0381
5 and 52520.0317
5 and 84060.0451
6 and 63650.0411
6 and 954100.0496
7 and 74980.0379
8 and 864130.0499
8 and 1080170.0434
Show all 12 rows
10 and 10100230.0433
12 and 12144370.0449

Common questions

Does the Mann-Whitney test compare medians?

Not exactly. It tests whether values from one group tend to be larger than values from the other. If the two groups have the same shape and spread, that amounts to a difference in medians, which is how it is often described.

When should I use it instead of a t-test?

With ranks or ratings, with small samples that are clearly skewed, or with outliers you can’t justify removing. With larger, roughly symmetric samples the t-test is a little more powerful and gives a difference in means you can interpret directly.

Why do other programs give a slightly different p-value?

Programs differ in whether they use the exact distribution, the normal approximation, the tie correction and the continuity correction. This page follows SciPy’s defaults and says which method it used.