FreeStatisticalTools.com

Kruskal-Wallis Test: Nonparametric ANOVA With Dunn’s Post Hoc Test

Comparing three or more groups on ordinal or skewed data? How the Kruskal-Wallis H test works, how to follow it up with Dunn’s test and how to report it.

Bibin Xavier3 min readNonparametric tests

The Kruskal-Wallis H test compares three or more independent groups when the outcome is ordinal or when the assumptions of a one-way ANOVA are badly violated. It is the nonparametric counterpart of the one-way ANOVA and the extension of the Mann-Whitney U test to more than two groups.

Free tool · runs in your browserKruskal-Wallis H Test CalculatorFree Kruskal-Wallis H test calculator with mean ranks, tie correction, epsilon squared and Bonferroni-adjusted Dunn post-hoc tests.Run a Kruskal-Wallis test →
In this guide
  1. When to use it
  2. How it works
  3. Assumptions
  4. Worked example
  5. Post hoc test: Dunn's test
  6. Effect size
  7. How to report it in APA 7
  8. Kruskal-Wallis or ANOVA?
  9. Frequently asked questions

When to use it

  • Three or more independent groups, with different people in each.
  • An ordinal outcome (a single Likert item, a pain rating, a ranking), or a continuous outcome that is strongly skewed or has outliers in small groups.
  • For repeated measurements on the same people, use the Friedman test instead.

How it works

All observations are ranked together, from lowest to highest, ignoring group membership. The test then asks whether the average rank differs between groups more than chance would allow. The statistic H follows approximately a chi-square distribution with k − 1 degrees of freedom, where k is the number of groups.

Does it compare medians?

Only if the groups have distributions of the same shape and spread. In general the Kruskal-Wallis test detects whether values in one group tend to be higher than in another (stochastic dominance). Report medians and IQRs as descriptives, but describe the result as a difference in distributions or ranks unless the shapes are similar.

Assumptions

  • Independent observations, each person in one group only.
  • An outcome that is at least ordinal.
  • For interpreting the result as a median difference, similarly shaped distributions in each group.

Worked example

A hospital compares patient satisfaction (a 1–10 rating) across three wards, with 20 patients each (N = 60). The ratings are skewed, with many 9s and 10s, so ANOVA is not ideal.

WardnMedianIQRMean rank
A2087–937.7
B2075–821.6
C2086–932.2

The test gives H(2) = 8.78, p = .012. At least one ward differs from the others.

Post hoc test: Dunn's test

A significant H only says that the groups are not all the same. To find which pairs differ, use Dunn's test with a correction for multiple comparisons (Bonferroni or Holm). In this example, Dunn's test with Holm correction shows that ward A rated higher than ward B (padj = .011), while the other pairs did not differ significantly. The free calculator runs Dunn's test automatically.

Effect size

Two common effect sizes for Kruskal-Wallis are:

  • Epsilon squared: ε² = H / (n − 1) = 8.78 / 59 = .15
  • Eta squared based on H: η²H = (H − k + 1) / (n − k) = (8.78 − 3 + 1) / 57 = .12

Both are interpreted roughly like η² in ANOVA (.01 small, .06 medium, .14 large). For each significant pair, you can also report the rank-biserial correlation or r = z / √n from the pairwise comparison.

How to report it in APA 7

How to report it (APA 7)

A Kruskal-Wallis test showed that satisfaction differed significantly across the three wards, H(2) = 8.78, p = .012, ε² = .15. Dunn’s post hoc tests with Holm correction indicated that patients on ward A (Mdn = 8) reported higher satisfaction than patients on ward B (Mdn = 7), p = .011. No other pairwise differences were significant.

Kruskal-Wallis or ANOVA?

With roughly normal data and similar variances, ANOVA has more power. With moderate non-normality and 15–20 or more per group, ANOVA is still fairly robust. Kruskal-Wallis is the better choice for ordinal outcomes, strong skew or outliers in small samples. If variances are unequal but the data are roughly normal, Welch's ANOVA is often a better alternative than Kruskal-Wallis.

Frequently asked questions

What is the Kruskal-Wallis test used for?

It compares three or more independent groups on an ordinal or non-normal continuous outcome, as a nonparametric alternative to one-way ANOVA.

What post hoc test should I use after Kruskal-Wallis?

Dunn’s test with a Bonferroni or Holm correction. Running multiple Mann-Whitney tests without correction inflates the Type I error rate.

How do I report Kruskal-Wallis in APA?

Report H with its degrees of freedom, the exact p-value, an effect size such as ε², medians for each group and the significant post hoc comparisons.

What sample size do I need?

There is no strict minimum, but each group should have at least 5 observations for the chi-square approximation to work. For good power, aim for 15–20 or more per group.

Cite the tool (APA 7)
Xavier, B. (2026). Kruskal-Wallis H Test Calculator [Web application]. FreeStatisticalTools.com. https://freestatisticaltools.com/kruskal-wallis-test-calculator/

Free tools used in this guide

Cite this article

If this guide helped your thesis, paper or class, please cite it. If you ran the analysis with one of our tools, cite the tool as well (each tool page has its own citation).

Xavier, B. (2026, October 15). Kruskal-Wallis Test: Nonparametric ANOVA With Dunn’s Post Hoc Test. FreeStatisticalTools.com Blog. https://freestatisticaltools.com/blog/kruskal-wallis-test/
Free eBooks · Newsletter

Get 3 free step-by-step eBooks

PLS-SEM, CB-SEM and bibliometric analysis, plus APA results templates, a thesis methods checklist and questionnaire templates. Then about two emails a month with tutorials, new tools, workshops and conferences.

  • Sent to your inbox instantly
  • Free, no spam
  • Unsubscribe anytime
See everything you get →
CB-SEM and CFA Step by Step (free eBook)PLS-SEM Step by Step (free eBook)Bibliometric Analysis Step by Step (free eBook)

Free statistics tutorials, tools, workshops and conferences

Free. About two emails a month. Unsubscribe anytime.

About Bibin Xavier

Bibin Xavier is a researcher, assistant professor, developer, digital marketer, trainer, entrepreneurship and incubation coordinator

Connect on LinkedIn →

Ask a question or leave a comment

Your email address will not be published. Required fields are marked *