Skip to content
ToolMug

Use ↑ ↓ to move, Enter to open, Esc to close.

Mann–Whitney U Test Calculator

When two samples are small and skewed, or the data are ratings or ranks, use the Mann–Whitney U test instead of an independent t-test. Paste one column per group to get U, the p-value, medians and mean ranks. For three or more groups, switch to Kruskal–Wallis.

Runs in your browser — nothing you enter is uploaded

Two columns, one per group (they can have different lengths). A header row is optional.

U = 23

p = 0.1359

No significant difference (p ≥ 0.05).

Descriptive statistics

GroupnMedianMean rank
A91.6811.44
B91.077.56

Test statistics

StatisticValue
U23
W (rank sum form, as in R)58
z1.545
p0.1359
p-valueExact
Rank-biserial correlation0.432
r = |z| / √N0.364
Report asU = 23.0, z = 1.55, p = .136, r = .36

Same results as R’s wilcox.test(), kruskal.test() and friedman.test(): exact p-values when both samples are under 50 with no ties, otherwise the normal approximation. These tests compare ranks, not means.

Is this tool working for you?

How to use

  1. Choose Mann–Whitney U and paste one column per group. A header row is optional.
  2. For a one-sided test, pick "first column is larger" or "smaller" under the alternative hypothesis.
  3. Read the p-value, and compare the medians and mean ranks to see which group is higher.
  4. For three or more groups, choose Kruskal–Wallis and paste one column per group.

Options explained

U and W
U counts how often a value in one group beats a value in the other (ties count half). SPSS reports the smaller U; R's W is U for the first group. Both are shown and give the same p-value.
Exact vs approximate p
With both groups under 50 and no tied values, the p-value comes from the exact distribution. Otherwise it uses the normal approximation with tie and continuity corrections, R's wilcox.test() default.
Effect size
r = |z| / √N, with 0.1, 0.3 and 0.5 as rough small, medium and large. The rank-biserial correlation runs from −1 to 1 and is positive when the first group tends to be larger.

Worked example

The sample has two groups of nine values:

Group n Median Mean rank
A 9 1.68 11.44
B 9 1.07 7.56

U = 23 (R’s W = 58), z = 1.55. Both groups are under 50 with no ties, so the exact distribution is used: two-sided p = 0.136, not significant, r = 0.36. If you had predicted beforehand that A would be larger, the one-sided p is 0.068, still not significant.

APA style: U = 23.0, z = 1.55, p = .136, r = .36.

Which test to use

Situation Test
Two independent groups, roughly normal data Independent t-test
Two independent groups, small and skewed, or ratings (such as 1–5 satisfaction) Mann–Whitney U
The same people measured twice Paired t-test or Wilcoxon signed-rank
Three or more groups, roughly normal One-way ANOVA
Three or more groups, skewed or ordinal Kruskal–Wallis H

The test ranks all values together and compares the ranks of the two groups, so outliers can’t dominate it. The cost is slightly less power than the t-test when the data really are normal.

Frequently asked questions

Are Mann–Whitney U and Wilcoxon rank-sum the same test?

Yes. The statistic is written differently but the p-value is identical. Don't confuse it with the Wilcoxon signed-rank test, which is for paired data.

Does it compare medians?

Strictly, it tests whether values in one group tend to be larger than in the other. If the two distributions have a similar shape, you can read it as a difference in medians.

Why does SPSS give a different p-value?

By default SPSS shows the asymptotic p (normal approximation without continuity correction). For small samples tick "Exact" in SPSS and the results match.

How do I follow up a significant Kruskal–Wallis test?

Run Mann–Whitney tests on each pair and adjust the p-values, for example with Bonferroni. With three pairs, multiply each p by 3.

Privacy

This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.

Related tools