A/B tests · For studentsMann–Whitney U test calculator

An online Mann–Whitney U test solved step by step: a ranking table of both samples, ties with the mean rank, rank sums and U, an exact p for small samples without ties and the normal approximation with corrections. Effect size r, group medians, and Python and R code. For skewed data, outliers and ordinal scales.

Your numbers stay in the browser and are never sent anywhere

01Data02Result03Ranks04Step by step05Code06Problems07Questions08Related
01

Data

The test compares distributions, not means: it checks whether the values of one group tend to be higher. It suits skewed data, outliers and ordinal scales.

Numbers separated by spaces, semicolons, “, ” or new lines — you can paste a column from Excel. The samples may differ in length.

α = 0.05 · two-sided test
02

Result

The distributions differ
Values in B tend to be higher than in A: U = 24.5, p = 0.0160 (asymptotic). Effect size r = 0.76, large.
U statistic for B
24.5
for A: 0.5
p-value
0.0160
asymptotic, with corrections
Effect size r
0.76
large
Median of A
13
n = 5
Median of B
17
n = 5
Normal approximation, z
2.410
with continuity correction
03

Ranking table

Both samples together in ascending order. Equal values share the mean rank
ValueGroupRank
11A1
12A2
13A3
14A4
15A5.5
15B5.5
16B7
17B8
18B9
24B10

Ties (highlighted): 15 ×2 → rank 5.5.

04

Step by step

  1. 1
    Ranking
    Rank 10 values in ascending order; ties get the mean rank.
  2. 2
    Rank sums
    RA = 15.5RB = 39.5(check: they add up to 15.5 + 39.5 = 10·11/2 = 55)
  3. 3
    The U statistic
    UA = RA − nA(nA + 1)2 = 15.5 − 5 · 62 = 0.5UB = nAnB − UA = 5 · 5 − 0.5 = 24.5
  4. 4
    Normal approximation and p-value
    With ties or large samples — the normal approximation with a tie correction in σ and a continuity correction in z.μ = nAnB2 = 12.5σ = 4.773z = |UB − μ| − 0,5σ = 2.410p = 2 · (1 − Φ(|z|)) = 0.0160
  5. 5
    Conclusion
    p = 0.0160 < 0.05 — reject H₀: the distributions differ, values in B are higher. Effect size r = 0.76, large.
05

Check in Python / R

Check in Python / R
from scipy.stats import mannwhitneyu

mannwhitneyu([16, 18, 15, 17, 24], [12, 15, 11, 14, 13], alternative="two-sided", method="asymptotic")
06

Problems

07

Frequently asked questions

When the data are skewed, have outliers or sit on an ordinal scale: time on site, order value, ratings from 1 to 5. The test works on ranks, so one huge value does not outweigh the rest. In the time-on-site problem Mann–Whitney finds a difference, p = 0.0499, while Welch's t-test on the same numbers does not, p = 0.151: the outliers of 120 and 300 seconds break it.

Updated