The Kruskal-Wallis H test compares three or more independent groups when the data are ordinal or not normally distributed. It is the non-parametric alternative to one-way ANOVA. This calculator gives mean ranks and medians, the tie-corrected H statistic, epsilon squared, and Dunn’s pairwise post hoc tests with Bonferroni correction, plus an APA paragraph that names the groups that differ.
How to use this calculator
- Put each group in its own column (sizes can differ).
- Paste the columns, ideally with group names in the first row.
- Click Calculate.
- If H is significant, read the Dunn table to see which pairs of groups differ.
Formula
Rank all N values together (average ranks for ties) H = [12 / (N(N + 1))] Σ (Rⱼ² / nⱼ) − 3(N + 1), divided by 1 − Σ(t³ − t)/(N³ − N) df = k − 1; ε² = H / (N − 1) Dunn: z = (R̄ᵢ − R̄ⱼ) / √[(N(N + 1)/12 − Σ(t³ − t)/(12(N − 1)))(1/nᵢ + 1/nⱼ)]
Step-by-step example
- Satisfaction ratings in three groups: Low (n = 6), Medium (n = 7), High (n = 7).
- Mean ranks: 4.75, 9.36 and 16.57.
- H(2) = 14.10, p < .001, ε² = .74.
- Dunn (Bonferroni): Low vs High p < .001; Medium vs High p = .057; Low vs Medium p = .449.
How to interpret the results
A significant H (p < .05) means at least one group tends to have higher values than another. Dunn's post hoc table shows which pairs differ after Bonferroni correction. Report medians and mean ranks rather than means. Epsilon squared (ε²) is an effect size from 0 to 1; larger values mean group membership explains more of the ranking.
How to report it in APA 7 style
A Kruskal-Wallis H test showed a statistically significant difference in satisfaction between the three groups, H(2) = 14.10, p < .001, ε² = .74. Dunn's post hoc tests with Bonferroni correction indicated that the High group differed significantly from the Low group (p < .001).
Statistical symbols (t, F, p, r, M, SD, N, d) should be italicised in your thesis.
Assumptions
- The dependent variable is ordinal or continuous.
- Groups are independent.
- To compare medians, group distributions should have a similar shape.
- For repeated measures of the same people, use the Friedman test instead.
How to do it in SPSS, R or Excel
SPSS: Analyze → Nonparametric Tests → Independent Samples → Kruskal-Wallis (pairwise comparisons are Dunn’s tests). R: kruskal.test(y ~ group) and FSA::dunnTest(..., method = 'bonferroni'). Python: scipy.stats.kruskal and scikit_posthocs.posthoc_dunn, which ScholarCalc was validated against.
Roman Urdu mein khulasa
Kruskal-Wallis test teen ya zyada groups ko compare karta hai jab data normal na ho ya ordinal ho. Ye one-way ANOVA ka non-parametric mutabadil hai. p 0.05 se kam ho to kam az kam do groups mukhtalif hain, aur kaun se, ye Dunn post hoc table batata hai (Significant = Yes). Thesis mein medians aur mean ranks report karein.
Frequently asked questions
When should I use Kruskal-Wallis instead of ANOVA?
Use it when the outcome is ordinal, the data are clearly non-normal with small groups, or there are extreme outliers.
Which post hoc test follows Kruskal-Wallis?
Dunn’s test is the most common choice. The calculator applies a Bonferroni correction to control the family-wise error rate, which matches SPSS’s adjusted significance.
Is H corrected for ties?
Yes. H is divided by the standard tie correction factor, as in SPSS, R and scipy.
What effect size should I report?
Epsilon squared, ε² = H / (N − 1), is commonly reported for Kruskal-Wallis.
Can I use Kruskal-Wallis with two groups?
Yes, but with two groups it is equivalent to the Mann-Whitney U test, which is more commonly reported.
How do I report Kruskal-Wallis in APA?
Report H(df) = value, p = value and the effect size, followed by the post hoc results, for example: H(2) = 14.10, p < .001, ε² = .74.
Related calculators
- One-Way ANOVA Calculator with Tukey HSD
- Mann-Whitney U Test Calculator
- Descriptive Statistics Calculator
- Not sure which test to use? Try the test chooser
Cite this calculator
If ScholarCalc helped your analysis, you can cite it in APA 7 format:
ScholarCalc. (2026). Kruskal-Wallis Test Calculator with Dunn Post Hoc [Web application]. https://scholarcalc.com/kruskal-wallis-test-calculator/
Written and maintained by the ScholarCalc team. Last reviewed: November 2026.
Accuracy: results are computed in your browser and were validated against Python scipy, statsmodels and pingouin on test datasets. See Methodology and accuracy.