MannWhitney U Test Calculator
This MannWhitney U test calculator is here to help whenever you have to perform the WilcoxonMannWhitney test. It displays not only the final decision but also the results of intermediate computations so that you can learn how to calculate the MannWhitney U test by hand.
If you are not yet familiar with the WilcoxonMannWhitney test, we've prepared a short article explaining what the MannWhitney U test is, what is the correct interpretation of the MannWhitney U test, and when to use the MannWhitney U test vs. ttest.
💡 The MannWhitney U test is sometimes called the WilcoxonMannWhitney test because this test was first proposed by Wilcoxon and then further developed by Mann and Whitney. This calculator uses the test statistic U. See Omni's Wilcoxon ranksum test calculator for a version of this test using the sum of ranks as the test statistic.
What is the MannWhitney U test?
The MannWhitney U test is a statistical procedure that we use when we have two independent samples and we want to decide if they come from the same distribution (thus also if the medians of the two populations are equal) or rather from shifted distributions.
In the picture below, you can see an example of shifted distributions: the blue probability density function is shifted to the left with respect to the green one. As a consequence, the median of the blue distribution is smaller than the median of the green one.
OK, now that we know what the MannWhitney U test is, let's move on and discuss when this test can help us.
MannWhitney U test vs. ttest
Recall that the ttest is a statistical procedure that helps you decide if the population means for two independent samples are equal. However, the ttest has its assumptions; in particular, it requires that at least one of the following conditions holds:
 Each sample is normally distributed.
 The samples are relatively large. Optimally, they would have more than 30 or 50 points each, depending on the source. This allows us to resort to the central limit theorem.
However, life is tough sometimes, and from time to time, we encounter datasets that do not want to obey the assumptions of the ttest. For instance, data may be skewed (like in the lognormal distribution), or there may be too few data points. And that's exactly when we use the MannWhitney U test.
Let us now discuss the interpretation of the MannWhitney U test.
Or maybe you want to learn about some other statistical tests? Omni's collection include:
MannWhitney U test interpretation
As we've already mentioned, the null hypothesis of the MannWhitney U test says that the two populations (we'll refer to them as A and B) have the same distribution. Clearly, in such a case, the two populations have equal medians. Rejecting the null hypothesis means we have evidence that the population distributions are shifted with respect to each other, and so are their medians. As in the ttest, there are three possible alternatives:

The distribution of A is shifted to the right with respect to the distribution of B. That is, the median of population A is greater than the median of population B. We'll denote this alternative by A > B.

The distribution of A is shifted to the left with respect to the distribution of B. That is, the median of population A is smaller than the median of population B. We'll denote this alternative by A < B.

The distribution of A is shifted to the right or to the left with respect to the distribution of B. That is, the median of population A is different from the median of population B. We'll denote this alternative by A ≠ B.
The pictures below show the hypothesis A > B (upper figure) and the hypothesis A < B (bottom figure):
Most of the time, we perform the twosided test, i.e., with the alternative A ≠ B. Use a onesided test if you have some prior theory suggesting that the shift between the populations occurred in a specific direction.
How do I use this MannWhitney U test calculator?
 Enter your data in the fields of the calculator. Additional fields will appear as you go. Up to 50 fields per sample are available.
 Pick the significance level and the alternative hypothesis of your test. If not sure, leave the default values.
 The results of the MannWhitney U test will appear at the bottom of the calculator.
 If at least one of the samples has more than
20
elements, the calculator uses the normal approximation by default. Otherwise, it performs the exact MannWhitney U test, but you can use the normal distribution by adjusting theUse normal approximation
option.  If the calculator uses the normal approximation of the test statistic distribution, then you can choose between the pvalue approach and the critical region approach.
 In the
Advanced mode
of the calculator, you can decide whether to use the corrections for ties and continuity. Visit our Wilcoxon ranksum calculator to learn more about them.
MannWhitney U is quite popular on tests and exams, so that it may happen you'll need to learn to perform this test by hand. That's why we'll now show you the MannWhitney U test formula and explain stepbystep how to calculate the MannWhitney U test!
How to calculate the MannWhitney U test?
To perform the MannWhitney U test, follow these steps:
 Compute the test statistics: compare each observation from Sample A with each observation from Sample B. Count how many times an observation from Sample A is the bigger one: each instance is worth 1 point. Each tie is worth 0.5. Otherwise, it's zero points. Then add the points  this is the test statistic U.
 If your samples are small, you have to compare U with the critical value, which you can find in statistical tables or in statistical packages.
 If your samples are relatively large, you can use the normal approximation of the test statistic distribution. In such a case, you can make the decision based on the pvalue.
