Change language

Statistics

Mann-Whitney, Wilcoxon and Kruskal-Wallis calculator

Non-parametric tests for ordinal or non-normal data: exact p values when possible, effect sizes and Dunn’s post hoc, all in your browser.

Published by SolucionesAhora.com How we verify

Calculator inputs

  1. Enter your figures, or press “See example” to watch it work.
  2. If your case is unusual, open “Advanced options”.
  3. Read the result and, below it, what it means and how it was worked out.

Mann-Whitney compares two independent groups (alternative to Student’s t). Wilcoxon compares two measurements on the same people (alternative to the paired t). Kruskal-Wallis compares three or more groups (alternative to ANOVA).

Enter one group per line, with values separated by spaces or commas and a decimal point. You can put a name before a colon. Mann-Whitney uses two lines; Wilcoxon, two lines with the same number of values (first measurement and second, in the same order of people); Kruskal-Wallis, three or more. Ordinal data such as 1-to-5 scales work.

One group per line

Advanced options

The threshold used to decide whether the result is significant. 0.05 is the habit.

See the result

Results

Statistic (U, W or H)1
p valuep = 0.002
z (normal approximation)2.786
Effect size (rank r or ε²)-0.952
In favour of the first group (0.5 = no difference)0.024
U1, W+ (first group)1
U2, W− (second group)41
Observations13
Descriptives by group
GroupnMedianMean rank
Grupo A613.853.67
Grupo B7189.86
See the working step by step
  1. Observations = 13; groups = 2
  2. Statistic = 1; p = 0.002
  3. Effect size = -0.952
  4. z (normal approximation) = 2.786

In short

What it calculates
Non-parametric tests for ordinal or non-normal data: exact p values when possible, effect sizes and Dunn’s post hoc, all in your browser.
Formula used
Mann-Whitney (two independent groups):
Example
Example 1. Two large groups.

Non-parametric tests calculator

When your data are ordinal (a 1-to-5 scale, say), contain extreme values or are not normally distributed in small samples, t tests and ANOVA lose reliability. Non-parametric tests work on ranks and do not require normality.

Choose the test, paste the data and get the statistic, the p value, the effect size and, for Kruskal-Wallis, pairwise comparisons with Holm’s correction. Everything runs in your browser; no data is sent anywhere.

How it works

All these tests replace the values with their ranks: the smallest value gets rank 1, the next 2, and so on up to the largest. Where values tie, each tied value gets the average rank. The test then measures whether ranks are shared out evenly between groups.

With small samples and no ties the p value is exact: it is computed from every possible arrangement of the ranks. With large groups or ties, a normal approximation (or chi-square for Kruskal-Wallis) is used with the usual corrections.

Formula

Mann-Whitney (two independent groups):
U1 = R1 − n1(n1 + 1) ÷ 2; U2 = n1·n2 − U1; statistic = the smaller of U1 and U2
z = (|U1 − n1·n2 ÷ 2| − 0.5) ÷ √(n1·n2 ÷ 12 × ((N + 1) − Σ(t³ − t) ÷ (N(N − 1))))
effect size = 2·U1 ÷ (n1·n2) − 1 (rank-biserial r)

Wilcoxon (pairs):
zero differences are dropped; W+ and W− = sums of the ranks of |diff| by sign
z = (|W+ − n(n + 1) ÷ 4| − 0.5) ÷ √(n(n + 1)(2n + 1) ÷ 24 − Σ(t³ − t) ÷ 48)

Kruskal-Wallis (k groups):
H = [12 ÷ (N(N + 1)) × Σ R_j² ÷ n_j − 3(N + 1)] ÷ [1 − Σ(t³ − t) ÷ (N³ − N)]; df = k − 1
ε² = H × (N + 1) ÷ (N² − 1)
Dunn: z = (R̄_i − R̄_j) ÷ √((N(N + 1) ÷ 12 − Σ(t³ − t) ÷ (12(N − 1))) × (1÷n_i + 1÷n_j)), p adjusted by Holm

Worked example

Example 1. Two large groups.
25 people in one group and 30 in the other: too many for an exact p value, so a normal approximation with continuity correction is used. U = 246 (out of 750), p = .030, rank-biserial r = −.34 (a medium effect).

Example 2. Five groups.
Four people per group. Kruskal-Wallis gives H(4) = 18.29, p = .001, ε² = .96 (a large effect). Dunn’s post hoc with Holm finds 3 of the 10 pairwise comparisons significant.

Explanation

When to use a non-parametric test

  • The data are ordinal: 1-to-5 agreement scales, grades, rankings.
  • The sample is small and you cannot check normality, or the distribution is clearly skewed.
  • There are extreme values you do not want to dominate the result.

