Two independent samples are pooled, equal values receive average ranks, and each group gets a U statistic before an exact or tie-corrected approximate p-value is reported.
Pooled ranks retain the sample direction: Group A’s U counts its wins over Group B, with ties split evenly.
On this page

When the Mann–Whitney U test may fit

The Mann–Whitney U test compares two independent samples using the pooled ranks of their observations. It may fit an ordered outcome or numeric measurements when each observation belongs to one group, the groups are independent and the question concerns a difference in distributions. It does not require normally distributed measurements, but it still needs a defensible sampling design and an appropriate measurement scale.

The null hypothesis is that the two underlying distributions are the same. People often describe the method as a test of medians; that location interpretation needs additional conditions, especially reasonably similar distribution shapes and spreads. If the groups differ in shape or variability, a rank difference need not be a median shift. The calculator reports medians and quartiles descriptively so you can inspect the data rather than assuming that interpretation.

Supporting reading: [1] [2]

Enter the two independent samples

Enter one group per field. Separate numeric values with spaces, commas, semicolons or line breaks. Each group needs at least two observations; the tool accepts up to 5,000 observations total. The built-in values come from SciPy’s published documentation example and are included so you can check the calculation, not as data from a study conducted by AI Essay.

Keep each person or unit in only one group. Do not enter before-and-after measurements from the same participants, matched pairs, cluster summaries or repeated observations as though they were independent. The calculator cannot infer how the data were collected. Keep category labels and study records separately, and do not paste names or confidential measurements.

Choose the alternative before inspecting the result

Select a two-sided alternative unless a directional hypothesis was specified in advance. “Group A lower” asks whether values in A tend to be stochastically lower than values in B; “Group A higher” asks the reverse. These alternatives depend on the order of the input groups, so switching the fields switches the directional question. Do not choose a one-sided alternative after seeing which group has the larger rank statistic.

Supporting reading: [2]

How pooled midranks and both U statistics are calculated

The calculator combines both samples, sorts all N observations and assigns ranks from 1 to N. Equal values receive their average rank. If Rₐ is Group A’s rank sum and nₐ is its sample size, Uₐ = Rₐ − nₐ(nₐ + 1)/2. The other statistic is Uᵦ = nₐnᵦ − Uₐ. Under this ascending-rank convention, Uₐ counts A-over-B pairs, with each tied pair contributing one half; Group A’s common-language estimate is Uₐ/(nₐnᵦ).

The signed rank-biserial estimate is 2Uₐ/(nₐnᵦ) − 1, so positive values indicate that Group A tends to have larger observations and negative values indicate the reverse. This describes pairwise ordering in the entered samples; it does not establish a causal effect or automatically generalize beyond the sampling design. The displayed medians and interpolated interquartile ranges are summaries of the values, not inputs to the rank test.

Supporting reading: [1] [2]

Which p-value method does the calculator use?

When no more than 50,000 assignments of the pooled ranks to Group A are possible, the calculator enumerates those assignments and reports an exact conditional permutation p-value. It applies the selected alternative to Group A’s U; for the two-sided option it counts assignments at least as far from the null mean as the observed U. This bounded calculation handles ties by permuting the observed midranks.

For larger assignment counts, it uses the normal approximation with a pooled tie correction and, by default, a continuity correction. The variance is nₐnᵦ/12 × [N + 1 − Σ(t³ − t)/(N(N − 1))], where t is the size of each tied set. A warning appears for small tied samples when the approximation may be unreliable. A calculator warning does not choose a replacement method; use software or statistical guidance suited to the design if exact or resampling inference is needed.

Supporting reading: [2]

Interpret rank differences without calling every result a median test

A small p-value is evidence against the null model of identical distributions, given the sampling design and test method. It does not show that the difference is important, identify why it arose or prove that the medians differ. Compare the distributions and their spread, inspect unusual values, and report the effect estimate and sampling context alongside the p-value.

The test assumes independent samples. It is not the paired Wilcoxon signed-rank test, a test of two means or a method for three or more groups. Do not treat a non-significant result as proof that groups are equivalent. If you need a formal equivalence claim, define a justified margin and use a method designed for that question.

Supporting reading: [1] [2]

Free independent-samples rank calculator

Compare two independent samples

Enter each group separately. The calculator uses pooled average ranks for tied values and chooses a bounded exact permutation or a tie-corrected normal approximation.

Published worked example

Group A: 19, 22, 16, 29, 24
Group B: 20, 11, 17, 12

SciPy’s documentation reports Uₐ = 17 and exact two-sided p = 0.111111 for these values.

Separate numbers with spaces, commas, semicolons or line breaks. Each group needs at least two observations.

Observations stay in this browser tab. Avoid entering names or confidential measurements, especially on a shared device.

The published example has five Group A values and four Group B values. Calculate to see U for both groups and the exact conditional permutation result.

Questions about this topic

Is the Mann–Whitney U test the same as the Wilcoxon rank-sum test?

They are closely related names for the rank test comparing two independent samples. The reported raw statistic can use different conventions; this calculator shows U for both groups, with Group A’s U based on ascending pooled midranks.

Does the Mann–Whitney test compare medians?

Not in every case. Its general null concerns equal distributions. Interpreting a detected difference as a location or median difference needs additional assumptions, especially similar distribution shapes and spreads.

Can I use this test for before-and-after measurements?

No. Those observations are paired, not independent. Use a method for matched data, such as a paired t-test when its question and conditions fit, or seek guidance for an appropriate paired rank test.

How does the calculator handle tied values?

Equal values across both samples receive their average pooled rank. The p-value uses an exact conditional permutation when at most 50,000 rank assignments are possible; otherwise it uses a tie-corrected normal approximation and flags small tied samples.

What does Group A’s U statistic mean?

With ascending pooled ranks, U for Group A counts pairs where an A value exceeds a B value, with tied pairs counted as one half. U for Group B is nA × nB minus U for Group A. Directional p-values follow Group A’s order.

Are my observations uploaded?

No. The calculation runs in this browser tab. The calculator does not send entered observations to AI Essay.

Sources and editorial notes

The supporting reading below informs our editorial guidance. Exercises and scenarios illustrate a method; they do not report a completed product test or measured learning outcome. Read our editorial policy or send a correction with a supporting source to info@ai-essay.com.

  1. NIST/SEMATECH e-Handbook: pooled ranks, average ranks for ties and the U statistic
  2. SciPy documentation: independent-sample null, alternatives, exact and asymptotic methods, ties and interpretation