Statistics and research
Mann–Whitney U test calculator
Wilcoxon rank-sum (Mann–Whitney U) test for two independent samples, exact for small samples without ties, with the rank-biserial effect size.
Runs in your browser. What you enter stays on this page and is not uploaded.
Separate values with spaces, commas, tabs or new lines (paste a spreadsheet column). Use a point for decimals.
Results
U (sample 1)35p-value0.2544Rank-biserial r0.4
- U₁ = R₁ − n₁(n₁ + 1)/2 (R’s W)
- 35
- U₂ = n₁n₂ − U₁
- 15
- Smaller U
- 15
- Method
- Exact distribution (no ties, both samples under 50)
- Hypothesis
- two-sided
- p-value
- 0.2544
- Probability of superiority U₁ / (n₁n₂)
- 0.7
- Conclusion
- The distributions are not shown to differ (not significant at the 5% level).
| Sample | n | Rank sum | Mean rank |
|---|---|---|---|
| Sample 1 | 10 | 90 | 9 |
| Sample 2 | 5 | 30 | 6 |
A positive rank-biserial correlation means sample 1 tends to have the larger values.
Method and limits
How to use it
Paste the two independent samples. The test compares their distributions using ranks, so it suits small samples, ordinal scores and skewed data.
Formulas
- Rank all n₁ + n₂ values together (ties get average ranks). U₁ = R₁ − n₁(n₁ + 1)/2, where R₁ is the rank sum of sample 1 (R reports this as W); U₂ = n₁n₂ − U₁.
- Exact p-value from the permutation distribution of U when both samples have fewer than 50 values and there are no ties (as R).
- Otherwise z = (U₁ − n₁n₂/2 ∓ 0.5) / σ with σ² = n₁n₂/12 × ((N + 1) − Σ(t³ − t)/(N(N − 1))), correcting for tied groups of size t.
- Rank-biserial r = 2U₁/(n₁n₂) − 1; probability of superiority U₁/(n₁n₂) = P(X₁ > X₂) + ½P(X₁ = X₂).
Assumptions and limits
- Independent observations within and between samples.
- It tests whether one distribution tends to give larger values. It is a test of medians only if the two distributions have the same shape.
- For paired data use the Wilcoxon signed-rank test.
Worked example
R’s wilcox.test example: samples of 10 and 5 values. W = U₁ = 35; the exact two-sided p = 0.2544 (one-sided p = 0.1272, as in R’s documentation); rank-biserial r = 0.40.
References
- R documentation: wilcox.test
- SciPy documentation: scipy.stats.mannwhitneyu
- Mann and Whitney (1947), On a test of whether one of two random variables is stochastically larger than the other, Annals of Mathematical Statistics 18(1)
- Kerby (2014), The simple difference formula: an approach to teaching nonparametric correlation, Comprehensive Psychology 3
Related tools
- T-test calculatorOne-sample, independent two-sample (Welch and pooled) and paired t-tests from raw data or summary statistics, with confidence intervals and Cohen’s d.
- Wilcoxon signed-rank test calculatorWilcoxon signed-rank test for paired samples or one sample against a median, exact for small samples, with the matched-pairs rank-biserial correlation.
- Effect size calculatorCohen’s d, Hedges’ g and Glass’s Δ from group means, or odds ratio, risk ratio and risk difference from a 2×2 table, each with confidence intervals.
- Power and sample size calculatorStatistical power or the sample size needed for one-sample, paired and two-sample t-tests and for comparing two proportions.
- P-value calculatorFind the p-value and critical values for a z, t, chi-square or F test statistic, one- or two-tailed, accurate far into the tails.
- Standard deviation calculatorPaste data to get the standard deviation (sample and population), variance, mean, median, mode, quartiles with the method stated, IQR, outliers, skewness and kurtosis.