01
How to use the calculator
- Paste each group’s values into its own box. Groups can have different sizes.
- Press “Add a group” for more than three groups.
- Read H and the p value, then compare the mean ranks to see which groups sit higher or lower.
02
When to use the Kruskal-Wallis test
- Three or more independent groups (two groups give the same answer as the Mann-Whitney U test).
- The outcome is ordinal, or a measurement that is skewed or has outliers, particularly with small groups.
- For data that are close to normal with similar spread in each group, one-way ANOVA has more power.
- Repeated measurements on the same subjects need the Friedman test instead.
03
The H statistic
Rank all N values together (tied values share the average rank). With Rᵢ the sum of ranks in group i and nᵢ its size:
H = 12 ÷ (N(N + 1)) × Σ (Rᵢ² ÷ nᵢ) − 3(N + 1)
with ties: divide H by 1 − Σ(t³ − t) ÷ (N³ − N)
Under the null hypothesis H follows approximately a chi-square distribution with (number of groups − 1) degrees of freedom, which gives the p value. The approximation is rough when groups have fewer than five values; the calculator says so when that applies.
04
Worked example
The calculator opens with three groups of four values.
| Group | Values | Median | Rank sum | Mean rank |
|---|---|---|---|---|
| 1 | 1.1, 2.2, 3.3, 4.4 | 2.75 | 13 | 3.25 |
| 2 | 2.5, 3.6, 4.7, 5.8 | 4.15 | 23 | 5.75 |
| 3 | 6.1, 7.2, 8.3, 9.4 | 7.75 | 42 | 10.5 |
H = 12 ÷ (12 × 13) × (13²/4 + 23²/4 + 42²/4) − 3 × 13 = 8.35, df = 2, p = .015
Reported as: H(2) = 8.35, p = .015, ε² = .76.
05
Effect size and follow-up tests
ε² = H ÷ (N − 1)
Epsilon squared runs from 0 to 1: the share of the variation in ranks that group membership accounts for.
A significant H says the groups are not all alike, not which ones differ. With three or more groups the calculator adds Dunn’s test for every pair, which reuses the ranks from the overall test, and multiplies each p value by the number of pairs (Bonferroni).
06
Common mistakes with the Kruskal-Wallis test
- Reading a significant H as “all groups differ”. In the worked example H is significant, but Dunn’s test finds only group 1 against group 3 (adjusted p = 0.013); group 1 against 2 gives 0.98 and group 2 against 3 gives 0.19.
- Running a separate test for every pair without correction. With three pairs each at the 5% level, the chance of at least one false positive is 14.3% if the three tests were independent.
- Ignoring ties. For the groups 1, 1, 2, 2 / 2, 2, 3, 3 / 3, 3, 3, 4, H without the tie correction is 7.04 (p = 0.030); with it, 7.89 (p = 0.019).
Trust
How this page is checked
- The calculation runs on code with automated tests against worked reference values. Every number in the examples on this page was produced by that same code, not typed by hand.
- The formulas and conventions used are stated on the page, so you can reproduce the result yourself or compare it with your own software.
- Sources: Kruskal and Wallis (1952), Use of ranks in one-criterion variance analysis; Dunn (1964), Multiple comparisons using rank sums.
- Last reviewed by the Sciloom team, Zebra Nine Studio Inc. It is a tool for research and teaching, not a substitute for a statistician, a validated lab method or medical advice.
Cite this page
Sciloom. (2026). Kruskal-Wallis test calculator. Zebra Nine Studio Inc. https://sciloom.si/kruskal-wallis-test-calculator
Frequently asked questions
What is the Kruskal-Wallis test used for?
To test whether three or more independent groups come from the same distribution when the data are ordinal or not normal. It is the non-parametric counterpart of one-way ANOVA.
What does the H statistic mean?
H measures how far the groups’ average ranks are from what would be expected if all groups were alike. Larger H means larger differences between groups.
Does the Kruskal-Wallis test compare medians?
Only when the groups’ distributions have the same shape. In general it tests whether values in some group tend to be larger than in others.
What do I do after a significant result?
Read the pairwise table under the result: it runs Dunn’s test for each pair of groups with a Bonferroni correction, and marks the pairs that differ.