Mann–Whitney U test calculator

Paste values for two independent groups to compute Mann–Whitney U, exact or tie-corrected asymptotic p-values, rank-biserial correlation r and an APA 7th results sentence.

No accountExact DP for small NAPA sentence & R/Python

Enter observations for two independent groups

Ideal for skewed continuous outcomes, small samples or ordinal scales.

TWO INDEPENDENT SAMPLES

LIVE RESULT

INSTANT

Mann–Whitney U test

Observations must be independent within and across groups. When combined N ≤ 40 with no ties, an exact permutation p-value is computed; otherwise the tie-corrected normal approximation is used.

READY-TO-USE APA 7TH RESULTS SENTENCE

Adjust inputs above to generate a draft reporting sentence.

VISUAL DIAGNOSTIC

Group medians, interquartile ranges (Q1–Q3) and spread

Reproduce in R (wilcox.test) and Python (SciPy)

What the Mann–Whitney U test compares

The Mann–Whitney U test (also known as the Wilcoxon rank-sum test) checks whether values in one independent group tend to be systematically larger than values in another, without assuming normal distributions. All observations from both groups are pooled and ranked from 1 to N (averaging ranks for ties), and U counts how many pairwise comparisons favor each group.

U₁ = R₁ − n₁(n₁ + 1) ÷ 2, U₂ = n₁n₂ − U₁, U = min(U₁, U₂)
Rank-biserial correlation r = (U₁ − U₂) ÷ (n₁n₂)
σU = √[ (n₁n₂ / 12) × (N + 1 − Σ(t³ − t) ÷ (N(N − 1))) ]

Worked example

Comparing Group 1 (Mdn = 24, IQR = 9.00) against Group 2 (Mdn = 16, IQR = 6.50) with n₁ = 7 and n₂ = 7 gives U = 7 (U₁ = 42, U₂ = 7), exact two-tailed p = .026, rank-biserial correlation r = 0.71, and Hodges–Lehmann median difference = 8.00.

Interpreting rank-biserial correlation (r)

Common reference points for |r| (rank-biserial) and how Mann–Whitney compares to Welch’s t-test.
MetricWhat it measuresCommon reading
Rank-biserial |r|Proportion of favorable minus unfavorable pairs across groups~0.10 small · ~0.30 medium · ~0.50 large
Hodges–Lehmann shiftMedian of all n₁ × n₂ pairwise differences (Group 1 − Group 2)Shift estimate in original units (not always equal to Mdn₁ − Mdn₂)
Exact vs. asymptotic pExact permutation DP (no ties, N ≤ 40) vs. normal z approximationExact avoids normal-tail error in small samples

Common pitfalls

Common questions

Frequently asked questions

What is the difference between Mann–Whitney U and Wilcoxon rank-sum W?

They are equivalent formulations of the same test: U shifts the rank sum R₁ by subtracting the minimum possible sum n₁(n₁+1)/2. Both yield identical p-values.

Why does the Hodges–Lehmann difference sometimes differ from Median₁ − Median₂?

Hodges–Lehmann takes the median of all n₁ × n₂ cross-group differences rather than subtracting the two group medians separately, so it aligns directly with the rank-sum test statistic.

When does this calculator switch from exact p to asymptotic p?

Whenever there are no ties and combined N ≤ 40, the calculator computes the exact permutation p-value via dynamic programming. When ties exist or N > 40, it reports the tie-corrected normal z approximation.