Mann-Whitney U Test Calculator

Compare two independent groups without assuming normality: rank sums, U, z and p-value, with average ranks and tie correction.

Use a point for decimals (1.5), no thousands separators, and separate numbers with spaces or a comma and a space.
The two groups can have different sizes; up to 5000 values each.
Choose this before looking at the data.
The correction makes the normal approximation slightly more conservative. Some software (e.g. R’s wilcox.test) uses it by default.

Results

p-value (two-sided, normal approximation)
0.8365
What this means
Rank sums this far apart could easily happen by chance if both groups came from the same distribution (p is 0.05 or above). That does not show the groups are the same; the samples may be too small to detect a difference.
U (the smaller of U_A and U_B)
39.50
U_A = R_A − n_A(n_A + 1)/2
39.50
U_B = n_A·n_B − U_A
44.50
z (from U_A)
-0.2064
Rank sum of group A (R_A)
60.50
Rank sum of group B (R_B)
149.50
Mean rank of A, B
10.0833, 10.6786
Median of A, B
0.028, 0.02
Mean of U under the null (n_A·n_B/2)
42.00
Standard deviation of U (tie-corrected)
12.1152
Sample sizes n_A, n_B
6, 14
Ties
2 groups of tied values share average ranks; the variance is reduced to allow for them.
Reliability
At least one group has fewer than 10 values, so the normal approximation is rough. For a formal test with very small samples, use an exact table or exact software.

How it’s calculated

The Mann-Whitney U test (also called the Wilcoxon rank-sum test) compares two independent groups using ranks instead of the raw values, so it does not assume the data are normally distributed. All values are ranked together (1 = smallest); tied values share the average of the ranks they span. If the groups come from the same distribution, each group’s ranks should be mixed evenly; a large imbalance in the rank sums gives a small p-value.

R_A = sum of the ranks of group A U_A = R_A − n_A(n_A + 1)/2 U_B = n_A·n_B − U_A mean of U = n_A·n_B / 2 variance = n_A·n_B/12 × [ (N + 1) − Σ(t³ − t) / (N(N − 1)) ] N = n_A + n_B, t = size of each tie group z = (U_A − mean) / √variance (optionally |U_A − mean| − 0.5 for the continuity correction)

The p-value comes from the standard normal distribution. Without the continuity correction, z² equals the Kruskal–Wallis H statistic for two groups, so both tests give the same p-value.

Example (Handbook of Biological Statistics, LibreTexts): FST values for 6 DNA polymorphisms (group A) and 14 proteins (group B) in the American oyster. The two values of −0.005 tie for ranks 2 and 3, so each gets 2.5. Group A’s rank sum is 60.5 against an expected 63, so U_A = 60.5 − 21 = 39.5 and U_B = 84 − 39.5 = 44.5. The tie-corrected standard deviation is 12.115, z = (39.5 − 42) ÷ 12.115 = −0.206 and the two-sided p ≈ 0.84, matching the book’s Kruskal–Wallis result (H = 0.0426, P = 0.8365). These are the default values.

A small p-value says the rank pattern would be unusual if the groups were the same; it does not measure how big the difference is. The test is often described as comparing medians, but that is only true when both groups have the same shape of distribution.

Frequently asked questions

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

When the two groups are independent and the data are ranks, or strongly skewed with small samples. For roughly normal data the two-sample t-test is usually more powerful.

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

Yes. They use different statistics (U and the rank sum W) that differ by a constant, and give the same p-value.

Should I use the continuity correction?

It makes little difference except with small samples, where it gives a slightly larger p-value. Pick one approach in advance and report which you used. With very small groups an exact test is better than either.

Does a significant result mean the medians differ?

Only if both groups have distributions of the same shape. In general it shows that values in one group tend to be larger than in the other.

Embed this calculator

Add this free calculator to your own website. Copy the code below into your page’s HTML:

Need this calculator branded, changed or built around your own prices?See custom business solutions →

Sources

Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.

Added · Last updated · How we check our calculators

Spotted a mistake or missing option? Report a problem· Suggest a calculator