Kruskal-Wallis test calculator

This Kruskal-Wallis test calculator compares three or more independent groups without assuming normal data. It is the rank-based alternative to one-way ANOVA. Paste each group’s values and get the H statistic corrected for ties, the p value, each group’s median and mean rank, and an effect size.

The numbers are calculated in your browser. Nothing you enter is sent or stored.

Kruskal-Wallis test calculatorOr describe it in Studio →

Independent groups. The numbers stay in your browser.

At least one group tends to have higher or lower values than the others (p = .015).

H
8.346
Degrees of freedom
2
p value
0.0154
Epsilon squared (ε²)
0.759
GroupnMedianMean rankRank sum
142.753.2513
244.155.7523
347.7510.542

Pairwise comparisons (Dunn's test, Bonferroni)

Groupszpp adjusted
1 vs 2-0.9810.32680.9804
1 vs 3-2.8440.00450.0134 *
2 vs 3-1.8630.06240.1873

A group has fewer than five values. The p value comes from the chi-square approximation, which is rough for groups this small; treat a borderline result with caution.

To report

H(2) = 8.35, p = .015, ε² = .76

Check your result: the rank sums must add up to N(N + 1) ÷ 2. In the worked example 13 + 23 + 42 = 78 = 12 × 13 ÷ 2; if your sums do not, a value was lost or counted twice. H is never negative, and ε² = H ÷ (N − 1) stays between 0 and 1.
H in the worked example
8.35
H in the worked example
independent groups
2–10
independent groups
ε² in the example
0.76
ε² in the example
Dunn comparisons for three groups
3
Dunn comparisons for three groups
  • 2 to 10 independent groups
  • H corrected for ties
  • Dunn’s pairwise comparisons
  • Epsilon squared effect size
  • Runs in your browser, free

01

How to use the calculator

  1. Paste each group’s values into its own box. Groups can have different sizes.
  2. Press “Add a group” for more than three groups.
  3. Read H and the p value, then compare the mean ranks to see which groups sit higher or lower.
07.815145%test statistic
A right-tail p value. Statistics such as chi-square, F and H can only be zero or positive, and larger values mean a worse fit to the null hypothesis. The p value is the area to the right of your statistic. The curve shown has 3 degrees of freedom; 5% of its area lies beyond 7.815.

02

When to use the Kruskal-Wallis test

  • Three or more independent groups (two groups give the same answer as the Mann-Whitney U test).
  • The outcome is ordinal, or a measurement that is skewed or has outliers, particularly with small groups.
  • For data that are close to normal with similar spread in each group, one-way ANOVA has more power.
  • Repeated measurements on the same subjects need the Friedman test instead.

03

The H statistic

Rank all N values together (tied values share the average rank). With Rᵢ the sum of ranks in group i and nᵢ its size:

H = 12 ÷ (N(N + 1)) × Σ (Rᵢ² ÷ nᵢ) − 3(N + 1)
with ties: divide H by 1 − Σ(t³ − t) ÷ (N³ − N)

Under the null hypothesis H follows approximately a chi-square distribution with (number of groups − 1) degrees of freedom, which gives the p value. The approximation is rough when groups have fewer than five values; the calculator says so when that applies.

04

Worked example

The calculator opens with three groups of four values.

GroupValuesMedianRank sumMean rank
11.1, 2.2, 3.3, 4.42.75133.25
22.5, 3.6, 4.7, 5.84.15235.75
36.1, 7.2, 8.3, 9.47.754210.5

H = 12 ÷ (12 × 13) × (13²/4 + 23²/4 + 42²/4) − 3 × 13 = 8.35, df = 2, p = .015

Reported as: H(2) = 8.35, p = .015, ε² = .76.

05

Effect size and follow-up tests

ε² = H ÷ (N − 1)

Epsilon squared runs from 0 to 1: the share of the variation in ranks that group membership accounts for.

A significant H says the groups are not all alike, not which ones differ. With three or more groups the calculator adds Dunn’s test for every pair, which reuses the ranks from the overall test, and multiplies each p value by the number of pairs (Bonferroni).

06

Common mistakes with the Kruskal-Wallis test

  • Reading a significant H as “all groups differ”. In the worked example H is significant, but Dunn’s test finds only group 1 against group 3 (adjusted p = 0.013); group 1 against 2 gives 0.98 and group 2 against 3 gives 0.19.
  • Running a separate test for every pair without correction. With three pairs each at the 5% level, the chance of at least one false positive is 14.3% if the three tests were independent.
  • Ignoring ties. For the groups 1, 1, 2, 2 / 2, 2, 3, 3 / 3, 3, 3, 4, H without the tie correction is 7.04 (p = 0.030); with it, 7.89 (p = 0.019).

Trust

How this page is checked

  • The calculation runs on code with automated tests against worked reference values. Every number in the examples on this page was produced by that same code, not typed by hand.
  • The formulas and conventions used are stated on the page, so you can reproduce the result yourself or compare it with your own software.
  • Sources: Kruskal and Wallis (1952), Use of ranks in one-criterion variance analysis; Dunn (1964), Multiple comparisons using rank sums.
  • Last reviewed by the Sciloom team, Zebra Nine Studio Inc. It is a tool for research and teaching, not a substitute for a statistician, a validated lab method or medical advice.

Cite this page

Sciloom. (2026). Kruskal-Wallis test calculator. Zebra Nine Studio Inc. https://sciloom.si/kruskal-wallis-test-calculator

Read the full methodology · Who makes Sciloom

Frequently asked questions

What is the Kruskal-Wallis test used for?

To test whether three or more independent groups come from the same distribution when the data are ordinal or not normal. It is the non-parametric counterpart of one-way ANOVA.

What does the H statistic mean?

H measures how far the groups’ average ranks are from what would be expected if all groups were alike. Larger H means larger differences between groups.

Does the Kruskal-Wallis test compare medians?

Only when the groups’ distributions have the same shape. In general it tests whether values in some group tend to be larger than in others.

What do I do after a significant result?

Read the pairwise table under the result: it runs Dunn’s test for each pair of groups with a Bonferroni correction, and marks the pairs that differ.

Data roughly normal with similar spread? The ANOVA calculator is the more powerful choice.
Free to start, no sign-up.
Back to the tool ↑

More research tools