Skip to main content
Calcimator

Mann-Whitney U Test Calculator

Calculate the Mann-Whitney U statistic and z-score for comparing two independent groups using rank sums.

About this calculator

This calculator computes the Mann-Whitney U statistic — a non-parametric alternative to the t-test — from the two group sizes and the rank sum you assign to Group 1 after ranking every observation from both groups together: U = n₁n₂ + n₁(n₁+1)/2 − R₁ (line 9). Group 1 Size has the largest measured effect on U at the calculator's default values, ahead of Group 2 Size and Rank Sum for Group 1, because n₁ appears twice in the formula — once in the n₁n₂ product and again, squared, inside n₁(n₁+1)/2 — while Group 2 Size and Rank Sum for Group 1 each appear only once.

U' Statistic is n₁n₂ − U (line 10), which algebraically simplifies to R₁ − n₁(n₁+1)/2 once U's own formula is substituted in — Group 2 Size cancels out of that expression completely, so it has zero effect on U' even though it clearly matters for U itself. The z-score applies a continuity correction (subtracting 0.5 before dividing by the standard deviation, line 19), and the calculator does not adjust for tied ranks, which real Mann-Whitney implementations typically correct for with a variance adjustment.

Inputs

Results

U Statistic

165

Z-Score

2.16

P-Value (two-tailed, approx)

0.03

U' Statistic60
U (min)60
Significant at α=0.05 (1=Yes)1
Effect Size (r)0.39
U Max165
How to Use This Calculator
  1. Enter Group 1 Size (n₁), Group 2 Size (n₂), and Rank Sum for Group 1 (R₁).
  2. Review U Statistic, Z-Score, and P-Value (two-tailed, approx).
  3. Use U and U (min) to inform your decision.
  4. Use the chart to visualize the results and explore different scenarios by adjusting inputs.

How the result changes with Group 1 Size (n₁)

Group 1 Size (n₁)U StatisticZ-ScoreP-Value (two-tailed, approx)
7.5-35.636.160
11511.610.11
2344180
381,13116.690

What each input means

Group 1 Size (n₁)
Number of observations in the first group.
Group 2 Size (n₂)
Number of observations in the second group.
Rank Sum for Group 1 (R₁)
Sum of ranks assigned to Group 1 after ranking all observations together.

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    Group 1 Size (n₁) = 15, Group 2 Size (n₂) = 15, Rank Sum for Group 1 (R₁) = 180 = 3 input(s) provided
  2. Calculate U Statistic
    U Statistic
    165 = 165
  3. Calculate Z-Score
    Z-Score
    2.1569 = 2.1569
  4. Calculate P-Value
    P-Value = Math
    0.031 = 0.031
  5. Calculate U' Statistic
    U' Statistic
    60 = 60
  6. Calculate U
    U
    60 = 60

Engine last updated . Checked against 2 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.

Frequently Asked Questions

Why does Group 1 Size move the U Statistic more than Group 2 Size does?

Group 1 Size (n₁) appears twice in the formula U = n₁n₂ + n₁(n₁+1)/2 − R₁ (line 9) — once multiplying n₂ and again inside the n₁(n₁+1)/2 term — while Group 2 Size only appears once, in the n₁n₂ product. That double appearance is why a proportional change to Group 1 Size produces a larger swing in U.

Does Group 2 Size affect the U' Statistic shown?

No. U' Statistic is n₁n₂ − U (line 10), and substituting U's own formula shows the n₁n₂ term cancels exactly, leaving U' = R₁ − n₁(n₁+1)/2 — an expression with no n₂ term at all. Group 2 Size still matters for the plain U Statistic, just not for its complement.

What does the continuity correction in the Z-Score formula do?

The engine subtracts 0.5 from the absolute difference between U and its expected value before dividing by the standard deviation (line 19), a standard adjustment for comparing a discrete statistic like U against the continuous normal distribution used to estimate the p-value.

Does this calculator adjust for tied ranks?

No. The standard deviation formula (line 16) assumes no ties among the ranked observations. Real datasets with tied values technically need a variance correction that this simplified version does not apply, which can make the reported Z-Score and P-Value slightly optimistic when your data has many ties.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Math & Statistics.