We believe math and science education should be free and accessible to everyone. Why education matters >

Kruskal-Wallis Test Calculator

Enter data for 2 to 4 independent groups to perform the Kruskal-Wallis H test, the non-parametric alternative to one-way ANOVA. No normality assumption required.

What is the Kruskal-Wallis Test?

The Kruskal-Wallis test is a rank-based non-parametric test for comparing distributions across two or more independent groups. It extends the Mann-Whitney U test to more than two groups and is the non-parametric counterpart to one-way ANOVA.

Formula:

H = (12 / (N(N+1))) x Σ(Rj²/nj) - 3(N+1)

Where N = total observations, Rj = sum of ranks in group j, nj = size of group j.

How it works:

  1. Combine all groups and rank all values together
  2. Handle ties by assigning the average rank
  3. Sum the ranks within each group
  4. Compute H from the rank sums
  5. Compare H to a chi-square distribution with (k-1) degrees of freedom

When to use Kruskal-Wallis:

  • Your data does not meet ANOVA's normality assumption
  • You have ordinal data or ranked data
  • Sample sizes are small or unequal
  • Your data has outliers that would distort parametric tests

If H is significant, use post-hoc pairwise Mann-Whitney tests (with a Bonferroni correction) to find which groups differ.

Did this solve your problem?

Frequently Asked Questions

Search Calculators

Search across all calculator categories