Kruskal-Wallis H Test Calculator

Compare three independent groups with a rank-based nonparametric test and get the H statistic, degrees of freedom, and p value instantly.

Kruskal-Wallis test
Enter at least two numeric observations for each independent group.

About the Kruskal-Wallis H test

The Kruskal-Wallis H test is a nonparametric method for comparing three or more independent groups. It answers whether observations from the groups plausibly come from the same distribution without requiring normal data or equal population variances. It is often described as the rank-based alternative to a one-way analysis of variance. Researchers use it for ordinal ratings, skewed measurements, small samples, and quantitative results containing outliers that would make a mean-based comparison unreliable. The calculation begins by pooling every observation and sorting the combined data from smallest to largest. Each observation receives a rank. Equal observations share the average of the ranks they occupy, so ties are treated fairly. The ranks are then returned to their original groups and summed. If the null hypothesis is true, each group should have a similar average rank. Large differences among rank sums increase the H statistic and provide evidence that at least one group tends to contain higher or lower values. This calculator applies the standard correction for tied observations. The correction matters when repeated values occur because ties reduce the variability available in the ranking. After correction, H is compared with a chi-square distribution having the number of groups minus one degrees of freedom. This three-group calculator therefore reports two degrees of freedom. The displayed p value is the probability, under the null hypothesis, of obtaining an H statistic at least as large as the one calculated. A small p value indicates evidence against identical group distributions, but it does not identify which groups differ. If the overall result is significant, use an appropriate post-hoc comparison such as Dunn's test with a multiple-testing adjustment. Also remember that the test assumes independent observations and similarly shaped group distributions when interpreting the result specifically as a difference in medians. Paired measurements or repeated observations require a different procedure, such as the Friedman test. Statistical significance is not the same as practical importance. Report the group sample sizes, medians, spreads, H statistic, degrees of freedom, p value, and an effect-size measure when possible. Review plots of each group before drawing conclusions. This calculator provides a reproducible screening calculation, while sound study design and subject-matter judgment remain essential to a useful interpretation.

Kruskal-Wallis examples

GroupsResultInterpretation
1,2,3 | 4,5,6 | 7,8,9H = 7.2, p = 0.027324Clearly ordered groups produce a significant overall result.
1,4,7 | 2,5,8 | 3,6,9H = 0.8, p = 0.670320Interleaved ranks provide little evidence of a group difference.
2,2,4 | 3,3,5 | 4,4,6Tie-corrected testRepeated values receive average ranks and a tie correction.

How to use the Kruskal-Wallis calculator

  1. Enter the observations for the first independent group, separated by commas or spaces.
  2. Enter matching numeric data for the second and third independent groups.
  3. Click Calculate H Test to rank the pooled observations and compute the tie-corrected statistic.
  4. Compare the p value with your chosen significance level and review the interpretation.

Kruskal-Wallis test FAQ

When should I use the Kruskal-Wallis test?

Use it to compare three or more independent groups when a one-way ANOVA's distribution assumptions are doubtful. It is also suitable for ordinal outcomes that can be meaningfully ranked.

Does a significant result show which groups differ?

No. A significant H statistic only indicates that at least one group differs, so post-hoc pairwise tests are needed to locate the differences.

Does the test compare medians?

It compares group rank distributions. It can be interpreted as a median comparison when the group distributions have similarly shaped spreads.

How are tied values handled?

Tied observations receive their average rank. The H statistic is then divided by the standard tie-correction factor to preserve the chi-square approximation.

What assumptions does the test make?

Observations must be independent within and between groups, and the response should be at least ordinal. Representative sampling is also important for generalizing the conclusion.