Formula: Mann-Whitney U Test Formula
- sampleSizeGroup1N1: Sample Size Group1 N1 (n₁)
- sampleSizeGroup2N2: Sample Size Group2 N2 (n₂)
- rankSumGroup1R1: Rank Sum Group1 R1 (R₁)
Compute Mann-Whitney U, Z-statistic, Common Language Effect Size (CLES), and Rank-Biserial r.
Software differs in which U it reports. Some print U₁, some U₂, some the smaller of the two. They always add to n₁n₂, so subtract the page's figure from n₁n₂ to get the other one. On the default the two values are 65 and the remainder of 15 × 15, and the page shows the smaller.
Yes. Tied observations receive averaged ranks, which can end in .5, and the sum can as well. The page uses the decimal value directly. It does not apply a tie correction to the standard deviation, so with many ties the Z will be a little smaller in magnitude than a package that corrects for them.
Either. The test is symmetric, so swapping the labels changes R₁ to R₂ and flips the sign of Z without changing its magnitude, U, r or CLES. Pick the labelling that makes your write-up clearest, and use group 1's rank sum consistently with its sample size.
R₁ must lie between n₁(n₁ + 1)/2, when group 1 holds every bottom rank, and that plus n₁n₂, when it holds every top rank. Anything outside is impossible, so the page returns an error instead of a result. Recheck that R₁ belongs to the group whose size you entered as n₁ and that you ranked the pooled data, not each group separately.
No, it stops at Z. For a two-sided test, compare the magnitude with 1.96 at the 5% level or 2.58 at the 1% level, or convert Z to a p value with a normal table. On the default, Z = -1.97 corresponds to a two-sided p just under 0.05.
Yes, for two independent samples they are equivalent. Wilcoxon's version works with the rank sum directly; Mann and Whitney's version converts it to U. Both give the same p value. The Wilcoxon signed-rank test for paired data is a different test and cannot be run on this page.
Yes. The formulas for U, its mean and its standard deviation all handle unequal n₁ and n₂. The expected U is still n₁n₂/2. With 23 and 15, for example, it is half of 23 × 15, as the result line shows. Very lopsided designs lose some power, but the test remains valid.
A common guideline is at least about ten per group, though the normal approximation is often adequate a little below that. The default of 15 per group is comfortably within range. For groups of five or fewer, use exact critical values from a table instead of relying on Z.
The two groups are perfectly intermixed: U equals its expected value n₁n₂/2, Z is 0 and CLES is 50%. On the default sizes that happens when R₁ sits exactly halfway between its smallest and largest possible values. Any real separation pushes r above 0.
Report both, along with the group sizes and an effect size. U lets a reader check against exact tables; Z and the p value show the test result; r or CLES shows how large the difference is. A significant Z with a small r usually means a large sample detecting a small shift.
The engine computes Z from U₁ as the formula defines it, while the headline shows the smaller U. With 23 in group 1 and a rank sum of 280, group 1 holds nearly all the low ranks, so U₁ is large and Z is +5.032 even though the smaller U is 4. Both point to a very strong separation.
No. Many different data sets share the same group sizes and rank sum, so U and R₁ summarise the ordering without preserving the values. That is also why the page needs only three inputs. Keep your raw data and the pooled ranking alongside the result, because a reader checking your work will need them rather than the summary.
The default describes two groups of 15 where the first group's ranks add to 280 in the pooled ordering. From those three numbers the page returns U = 65, a Z of -1.97, a rank-biserial r of 0.422 and a common language effect size of 71.111%.
You can follow the arithmetic. U₁ = n₁n₂ + n₁(n₁ + 1)/2 − R₁. With 15 in each group, n₁n₂ is 15 × 15 and n₁(n₁ + 1)/2 is 15 × 16 / 2, so U₁ = 15 × 15 + 15 × 8 − 280, which is 65. The other U is n₁n₂ minus that. The page reports the smaller of the two as the headline U, which is the convention printed tables use.
Under the null hypothesis that the two groups come from the same distribution, U has a mean of n₁n₂/2, which is 112.5 here, and a standard deviation of the square root of n₁n₂(n₁ + n₂ + 1)/12, which works out to 24.11. The Z is (65 − 112.5)/24.11, or -1.97.
The page does not need your raw data. It only needs the two group sizes and the sum of group 1's ranks in the pooled ranking, which you produce yourself before you open it.
Put every observation from both groups into one list and sort it. Give the smallest value rank 1, the next rank 2, and so on up to n₁ + n₂. Then add the ranks that belong to group 1. That total is R₁.
Ties get the average of the ranks they span. If three values tie for positions 7, 8 and 9, each gets rank 8. This is why R₁ can end in .5, and the page accepts decimals.
Two quick checks catch most mistakes. First, all the ranks together add to N(N + 1)/2, where N is the total sample size, so R₁ + R₂ must equal that. For the default, N is 30 and R₂ has to be the remainder after 280 is taken away. Second, R₁ cannot be smaller than n₁(n₁ + 1)/2, which happens when group 1 holds all the lowest ranks, and cannot be larger than n₁n₂ + n₁(n₁ + 1)/2, which happens when it holds all the highest.
The page checks both limits. A rank sum outside them returns an error naming the allowed range for your group sizes instead of a result, which almost always means R₁ was summed for the wrong group or the groups were ranked separately instead of pooled.
A spreadsheet does this job well. Paste both groups into one column with a second column for the group label, use a rank function that averages ties, and sum the ranks where the label is group 1. Doing it in a spreadsheet also leaves a record you can show a reviewer.
For a two-sided test at the 5% level the usual cut-off is a Z magnitude of 1.96. The default's -1.97 just clears it, which makes it a borderline result rather than a clear one.
The page does not apply a continuity correction. Many statistics packages do, by moving U half a unit toward the mean before dividing. On the default that gives (65 + 0.5 − 112.5)/24.11, about -1.95, which no longer clears 1.96. Two analysts using the same data can therefore reach different conclusions at the 5% level depending on a software setting.
Report the Z and the effect size together and avoid making much of which side of 0.05 the result falls. A rank-biserial r of 0.422 describes a moderate separation whether the p value is 0.049 or 0.051.
Raise R₁ by 20 to make group 1 rank even higher and U falls to 45, Z becomes -2.8 and r rises to 0.6. That is a clearer result, and the effect size shows it as well as the test does. The page's two worked examples bracket the default: a weak shift with R₁ = 250 gives U = 95, Z = -0.73 and r = 0.156, while a strong shift with R₁ = 320 gives U = 25, Z = -3.63 and r = 0.778.
The engine computes Z from U₁ as defined in the formula above, not from the smaller U shown in the headline. With that definition U₁ falls when group 1 has high ranks, so a negative Z here means group 1 tends to have the larger values. The default R₁ of 280 is well above what chance would give two equal groups of 15, which is why Z comes out negative.
The convention catches people out, because many textbooks define U₁ the other way round, as R₁ − n₁(n₁ + 1)/2, and get a positive Z for the same data. The magnitude is identical; only the sign flips.
Unequal groups make the mismatch visible. Enter 23 in group 1, 15 in group 2 and R₁ still at 280, and group 1 has almost all the lowest ranks. The headline U is 4 while the Z is +5.032. Both are correct, but they describe opposite tails of the same statistic. Decide the direction from the rank sums themselves: compare R₁/n₁ with R₂/n₂ and see which group's average rank is higher.
The rank-biserial correlation is 1 − 2U/(n₁n₂), using the smaller U. It runs from 0, when the groups are completely intermixed, to 1, when every member of one group outranks every member of the other.
On the default it is 0.422. With the 23 and 15 example it reaches 0.977, because only 4 of the possible pairs go against the dominant direction.
The page reports r as a magnitude. It does not carry a sign, so pair it with the direction you read from the rank sums. Rules of thumb for small, medium and large correlations exist, but they come from other fields, and in practice the size that matters depends on what you are measuring. A 0.42 separation in pain scores after a treatment may matter far more than the same value on a satisfaction survey.
The CLES line is the larger U divided by n₁n₂, shown as a percentage. On the default it is 71.111%. Read it as the chance that a randomly chosen member of the higher-ranked group beats a randomly chosen member of the other, with ties counted as half a win.
This is often the easiest number to explain to someone without statistics training. Saying a randomly picked person from the treated group scores higher than a randomly picked person from the control group about 71% of the time is clearer than quoting a Z or a correlation.
CLES and the rank-biserial r carry the same information. One is the other rescaled: r equals 2 × CLES − 1, with CLES as a fraction. A CLES of 50% means no separation and an r of 0. The 71.111% on the default matches the 0.422 correlation, and the 98.841% from the 23 and 15 run matches its 0.977.
The Z on this page treats U as normally distributed. That works well once each group has around a dozen or more observations, which covers the default of 15 per group comfortably.
With very small groups, say five or six in each, the distribution of U is lumpy and the normal curve can misstate the p value. For those, use an exact table of critical U values or software that computes exact probabilities. The U itself is still right; only the Z-based conclusion is approximate.
Heavy ties are the other weak spot. The standard deviation used here has no tie correction, so when many values share ranks, such as Likert items with five response options, the true spread of U is smaller and the Z is understated slightly. A package that applies the tie correction will give a somewhat larger Z magnitude.
Try groups of 10 and 12 where the smaller U comes to 35: the page returns Z = -1.65 and r = 0.417. That effect size is almost the same as the default's, yet the test is not significant at 5% because the samples are smaller.
If you are unsure whether the approximation is adequate, run the numbers both ways. When the exact p value and the Z-based one fall on the same side of your threshold, the choice does not matter for your conclusion.
The Mann-Whitney test asks whether one group tends to produce larger values than the other. It is often described as a test of medians, but that is only true if the two distributions have the same shape. Two groups with equal medians but different spreads can still produce a significant U.
Use it for ordinal data, skewed measurements or small samples where a t test's assumptions are doubtful. It assumes the observations are independent, both within and between groups. Paired or repeated measurements on the same people need the Wilcoxon signed-rank test instead, which is a different calculation despite the shared name.
When you write up the result, give n₁, n₂, U, Z and an effect size. For the default that is n₁ = 15, n₂ = 15, U = 65, Z = -1.97, r = 0.422, with a note on which group ranked higher.