Mann–Whitney U test calculator

Paste two independent samples to compare them without assuming normal data. You get the U statistic, the p-value (exact for small samples without ties, otherwise the normal approximation) and the effect size.

Numbers separated by commas, spaces or semicolons.
The second, independent group. The sizes may differ.
Between 0 and 1, usually 0.05.
U (the smaller of U₁ and U₂)2.5
p-value0.01002
Result at α
p < α: significant, reject the null hypothesis
U₁ (pairs where sample 1 is larger)
2.5
U₂ (pairs where sample 2 is larger)
39.5
z (normal approximation)
-2.57497
p-value, normal approximation
0.01002
Rank-biserial correlation
-0.880952
Probability that a value from sample 1 is larger
0.0595238
Rank sum of sample 1
30.5
Rank sum of sample 2
60.5
Median of sample 1
14
Median of sample 2
19.5
Sample sizes
7, 6

The data have ties, so the p-value uses the normal approximation with the tie-corrected variance.

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Paste the values of the first group into Sample 1 and the second group into Sample 2.
  2. Choose two-tailed unless you decided on a direction before seeing the data.
  3. Read U, the p-value and whether it is below your significance level.

How the test works

All values are ranked together from smallest to largest; tied values share the average of their ranks. With R₁ the rank sum of sample 1:

  • U₁ = R₁ − n₁(n₁ + 1)/2 and U₂ = n₁n₂ − U₁. U₁ counts the pairs in which the value from sample 1 is larger (ties count ½).
  • Normal approximation: mean μ = n₁n₂/2, variance σ² = n₁n₂/12 × ((N + 1) − Σ(t³ − t)/(N(N − 1))), where t is the size of each group of ties. z = (U₁ − μ ∓ ½)/σ with the continuity correction.
  • Exact p-value: with no ties and samples of at most 49, the calculator counts how many of the C(N, n₁) equally likely rank arrangements give a U as extreme as yours.
  • Effect size: rank-biserial correlation = (U₁ − U₂)/(n₁n₂), from −1 to 1; U₁/(n₁n₂) is the probability that a random value from sample 1 is larger than one from sample 2.

Worked example

Sample 1: 12, 15, 11, 18, 14, 16, 13. Sample 2: 19, 17, 22, 16, 21, 20.

Ranked together, sample 1 gets ranks 1, 2, 3, 4, 5, 6.5 and 9 (the two 16s share 6.5), so R₁ = 30.5 and U₁ = 30.5 − 7 × 8/2 = 2.5; U₂ = 42 − 2.5 = 39.5. Because of the tie the normal approximation is used: μ = 21, σ² = 42/12 × (14 − 6/156) = 48.87, σ = 6.99, z = (2.5 − 21 + 0.5)/6.99 = −2.57, two-tailed p = 0.010. At α = 0.05 the difference is significant.

Tips and common mistakes

  • The two samples must be independent. For before-and-after measurements on the same people, use the Wilcoxon signed-rank test.
  • Many ties weaken the test; heavily rounded data or short rating scales are common causes.
  • A non-significant result does not show the groups are the same, only that the data do not show a difference.

Frequently asked questions

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

When the two groups are independent and the data are ordinal, clearly skewed or have outliers, so the t-test's assumption of roughly normal data is doubtful. It compares ranks rather than means.

Is it the same as the Wilcoxon rank-sum test?

Yes. The Wilcoxon rank-sum statistic W is the rank sum of one group, and U = W − n(n + 1)/2. Both give the same p-value. Some software, such as R, reports U₁ under the name W.

Exact or normal p-value: which does the calculator use?

When there are no ties and each sample has at most 49 values, it counts every possible arrangement of the ranks and gives the exact p-value. Otherwise it uses the normal approximation with a tie correction and, by default, a continuity correction of ½.

Does a significant result mean the medians differ?

Only if the two distributions have the same shape. In general the test says that values from one group tend to be larger than values from the other, which the probability row shows directly.

More in Math

All tools in this category: Math ·Updated November 4, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.