Kruskal-Wallis Test Calculator

Compare 2–10 groups of raw data with the Kruskal-Wallis test (tie-corrected H, chi-square p-value, epsilon-squared) and Bonferroni-adjusted Dunn post hoc pairs.

Hypotheses

H = (12/(N(N+1))) · Σ (R_i²/n_i) − 3(N+1)

H* = H / T with tie correction T on pooled ranks

ε² = (H − df)/(N − 1)

Worked example (Load example)

Groups [8,10,12], [5,7,9], [14,16,18]: H ≈ 6.489, df = 2, p ≈ 0.039, ε² ≈ 0.561. Dunn: B vs C is significant after Bonferroni at α = 0.05.

When to use ANOVA

Parametric alternative: one-way ANOVA calculator. For two groups only, Mann-Whitney U is equivalent to Kruskal-Wallis with k = 2.

Related guides and calculators

The Kruskal-Wallis test is the rank-based counterpart of one-way ANOVA; for two groups use the Mann-Whitney U test. The Levene test checks whether the groups have equal spread, and the Bonferroni correction adjusts p-values when you compare pairs of groups afterwards. Read parametric vs nonparametric tests, multiple comparisons explained and which statistical test to use.

Frequently Asked Questions

What is the Kruskal-Wallis test?

It is a nonparametric one-way layout test: H0 is that all groups share the same distribution; the statistic compares mean ranks across groups.

How is H computed with ties?

H = (12/(N(N+1))) Σ (R_i²/n_i) − 3(N+1), divided by tie correction T from pooled average ranks, then compared to χ² with k−1 df.

What is Dunn post hoc?

Pairwise z tests on mean rank differences with variance (N(N+1)/12)·T·(1/n_i + 1/n_j); p-values are Bonferroni-adjusted for k(k−1)/2 comparisons.

When use ANOVA instead?

One-way ANOVA targets means under normality and homoscedasticity; Kruskal-Wallis is safer when those assumptions fail.

How many groups can I enter?

Between 2 and 10 groups, each with at least one value, up to 10,000 observations total.

Software equivalents?

R: kruskal.test(x ~ g). Python: scipy.stats.kruskal(*groups).

What does epsilon-squared ε² mean?

ε² = (H − df)/(N − 1) is a rank-based effect size for how much mean ranks differ across groups; larger values mean stronger separation.

Bonferroni vs Holm on Dunn pairs?

Bonferroni multiplies each raw two-sided p by the number of pairs; Holm step-down is less conservative while still controlling family-wise error at α.

Embed This Calculator

Add this free calculator to your course page or LMS.

Adjust the height value to fit your page.