Mann-Whitney U Test Explained: The Non-Parametric Alternative to the t-Test
The independent-samples t-test is the default tool for comparing two groups โ but it quietly assumes your data are roughly normally distributed in each group. Real medical data often break that assumption: hospital stay lengths pile up at 2โ3 days with a long tail of outliers, pain is recorded on a 0โ10 scale, and satisfaction questionnaires give you Likert responses like "agree" and "strongly agree". For data like these, the Mann-Whitney U test (also called the Wilcoxon rank-sum test) is the standard alternative. This guide explains the idea behind it, works a tiny example by hand, and shows you exactly when to choose it.
When Should You Use Mann-Whitney Instead of a t-Test?
Reach for the Mann-Whitney U test when you are comparing two independent groups and any of the following is true:
- Your outcome is ordinal. Likert-scale responses (strongly disagree โ strongly agree), pain scores (0โ10), satisfaction ratings, and grades are ordered categories, not true measurements. A "4" in pain is worse than a "2", but not exactly twice as bad โ so means and t-tests rest on shaky ground, while ranks are perfectly honest.
- Your data are clearly skewed. Length of hospital stay, blood loss, number of symptoms, waiting times โ these typically have a long right tail, and the mean (which the t-test compares) is dragged around by a few extreme values.
- Your sample is small and you cannot verify normality. With 8 patients per group, a normality test tells you almost nothing; the rank-based test needs no such leap of faith.
If your data are numeric, roughly symmetric, and free of wild outliers, the t-test is fine and slightly more powerful โ our t-test guide covers it. If you are deciding between the two, our overview of which statistical test to use walks through the full decision.
The Core Idea: Compare Ranks, Not Raw Values
Mann-Whitney ignores the actual numbers and works only with their order. Pool both groups together, rank every value from smallest (rank 1) to largest, then add up the ranks in each group. If one group genuinely tends to score higher, its members collect the big ranks and its rank sum balloons. If the groups are really the same, the ranks shuffle evenly between them. Because only order matters, one extreme outlier counts for just one rank โ it cannot hijack the result the way it hijacks a mean. Ties (identical values) simply share the average of the ranks they would have occupied.
A Worked Example You Can Do by Hand
Suppose a small pilot compares a symptom score in two independent groups of 3 patients each:
- Group A: 3, 5, 7
- Group B: 9, 11, 13
Pool and rank all six values: 3 โ rank 1, 5 โ rank 2, 7 โ rank 3, 9 โ rank 4, 11 โ rank 5, 13 โ rank 6. Group A collects ranks 1, 2, 3 (rank sum = 6); Group B collects 4, 5, 6 (rank sum = 15). The separation is perfect โ every A score is below every B score.
The U statistic converts a rank sum into a count of "wins": for each pair of patients (one from A, one from B), does the B patient score higher? Here B wins all 3 ร 3 = 9 pairings, so the smaller U value is U = 0 โ the most extreme result possible. The exact two-sided p-value is p = 0.10.
The Lesson Hidden in That p-Value
Look at what just happened: the most extreme result the data could possibly show โ total separation between the groups โ still gives p = 0.10, which is not significant at the usual 0.05 threshold. This is not a flaw in the test. With only 3 patients per group there are just 20 ways to split six ranks into two groups of three, and even the single most extreme split happens by chance 1 time in 20 one-sided โ 2 in 20 (0.10) two-sided. The mathematics simply cannot certify so little evidence.
The practical lesson matters far beyond this toy example: tiny samples rarely reach significance, even when the effect is real and large. A pilot study with a handful of patients per group that reports "no significant difference" has usually proven nothing at all โ it was never capable of finding the difference. This is why sample size planning comes before data collection, not after; our guide on how to calculate sample size shows the planning side. (For scale: with 4 patients per group, perfect separation can just reach significance, at p โ 0.029.) If p-values themselves feel fuzzy, revisit our plain-language explainer on what a p-value actually means.
Assumptions โ Stated Honestly
"Non-parametric" does not mean "assumption-free". Mann-Whitney still assumes:
- Independent groups. Each observation comes from a different person (or independent unit); nobody appears in both groups, and one patient's value does not influence another's. If the same patients are measured twice, you need a paired test instead โ see the next section.
- Ordinal or numeric data. Values must at least be rankable. Pure categories with no order (blood group, ward name) cannot be ranked and need a different test entirely, such as the chi-square test.
- Similar distribution shapes, if you want a "median difference" reading. Strictly, the test asks whether a randomly chosen patient from one group tends to score higher than a randomly chosen patient from the other. Only when the two distributions have roughly the same shape and spread can you safely phrase the result as a difference in medians.
What the Result Actually Means (and What It Does Not)
Mann-Whitney compares distributions via ranks โ loosely, it estimates the probability that a random patient from Group B scores higher than a random patient from Group A. It does not compare means, and it is sloppy to write "the mean score was significantly higher" after running it. The honest companions to report are the medians (with interquartile ranges) of each group. A good results sentence looks like: "Post-operative pain scores were lower in Group A (median 5, IQR 3โ7) than in Group B (median 11, IQR 9โ13); Mann-Whitney U = 0, p = 0.10 โ a difference that did not reach statistical significance in this small sample." Reporting the medians, the U statistic and the exact p โ and admitting the sample-size limitation โ is exactly what examiners and reviewers want to see.
Mann-Whitney vs Wilcoxon Signed-Rank: The Confusion to Avoid
These two are confused constantly, partly because "Wilcoxon" is attached to both names. The distinction is one question: are the two sets of measurements paired?
- Mann-Whitney U (= Wilcoxon rank-sum): two independent groups โ different patients in each. Example: pain scores of patients given Drug A vs patients given Drug B.
- Wilcoxon signed-rank: paired data โ the same patients measured twice, and the test works on the within-patient differences. Example: the same patients' pain scores before and after treatment.
Using Mann-Whitney on paired data throws away the pairing and can easily hide a real effect; using signed-rank on independent groups is simply invalid. Check the design first, then pick the test.
A Note on Larger Samples and Software
Hand-ranking is only practical for teaching examples like the one above. In a real dataset with dozens or hundreds of patients, software pools and ranks everything instantly, handles ties with the standard correction, and computes the p-value โ exactly, for small samples, or with a well-tested normal approximation once the groups are larger. What software cannot do is choose the test for you: it will happily run Mann-Whitney on paired data, or on categories that cannot be ranked, and return a confident-looking p-value that means nothing. The judgment calls in this guide โ independent or paired, ordinal or numeric, skewed or symmetric โ are yours to make before you tap the button. That judgment, not the arithmetic, is what examiners are testing.
Frequently Asked Questions
Is Mann-Whitney just "the t-test for small samples"?
No โ sample size is not the deciding factor. The deciding factors are the type of data (ordinal vs truly numeric) and its shape (skewed vs roughly normal). A large study of Likert responses should still use Mann-Whitney; a small study of normally distributed measurements can still use a t-test.
Should I report means or medians with Mann-Whitney?
Medians with interquartile ranges. The test is built on ranks, so medians describe your data in the same spirit. Reporting means alongside a rank-based test invites exactly the misreading this guide warns about.
What do I do with tied values?
Nothing special by hand โ tied values each receive the average of the ranks they share (two values tied at ranks 2 and 3 both get 2.5), and good software applies a tie correction to the p-value automatically. Heavy tying is normal with Likert and pain scales, and it is one more reason to let software do the arithmetic.
Run It Free on Your Phone
You do not need SPSS or a laptop for any of this. Run the Mann-Whitney U test free in FormStat โ load your two groups and get U, the p-value, and a plain-English interpretation instantly, alongside the t-test so you can compare approaches on your own data.
Run this analysis in seconds with the FormStat app. No signup, no laptop, works offline.