Mann-Whitney U Test Calculator
Paste the raw values for two independent groups and get the Mann-Whitney U statistic, a z score with tie correction, an exact p-value for small samples without ties, the rank-biserial correlation, and a ready-to-edit APA 7 sentence.
| Statistic | Value |
|---|---|
| U | 10.50 |
| z | -0.31 |
| p-value | 0.753 |
| r | -.10 |
| Exact | No |
APA report
U = 10.50, z = -0.31, p = .753, r = -.10
Upload your dataset and generate a complete paper draft with statistics, figures, and references—free preview.
Generate paperHow to use this calculator
1. Paste the values for **Group 1** into the first box and **Group 2** into the second. Separate numbers with commas, spaces, or line breaks; you can copy a column straight from Excel, Google Sheets, or SPSS. 2. Each value must be one observation from one participant or unit. The two groups can have different sizes. 3. Choose a two-tailed test (the usual choice) unless you registered a directional hypothesis before seeing the data. 4. Read the output: rank sums for each group, **U**, the **z** score from the normal approximation (with a correction for tied ranks), the **p-value**, and the **rank-biserial correlation** as an effect size. 5. When both groups are small and there are no ties, the calculator also reports an **exact p-value** computed from the full distribution of U, which is more accurate than the normal approximation at small n.
What the Mann-Whitney U test is and when to use it
The Mann-Whitney U test (also called the Wilcoxon rank-sum test) compares two **independent** groups when you cannot or do not want to rely on the normal-distribution assumption of the independent-samples t test. Instead of comparing means, it ranks all observations together and asks whether values from one group tend to be larger than values from the other.
Typical situations:
- Ordinal outcomes, such as Likert-type ratings, pain scores, or satisfaction rankings.
- Small samples where normality cannot be checked convincingly.
- Strongly skewed data or data with outliers, such as reaction times, hospital length of stay, or income.
If your data are paired (the same participants measured twice), use the Wilcoxon signed-rank test instead. If you have three or more independent groups, the rank-based counterpart of one-way ANOVA is the Kruskal-Wallis test. For roughly normal continuous data, the [t-test calculator](/tools/t-test-calculator) is usually more powerful.
Assumptions
- **Independence**: observations within and between groups are independent; no participant appears in both groups.
- **Ordinal or continuous outcome**: values can be meaningfully ranked.
- **Interpretation depends on distribution shape**: the test always answers whether one group tends to produce larger values (stochastic dominance). It can be read as a test of a difference in medians only if both distributions have a similar shape and spread and differ only in location. If the shapes differ a lot, report it as a difference in distributions, not medians.
- **Ties**: tied values receive the average of their ranks. The z score uses a tie-corrected variance. Exact p-values assume no ties, so the calculator switches to the normal approximation when ties are present.
Formula
Rank all N = n1 + n2 values together from smallest to largest (ties get the average rank). Let R1 be the sum of ranks in Group 1.
- `U1 = R1 − n1(n1 + 1) / 2`
- `U2 = n1·n2 − U1`
- `U = min(U1, U2)` is the value most textbooks report.
Normal approximation:
- Mean of U: `μU = n1·n2 / 2`
- Standard deviation without ties: `σU = sqrt(n1·n2·(N + 1) / 12)`
- With ties: `σU = sqrt( (n1·n2 / 12) · [ (N + 1) − Σ(t³ − t) / (N(N − 1)) ] )`, where t is the number of values sharing each tied rank.
- `z = (U1 − μU) / σU`
Rank-biserial correlation (effect size): `r_rb = 1 − 2U / (n1·n2)`, which equals `(U1 − U2) / (n1·n2)` in absolute value. It ranges from −1 to 1 and is the difference between the proportion of pairs where Group 1 is higher and the proportion where Group 2 is higher.
Worked example
A researcher compares an engagement score in a small pilot study: eight students who used a new study app and eight who did not.
- App group: 12, 15, 9, 20, 17, 14, 22, 11 (median 14.5)
- Control group: 8, 10, 7, 13, 6, 16, 5, 4 (median 7.5)
Ranking all 16 values gives a rank sum of **R1 = 91** for the app group.
- `U1 = 91 − 8·9/2 = 55`
- `U2 = 64 − 55 = 9`, so **U = 9**
- `μU = 32`, `σU = sqrt(8·8·17/12) = 9.52`
- `z = (55 − 32) / 9.52 = 2.42`, two-tailed p = .016 (normal approximation)
- There are no ties and both groups are small, so the **exact two-tailed p = .015**.
- `r_rb = 1 − 2·9/64 = 0.72`
These values were checked with SciPy (`scipy.stats.mannwhitneyu`, exact and asymptotic methods).
How to interpret the result
The p-value tells you how surprising a separation this large would be if the two groups came from the same distribution. In the example, p = .015 is below the conventional .05 level, so the app group tended to have higher engagement scores.
The rank-biserial r tells you **how large** the separation is. An r of 0.72 means that, across all 64 possible app-versus-control pairs, the app student scored higher in 86% of pairs and lower in 14% (0.86 − 0.14 = 0.72). There are no universal cut-offs; compare the value with effect sizes reported in your field. With only eight per group, a confidence interval for the effect would be wide, so describe the finding as preliminary.
A non-significant result does not show that the groups are equal; with small samples the test has limited power.
Reporting in APA 7 style
Report the medians (or mean ranks), U, z or the exact p, and an effect size:
> A Mann-Whitney U test indicated that engagement scores were higher in the app group (Mdn = 14.5, n = 8) than in the control group (Mdn = 7.5, n = 8), U = 9.00, z = 2.42, p = .015 (exact), r = .72.
State whether p is exact or based on the normal approximation, and name the effect size (here the rank-biserial correlation). Some authors instead report `r = z / sqrt(N)`; that is a different index, so say which one you used.
If you are writing up a full study from a CSV or Excel data file, Data2Paper's [Generate Paper](/generate-paper) tool can draft the methods, results with statistics, figures, and discussion for you; you can preview the first half for free before deciding to unlock it, and you should still check every number against your own analysis.
Common mistakes
- **Using it for paired data.** Before/after measurements on the same people need the Wilcoxon signed-rank test.
- **Calling it a test of medians without checking shapes.** If one group is much more spread out, a significant U can occur even when medians are equal.
- **Reporting only p.** Always add an effect size and descriptive statistics (medians and IQRs, or mean ranks).
- **Confusing U1 and U2.** Software may print either one. They carry the same information; the smaller one is conventional in reports, and the direction should be stated in words.
- **Using exact p with many ties.** Exact tables assume no ties; with ties, use the tie-corrected normal approximation.
- **Switching to Mann-Whitney after the t test was not significant.** Choose the test before analysis based on the data type and design.