Let's discuss these instructions in more detail. In what follows, we denote by n₁
and n₂
the number of observations in Sample A and Sample B, respectively, and by n
the total number of observations, i.e., we have n = n₁ + n₂
.
How to compute the test statistic
The test statistic in the MannWhitney U test is given by the following formula:
U₁ = ∑ᵢ∑ⱼ S(Aᵢ, Bⱼ)
,
where Aᵢ
and Bⱼ
are our observations (so i = 1, ..., n₁
and j = 1, ..., n₂
) and:
S(Aᵢ, Bⱼ) = 1
, ifAᵢ > Bⱼ
;S(Aᵢ, Bⱼ) = ½
, ifAᵢ = Bⱼ
; andS(Aᵢ, Bⱼ) = 0
, ifAᵢ < Bⱼ
.
Clearly, U₁
has a discrete distribution and:
 Its minimal possible value is
0
 when every observation from Sample B is bigger than every observation from Sample A.  Its maximal possible value is
n₁n₂
 when every observation from Sample A is bigger than every observation from Sample B.
Alternatively, we can compute U₁
via the following formula:
U₁ = R₁  n₁(n₁ + 1)/2
,
where R₁
is the sum of ranks in Sample A. This formula says that two test statistics, U₁
and R₁
, which appear in the context of the MannWhitneyWilcoxon test, can be easily computed from one another.
💡 Visit Omni's Wilcoxon ranksum calculator to learn more about ranks. 
Critical values for the MannWhitney U test
As is always the case in hypothesis testing, the critical value (and also the direction of comparison) depends on the alternative hypothesis:

If A > B, then the observations from Sample A tend to be greater than those from Sample B. Hence, we have evidence in favor of this alternative if
U₁
is unusually large, and so the critical region is rightsided, i.e.,[c, ∞)
, wherec
is the critical value. Considering the maximal possible value ofU₁
, we actually obtain[c, n₁n₂]
. 
If A < B, then the observations from Sample B tend to be greater than those from Sample A. Hence, we have evidence in favor of this alternative if
U₁
is unusually small, and so the critical region is leftsided, i.e.,(∞, c]
, wherec
is the critical value. Considering the minimal possible values ofU₁
, we obtain[0, c]
. 
If A ≠ B, then
U₁
is extreme, i.e., unusually small or unusually large. Hence, the critical region is twosided, i.e.,(∞, c₁] ∪ [c₂, ∞)
, wherec₁
andc₂
are the critical values. Taking into account the minimal and maximal possible values ofU₁
, we obtain[0, c₁] ∪ [c₂, n₁n₂]
.
We can determine the actual values of the critical values c, c₁, c₂
from the distribution of U₁
, and they depend on n₁
, n₂
, and on the significance level. To find them, you have to use either a statistical package or the tables of the distribution of U statistics. Or Omni's MannWhitney U test calculator 😉!
Using the normal approximation
As we've seen above, it's important to know the distribution of the test statistic to find the critical values. Sometimes, however, it's much easier to use some approximations. In particular, the U statistic can be well approximated by the normal distribution if your samples have sufficiently many observations. Some sources say that even 5 observations per sample is fine, but, obviously, the more the better. The parameters of the normal distribution are the following:

mean:
μ = n₁n₂ / 2
; and 
standard deviation:
σ = √(n₁n₂(n₁ + n₂ + 1) / 12)
.
Hence, the normalized test statistic:
z = (U₁  μ) / σ
follows the standard normal distribution N(0,1)
. Knowing the zscore, we can easily determine the pvalue of our test and draw some conclusions.
Hurray! You now know how to calculate the MannWhitney U test 🎉!
FAQ
When to use the MannWhitney U test?
Use the MannWhitney U test to verify if two populations have equal medians whenever your samples are not normally distributed, or they have relatively few elements. Remember that, in such a case, you cannot use the ttest!
What is the difference between the MannWhitney U and Wilcoxon ranksum tests?
The MannWhitney U and Wilcoxon ranksum tests are, in fact, one and the same test. That's why people sometimes call it the MannWhitneyWilcoxon test. Although you can encounter two different test statistics (sum of ranks and Ustatistic), it turns out they are closely related. No matter which test statistic you use, the test's conclusions are going to be the same.
What are the assumptions of the WilcoxonMannWhitney test?
The MannWhitney U test has the following assumptions:
 There is one independent variable that is a dichotomous variable, that is, it has two categories. For instance, sex (male/female) or trial (intervention/control). These categories are mutually exclusive.
 The dependent variable should be measured on a continuous or ordinal scale. For instance, Likert items fulfill this assumption.
 The last assumption of the WilcoxonMannWhitney test is that the observations have to be independent.
 Importantly, your sample does not have to follow the normal distribution. This is the main advantage of the MannWhitney U test vs. ttest.