Kruskal-Wallis Test Calculator

Compare three or more groups without assuming normality, with a rank summary.

What the Kruskal-Wallis test does

The Kruskal-Wallis test is the non-parametric version of one-way ANOVA. It compares three or more independent groups using ranks, so it does not need normal data and is less affected by outliers. A significant result means that at least one group tends to have higher or lower values than another.

Worked example

Three teaching methods with 6 students each have scores of 23, 25, 21, 28, 24, 26; 30, 33, 29, 35, 31, 32; and 27, 24, 29, 26, 28, 25. After ranking all 18 scores together, the mean ranks differ greatly, and the result is H(2) = 12.12, p = .002, ε² = 0.71. At least one method differs. To find which, follow up with pairwise tests (Dunn’s test or Mann-Whitney tests with a correction), or, if the data are close to normal, Tukey’s HSD.

The formula

H = 12 ÷ (N(N + 1)) × Σ(Rᵢ² ÷ nᵢ) − 3(N + 1), where Rᵢ is the rank sum of group i and N is the total sample size. H is divided by a tie correction when values repeat. The p-value comes from the chi-square distribution with k − 1 degrees of freedom, which works well when each group has at least about 5 values.

Assumptions and choices

  • The groups must be independent, and the data at least ordinal.
  • The test compares distributions. It compares medians only if the groups have the same shape.
  • With normal data of similar spread, ANOVA has more power. With skewed data or outliers, Kruskal-Wallis is the safer choice.
  • The effect size ε² = H ÷ (N − 1): about 0.01 is small, 0.08 medium and 0.26 large.

How to cite this page

CalcPulse. (2026). Kruskal-Wallis Test Calculator. https://calcpulse.com/kruskal-wallis-test-calculator/

Frequently asked questions

What is the Kruskal-Wallis test?

A rank-based test for whether three or more independent groups come from the same distribution. It is the non-parametric alternative to one-way ANOVA.

When should I use Kruskal-Wallis instead of ANOVA?

When the data are ordinal, strongly skewed or have outliers, or when the groups are small and not normal.

What do I do after a significant result?

Run pairwise comparisons, such as Dunn's test or Mann-Whitney tests with a correction for multiple tests.

What is the H statistic?

A measure of how far the mean ranks of the groups are from each other. It is compared with the chi-square distribution.

How many values does each group need?

At least 2 to run the test, but about 5 or more per group for the chi-square approximation to be reliable.

Last updated