With large samples (over 30 per group) and reasonable data, t tests and ANOVA often work fine even without exact normality.

Which test to choose

  • Mann-Whitney: two groups of different people (a control group and an experimental group).
  • Wilcoxon signed-rank: two measurements on the same people (before and after).
  • Kruskal-Wallis: three or more independent groups. If it is significant, Dunn’s post hoc with Holm shows which pairs differ.

What the test really compares

They are often said to compare medians, but that is only true if the groups have the same distribution shape. In general they test whether values in one group tend to be larger than in the other: that is why the probability of superiority and the rank r are given too.

How to report the result

“Mann-Whitney: U = 246, p = .030, r = −.34.” Add each group’s median. With ties or large samples, say the p value is approximate.

Common mistakes

  • Using Mann-Whitney with paired data: for repeated measurements use Wilcoxon.
  • Reporting only the p value, without effect size or medians.
  • Reading a significant Kruskal-Wallis as meaning every group differs.
  • Forgetting that with many ties an exact p value does not exist.

Limits of this calculator

  • The exact p value is computed for groups of up to 20 observations in Mann-Whitney and up to 25 pairs in Wilcoxon, provided there are no ties. With more data or ties, the normal approximation uses the continuity and tie corrections, as R does.
  • In Wilcoxon, zero differences are dropped before counting valid pairs.
  • It does not calculate confidence intervals for the median difference (Hodges-Lehmann) or one-tailed tests.
  • Dunn’s post hoc uses the same rank variance for every comparison and Holm’s correction.
  • The thresholds for small, medium and large r and ε² are conventions, not rules.

Notice

This is an estimate. For publication, confirm the analysis with a statistics package and report whether the exact or approximate method was used.

Frequently asked questions

When do I use Mann-Whitney instead of Student’s t?

When data are ordinal, there are extreme values, or the sample is small and non-normal. It compares ranks, not means.

What is the difference between Mann-Whitney and Wilcoxon?

Mann-Whitney compares two groups of different people; Wilcoxon compares two measurements on the same people.

What is Kruskal-Wallis?

The non-parametric alternative to one-way ANOVA: it compares three or more independent groups using ranks.

What does an exact p value mean?

It is computed by enumerating every possible arrangement of the ranks, with no approximation. It is only possible with small samples and no ties.

What is the rank-biserial r?

An effect size from −1 to 1: it shows to what extent values in one group exceed those in the other. Usual thresholds are 0.1, 0.3 and 0.5.

Can I compare medians with these tests?

Only if the two groups have the same distribution shape. In general they test whether one group tends to have larger values.

What if Kruskal-Wallis is significant?

Look at Dunn’s post hoc with Holm’s correction: it shows which pairs of groups differ.

Is my data sent to a server?

No. Everything is calculated in your browser.

Sources and references

The formula behind this calculator is not ours. These are the sources it comes from, in APA 7 format, in case you want to go to the original or cite them in your own work.

  1. Mann, H. B., & Whitney, D. R. (1947). On a test of whether one of two random variables is stochastically larger than the other. The Annals of Mathematical Statistics, 18(1), 50–60. https://doi.org/10.1214/aoms/1177730491 https://doi.org/10.1214/aoms/1177730491 The original paper of the U test.
  2. Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics Bulletin, 1(6), 80–83. https://doi.org/10.2307/3001968 https://doi.org/10.2307/3001968 The origin of the signed-rank test for paired data.
  3. Kruskal, W. H., & Wallis, W. A. (1952). Use of ranks in one-criterion variance analysis. Journal of the American Statistical Association, 47(260), 583–621. https://doi.org/10.1080/01621459.1952.10483441 https://doi.org/10.1080/01621459.1952.10483441 The H test for comparing three or more groups using ranks.
  4. Tomczak, M., & Tomczak, E. (2014). The need to report effect size estimates revisited. An overview of some recommended measures of effect size. Trends in Sport Sciences, 1(21), 19–25. The epsilon-squared thresholds used to classify the effect in Kruskal-Wallis.

Need to calculate something else?

These tools are often used alongside this calculator.

t-test

Compare two means (independent or paired) or one mean with a value, with p value, confidence interval and…

ANOVA & post hoc

Compare the means of three or more groups: ANOVA, equal-variance check, Tukey or Games-Howell, effect size…

Spearman correlation

Rank correlation between two variables, which detects monotonic relationships even if they are not straight…

Cohen’s d

Effect size between two groups or before and after, with confidence intervals, plain-language equivalents…

Sample size

How many responses you need to estimate a percentage or a mean, with finite population, design effect and…

Pearson correlation

Pearson’s r between two variables, with p value, confidence interval, regression line and scatter plot.