Mann-Whitney U test calculator

This Mann-Whitney U test calculator compares two independent groups without assuming normal data. Paste both groups and get U, the p value (exact for small samples without ties), z, each group’s median and the rank-biserial effect size. The test is also known as the Wilcoxon rank-sum test.

The numbers are calculated in your browser. Nothing you enter is sent or stored.

Mann-Whitney U test calculatorOr describe it in Studio →

Two independent groups. The numbers stay in your browser.

The two groups differ significantly (p = .008).

U
0 (U₁ = 25, U₂ = 0)
p (two-tailed)
0.0079 exact
p (one-tailed)
0.0040 in the direction observed
z
2.507
Effect size (rank-biserial r)
1
Group 1
Mdn = 5.6, n = 5, rank sum = 40
Group 2
Mdn = 4.3, n = 5, rank sum = 15

To report

U = 0, p = .008, r = 1.00

Check your result: U₁ + U₂ must equal n₁ × n₂ (25 + 0 = 25 in the worked example), and the two rank sums must add up to N(N + 1) ÷ 2 (40 + 15 = 55). The rank-biserial r always lies between −1 and 1.
exact p in the worked example
0.0079
exact p in the worked example
largest n₁ × n₂ for an exact p, with no ties
400
largest n₁ × n₂ for an exact p, with no ties
rank arrangements counted for it
252
rank arrangements counted for it
rank-biserial r in the example
1.00
rank-biserial r in the example
  • Exact p for small samples
  • Tie and continuity corrections
  • U₁, U₂, z and rank sums
  • Rank-biserial effect size
  • Runs in your browser, free

01

How to use the calculator

  1. Paste the values of each group into its box. The groups can have different sizes.
  2. Read U and the p value. They update as you type.
  3. Report the medians and the effect size alongside the p value.
12457368910smallestlargestrankgroup 1group 2
Rank tests replace values with their order. All the observations are sorted together and numbered from smallest to largest. The test then asks whether one group's ranks sit lower or higher than chance would put them. Because only the order matters, one extreme value cannot dominate the result. Here the filled group has rank sum 19 and the open group 36.

02

When to use the Mann-Whitney U test

  • Two independent groups. For paired or before-and-after data use the Wilcoxon signed-rank test.
  • The outcome is ordinal (ratings, scores) or is a measurement that is clearly skewed or has outliers, especially in small samples.
  • If the data are close to normal, the t-test is slightly more powerful. For three or more groups use the Kruskal–Wallis test.

03

How U is calculated

Rank all values from both groups together, giving tied values the average of their ranks. With R₁ the sum of ranks in group 1:

U₁ = R₁ − n₁(n₁ + 1) ÷ 2, U₂ = n₁n₂ − U₁, U = the smaller of the two

U₁ is the number of pairs (one value from each group) in which the group 1 value is the larger, counting ties as half.

p value. When there are no ties and n₁ × n₂ is at most 400, the calculator counts every possible arrangement of the ranks and reports the exact p. Otherwise it uses the normal approximation, with a correction for ties in the variance and a continuity correction of 0.5:

z = (|U₁ − n₁n₂/2| − 0.5) ÷ √( n₁n₂/12 × [ (N + 1) − Σ(t³ − t) ÷ (N(N − 1)) ] )

04

Worked example

The calculator opens with group 1: 5.1, 4.9, 5.6, 5.8, 6.0 and group 2: 4.1, 4.5, 4.3, 4.8, 4.0. Every value in group 1 is larger than every value in group 2, so group 1 holds ranks 6 to 10 (sum 40) and group 2 ranks 1 to 5 (sum 15).

U₁ = 40 − 15 = 25, U₂ = 0, U = 0

Only 2 of the 252 ways to split ten ranks into two groups of five are this extreme, so the exact two-sided p is 2 ÷ 252 = 0.0079. Reported as: U = 0, p = .008, r = 1.00, with medians 5.6 and 4.3.

05

Effect size: rank-biserial correlation

r = (U₁ − U₂) ÷ (n₁ × n₂)

It runs from −1 to +1. A value of +1 means every group 1 value exceeds every group 2 value, 0 means the groups overlap completely, and r = 0.5 means that group 1 wins 75% of all pairwise comparisons.

06

What the test does and does not show

The test asks whether values in one group tend to be larger than values in the other. It is a comparison of medians only when the two distributions have the same shape; with different shapes or spreads, a significant result can occur even when the medians are equal. Look at the data before describing the result as a difference in medians.

07

Common mistakes with the Mann-Whitney U test

  • Using the normal approximation for small groups. For the worked example it gives p = 0.012; the exact p is 0.0079.
  • Switching to a t-test on data with an extreme value. Change the 6.0 in the example to 60: the Welch t-test p goes from 0.0027 to 0.34, while the Mann-Whitney p stays 0.0079.
  • Analysing paired data as two groups. Five subjects measured twice, each 1 unit higher the second time (10, 20, 30, 40, 50 then 11, 21, 31, 41, 51), give a Mann-Whitney p of 0.69; the Wilcoxon signed-rank test on the pairs gives 0.037 (a normal approximation, since every difference is the same).

Trust

How this page is checked

  • The calculation runs on code with automated tests against worked reference values. Every number in the examples on this page was produced by that same code, not typed by hand.
  • The formulas and conventions used are stated on the page, so you can reproduce the result yourself or compare it with your own software.
  • Sources: Mann and Whitney (1947), On a test of whether one of two random variables is stochastically larger than the other.
  • Last reviewed by the Sciloom team, Zebra Nine Studio Inc. It is a tool for research and teaching, not a substitute for a statistician, a validated lab method or medical advice.

Cite this page

Sciloom. (2026). Mann-Whitney U test calculator. Zebra Nine Studio Inc. https://sciloom.si/mann-whitney-u-test-calculator

Read the full methodology · Who makes Sciloom

Frequently asked questions

What is the Mann-Whitney U test used for?

To compare two independent groups when the data are ordinal or not normally distributed. It tests whether values in one group tend to be larger than in the other.

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

Yes. They are two forms of the same test and give the same p value. The Wilcoxon signed-rank test is a different test, for paired data.

Which U value do I report?

Most often the smaller of U₁ and U₂, which the calculator labels U. Software differs, so the calculator shows both.

What sample size does the test need?

It works with very small groups, but there is a floor: with three values in each group the smallest possible two-sided p is .10, and with four in each it is .029. The exact p value is used whenever there are no ties and the groups are small.

Data roughly normal? The t-test calculator has more power and gives a confidence interval.
Free to start, no sign-up.
Back to the tool ↑

More research tools