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.
Calculator inputs
Results
Enter your values and press “Calculate” to see the result.
| Group | n | Median | Mean rank |
|---|---|---|---|
| Grupo A | 6 | 13.85 | 3.67 |
| Grupo B | 7 | 18 | 9.86 |
See the working step by step
- Observations = 13; groups = 2
- Statistic = 1; p = 0.002
- Effect size = -0.952
- 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.
- 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.
- 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.
- 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.
- 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.