Skip to content

Kruskal-Wallis Test Calculator

Paste the scores for each group and get the Kruskal-Wallis H statistic with its tie correction, the degrees of freedom, a p-value, ε² as an effect size, and each group's rank sum and mean rank — followed by Dunn's pairwise comparisons, Bonferroni-adjusted. It is the rank-based alternative to the one-way ANOVA. Free, no sign-up.

0 values

0 values

0 values

Enter at least one number in each of at least two groups.

How to Use the Kruskal-Wallis Test Calculator

  1. 1. Enter the groups. Name each group and paste its values. Three groups are ready; add up to ten. Each value must come from a different participant.
  2. 2. Choose α. It sets the decision line; the Dunn comparisons are adjusted for the number of pairs automatically.
  3. 3. Read H and p. A significant H says the groups do not all come from the same distribution. ε² tells you how much of the variation in ranks the grouping accounts for.
  4. 4. Find the difference. Dunn's test shows which pairs of groups differ. Copy the APA line and report each group's median or mean rank with it.

What the H Statistic Measures

Rank all N values together, from 1 for the smallest to N for the largest, giving tied values the average of their ranks. If the groups come from the same population, each group's mean rank should sit near the overall mean rank, (N + 1)/2. H measures how far the group rank sums Rⱼ stray from that: H = 12 / (N(N + 1)) × Σ Rⱼ²/nⱼ − 3(N + 1). Ties shrink the variance of the ranks, so H is divided by the correction C = 1 − Σ(t³ − t) / (N³ − N), where t is the size of each group of tied values. Under H₀, H approximately follows a chi-square distribution with k − 1 degrees of freedom, and the approximation is good once each group has at least five values.

The effect size ε² = H / (N − 1) runs from 0 to 1 and reads like η² in an ANOVA: the share of the variability in ranks associated with group membership (Tomczak & Tomczak, 2014). Some authors borrow Cohen's η² benchmarks of .01, .06, and .14 for small, medium, and large; treat them as rough guides.

Worked Example: Three Study Strategies

Click Try an example to load the number of words 18 students recalled after studying with one of three strategies: re-reading (Mdn = 13.5), practice testing (Mdn = 18.5), or highlighting (Mdn = 10.5). Four pairs of tied values share ranks.

Kruskal-Wallis test, step by step

Rank sums: 52, 92.5, 26.5 → mean ranks 8.67, 15.42, 4.42

H′ = 12 / (18 × 19) × (52²/6 + 92.5²/6 + 26.5²/6) − 3 × 19 = 12.96

C = 1 − 24 / 5814 = 0.9959, so H = 12.96 / 0.9959 = 13.01

df = 2, p = .0015; ε² = 13.01 / 17 = .77

In APA style: recall differed by study strategy, H(2) = 13.01, p = .001, ε² = .77. Dunn's test with a Bonferroni adjustment shows that practice testing outperformed highlighting (z = 3.58, adjusted p = .001). Practice testing versus re-reading gives z = −2.19, unadjusted p = .028 — but .085 after adjusting for three comparisons, so it does not reach significance. Re-reading and highlighting did not differ (adjusted p = .501).

Post Hoc Comparisons With Dunn's Test

A significant H does not say which groups differ. Running separate Mann-Whitney tests on each pair re-ranks the data every time and ignores the other groups; Dunn's test instead compares mean ranks from the single joint ranking, with z = (R̄ᵢ − R̄ⱼ) / SE and a standard error that accounts for ties. With three groups there are three comparisons, so each p is multiplied by three (Bonferroni). Holm's step-down adjustment is a slightly more powerful alternative if your field accepts it — apply it to the unadjusted p-values in the table.

SituationBetter choice
Roughly normal data with similar variancesOne-way ANOVA, which compares means
Normal data, unequal variancesWelch's ANOVA
Skewed data, outliers, or ordinal ratings with small groupsKruskal-Wallis
The same participants measured under every conditionNeither — use a repeated-measures method such as the Friedman test

Frequently Asked Questions

What does the Kruskal-Wallis test tell you?
Whether at least one of several independent groups tends to have larger values than another. It ranks all the data together and asks whether the groups' mean ranks are further apart than chance allows. A significant result calls for post hoc comparisons, such as Dunn's test, to find out which groups differ.
Is the Kruskal-Wallis test a test of medians?
Only if every group's distribution has the same shape and spread, so that they differ only in location. In general it tests whether the groups' distributions are the same — one group can differ in spread or skew and produce a significant H with an identical median. Report medians as a description and say what the test compared.
What post hoc test should I use after a Kruskal-Wallis test?
Dunn's test is the standard choice: it uses the mean ranks from the original joint ranking and a tie-adjusted standard error. Pair it with a correction for multiple comparisons — Bonferroni, as here, or the slightly more powerful Holm method. Avoid running separate Mann-Whitney tests without a correction.
How do I report a Kruskal-Wallis test in APA style?
Give each group's median or mean rank, then H(df) = value, p = value, and an effect size: H(2) = 13.01, p = .001, ε² = .77. Italicise H and p, leave the Greek ε upright, and drop the leading zero from p and ε². Follow with the Dunn comparisons that locate the difference.
Why is H divided by a tie correction?
Tied values receive the same average rank, which makes the ranks less spread out than 1, 2, …, N would be. Dividing by C = 1 − Σ(t³ − t) / (N³ − N) restores the right scale. With few ties C is close to 1 and barely changes H; with many ties, such as ratings on a five-point scale, the correction matters.
How many values do I need in each group?
For the chi-square p-value to be trustworthy, the usual guideline is at least five values per group; the calculator warns you below that. Very small groups also leave little power to detect a difference, and an exact or permutation test is then the better tool.

Related Tools

More in Statistics Calculators

See all Statistics Calculators