Mann-Whitney U Test Calculator

StatisticsLast updated: August 22, 2026

The Mann-Whitney U test compares the measurements of two independent groups by converting them into rank numbers. It is the nonparametric counterpart of the independent samples t-test and is the right choice when normality does not hold, when the sample is small, when outliers distort the mean, or when the data were collected on a Likert-type ordinal scale.

This calculator ranks both groups together, computes the rank sums (R1, R2) and from them U1, U2, and the reported U = min(U1, U2). It also returns the z statistic built on the tie-corrected standard deviation (with and without the continuity correction), the two-tailed p-value, the r = |z|/√N effect size, the Hodges-Lehmann confidence interval for the difference in medians, and the group medians. The ranking table and the box plot let you see which observations produced the result.

You can separate the numbers with commas, spaces, or line breaks. A decimal comma is also accepted (3,14).
You can separate the numbers with commas, spaces, or line breaks. A decimal comma is also accepted (3,14).
The label shown in the tables and in the interpretation.
The label shown in the tables and in the interpretation.
The SPSS 'Asymp. Sig. (2-tailed)' row is based on the uncorrected z. With small samples the corrected version is recommended.
Sets the false-positive risk. In the social sciences 5% is the usual choice.

Mann-Whitney U Test Formulas

Rank sum:           R₁ = Σ (ranks falling to group 1)
U statistics:       U₁ = R₁ − n₁(n₁+1)/2 ,  U₂ = n₁·n₂ − U₁
Reported U:         U = min(U₁, U₂)
Expected value:     μ_U = n₁·n₂ / 2
Standard deviation: σ_U = √[ (n₁n₂/12) · ( (N+1) − Σ(t³ − t) / (N(N−1)) ) ]
z statistic:        z = (U₁ − μ_U) / σ_U
Continuity corr.:   z_c = (|U₁ − μ_U| − 0.5) / σ_U
Effect size:        r = |z| / √N ,  r_rb = 2·U₁/(n₁n₂) − 1
Location shift:     Δ̂ = median(xᵢ − yⱼ)  (Hodges-Lehmann)

The Σ(t³ − t) term is the variance correction for tied observations, where t is the number of observations in each tie group. The p-value is computed with the normal approximation and matches the SPSS 'Asymp. Sig. (2-tailed)' row; when min(n₁, n₂) < 8, an exact test should be preferred.

How to Calculate

  1. Paste the measurements of the two independent groups into separate boxes; the groups do not have to be the same size.
  2. Name the groups if you like; those names are used in the table, the charts, and the interpretation.
  3. Choose which p-value to report: use the version without the continuity correction to match SPSS output, and the corrected version with small samples.
  4. Set the significance level (α); the confidence interval is automatically computed at the 1 − α level.
  5. Read U and the p-value first, then the r effect size: significance shows only that the difference is unlikely to be chance, not how large it is.
  6. Compare the shapes of the two distributions in the box plot; if the shapes are similar, you can report the result directly as a difference in medians.

Worked Examples

Exam scores of a treatment and a control group

The rank sum of the treatment group is 152 and that of the control group is 58, which gives U₁ = 97, U₂ = 3, and a reported U = 3. With z = 3.553 and p < 0.001 the difference is statistically significant. The medians are 86.00 and 70.50; r = 0.794 marks a large effect, and the 95% confidence interval for the difference in medians runs from 10 to 21 points. The common language effect size is 97.0%: that is the probability that a student drawn from the treatment group scores higher than one drawn from the control group.

U test statistic: 3.0 · z statistic: 3.553 · Degrees of freedom: —

Two overlapping distributions — no significant difference

The medians of 13.50 and 14.50 are very close, and the rank sums are 64 and 72. With U₁ = 28, U₂ = 36, a reported U = 28, and z = −0.424, p = 0.672, so no difference is detected between the two classes. The effect size r = 0.106 is small, and the 95% confidence interval for the difference in medians runs from −3 to 2, which includes zero.

U test statistic: 28.0 · z statistic: -0.424 · Degrees of freedom: —

Likert-scale satisfaction — many tied values

Ordinal data produce a great many tied values, so the variance is computed with the correction Σ(t³ − t) = 1,152, giving σ_U = 16.58. With the continuity-corrected z = 3.136 and p = 0.002, satisfaction with the new interface is significantly higher. The medians are 4 and 3, U = 19.5, and r = 0.646 marks a large effect; the 95% confidence interval for the difference in medians runs from 1 to 2 points.

U test statistic: 19.5 · z statistic: 3.136 · Degrees of freedom: —

Frequently Asked Questions

When should I prefer the Mann-Whitney U test over the independent t-test?
The U test is the more reliable choice when the group distributions depart noticeably from normality, when the groups are small (n < 30), and when outliers distort the mean. If the data were collected on an ordinal scale (satisfaction, pain intensity, a Likert score), the arithmetic mean is not meaningful in the first place, so the U test is the natural option. When normality does hold, the t-test is more powerful; the U test then retains roughly 95% of that power.
Does the U test compare medians?
Strictly speaking, no: the null hypothesis is that "the two distributions are identical", and the test examines whether the probability that an observation from one group exceeds one from the other equals 0.5. To read the result as "the medians differ", the two distributions must have similar shapes (spread and skewness). If the shapes differ a lot, a significant result reflects a general difference in distribution rather than a difference in medians.
How do I get the same result in SPSS and R?
In SPSS, follow Analyze → Nonparametric Tests → Independent Samples; the 'Asymp. Sig. (2-tailed)' row of the output corresponds to the p-value without the continuity correction here. In R, wilcox.test(x, y, correct = FALSE) gives the same z and p, and correct = TRUE gives the continuity-corrected version. R reports W = U₁ rather than U by default; the two convert into each other through U₂ = n₁n₂ − U₁.
How do tied (equal) values affect the result?
Equal observations receive the average rank, and the variance of U is reduced by the Σ(t³ − t) term; without that correction the p-value comes out too large. This calculator applies the correction automatically and adds a note whenever ties are present. With Likert data full of ties an exact test is not available, so the normal approximation is standard practice.
Which effect size should I report?
The most common choice is r = |z|/√N (Rosenthal): 0.1 counts as a small effect, 0.3 as medium, and 0.5 as large. The rank-biserial correlation r_rb = 2U₁/(n₁n₂) − 1 also carries the direction of the difference and ranges from −1 to +1. The common language effect size (CLES) is the most readable of the three: it gives, as a percentage, the probability that an observation drawn from one group exceeds one drawn from the other.
What should I do if the sample is very small?
The normal approximation is unreliable when min(n₁, n₂) is below 8, and this calculator shows a warning in that case. The right move is to use the exact U distribution: the 'Exact' option in SPSS and exact = TRUE in R's wilcox.test provide it. When ties are present the exact test cannot be applied either; a permutation test is then the better route.
Can I use it to compare three or more groups?
No. Comparing three groups with pairwise U tests inflates the Type I error rate. In that case you run the Kruskal-Wallis H test first, and if it is significant you follow up with pairwise comparisons under a Bonferroni or Dunn correction. If the measurements are repeated on the same subjects, use the Friedman test instead.