Percentages and Math

Kruskal-Wallis Test Calculator

Paste one group per line to test whether several groups tend to have different values.

Your numbers

One group per line. A name and a colon before the numbers are optional. Separate numbers with commas, spaces or semicolons. Example data.

Result

p value (chi-square approximation)

0.0028

H = 11.786 with 2 degrees of freedom.

H (tie corrected)
11.7860
Degrees of freedom
2
p value
0.0028
H before tie correction
11.7650
Tie correction factor
0.9982
Epsilon squared
0.8419
Groups and values
3 groups, 15 values

Ranks by group

GroupnMedianMean rankRank sum
Low57.23.1015.5
Mid59.78.1040.5
High513.412.8064
All158.00120

Pairs of groups (Dunn test, Bonferroni adjusted)

PairzpAdjusted p
Low vs Mid-1.7690.07680.2305
Low vs High-3.4330.00060.0018
Mid vs High-1.6630.09630.2888
How this was calculated
  1. Rank all 15 values together from smallest to largest, giving tied values the average of their ranks.
  2. Add up the ranks in each group and compute H = 12 / (N (N + 1)) x sum of (rank sum squared / n) - 3 (N + 1) = 11.7650.
  3. Divide by the tie correction 0.9982 to get 11.7860.
  4. Compare with a chi-square distribution with 2 degrees of freedom: p = 0.0028.
  • The test asks whether the groups tend to have different values. It does not say which direction, how large the difference is in the original units or whether the groups have the same shape. This page is a description of your sample.

Calculated using SumPanda.com · https://sumpanda.com/kruskal-wallis-test-calculator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the kruskal-wallis test calculator

  1. Type or paste your groups, one group per line. A name followed by a colon is optional, as in "Low: 6.4, 6.8, 7.2". Separate the numbers with commas, spaces or semicolons.
  2. Leave Compare each pair of groups ticked if you want a Dunn test for every pair, with a Bonferroni adjustment for the number of pairs.
  3. Read the p value and H, then the table of mean ranks. A larger gap between mean ranks means the groups sit at different levels.
  4. Check the note under the results if any group has fewer than 5 values, because the chi-square p value is rough for very small groups.

Formula

Rank all N values together; tied values share the average of their ranks.

H = 12 / (N (N + 1)) x sum of (R_i squared / n_i) - 3 (N + 1)

Tie correction C = 1 - sum of (t cubed - t) / (N cubed - N), over each block of t tied values

H corrected = H / C, compared with a chi-square distribution with k - 1 degrees of freedom

Dunn z for two groups = (mean rank 1 - mean rank 2) / sqrt(V (1/n1 + 1/n2)), V = N (N + 1) / 12 - sum of (t cubed - t) / (12 (N - 1))

R_i is the rank sum of group i, n_i its size and k the number of groups. Epsilon squared is H corrected divided by N - 1 and describes how much of the ranking is explained by group.

Three groups of five

Low: 6.4, 6.8, 7.2, 8.3, 8.4. Mid: 9.1, 9.7, 10.5, 12.0, 8.4. High: 13.4, 11.2, 14.1, 12.9, 15.0. The value 8.4 appears twice, so those two values share ranks 5 and 6 and each gets 5.5. The mean ranks are 3.1, 8.1 and 12.8.

H before the tie correction is 11.765. One tied pair gives C = 1 - 6 / 3,360 = 0.9982, so H corrected is 11.786 with 2 degrees of freedom and p = 0.0028. Epsilon squared is 0.842. For Low against High the Dunn z is -3.433, p = 0.0006 and the adjusted p is 0.0018; Low against Mid has an adjusted p of 0.2305.

What the test compares

The Kruskal-Wallis test looks at three or more groups and asks whether their values tend to be at different levels. It works on ranks instead of the raw numbers, so a few extreme values cannot dominate it and the data do not need to follow a bell curve. It is the rank-based counterpart of a one-way ANOVA, and with two groups it matches the Mann-Whitney test.

A small p value says the groups are unlikely to all come from the same spread of values. It does not say which groups differ, which is why the Dunn comparisons are shown, and it does not give the size of a difference in the original units. For that, look at the medians in the table.

Limits to keep in mind

The chi-square p value is an approximation that works well when every group has about 5 or more values. With tiny groups, an exact method such as a permutation test is a better check. If the groups differ in spread or shape, a significant result can come from that and not from a shift in level.

The Bonferroni adjustment multiplies each pair p value by the number of pairs and caps it at 1. It is simple and cautious. This page describes your sample and does not make a decision for you.

Assumptions and limits

  • Observations are independent: no value appears in two groups and no person is measured twice.
  • The values can be put in order. Ties are handled with average ranks and the tie correction.
  • The chi-square approximation is rough when groups are very small, so the page warns when any group has fewer than 5 values.
  • Dunn comparisons use the ranks from the whole sample and a normal approximation, adjusted by Bonferroni. Other adjustments give somewhat different adjusted p values.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

When should I use Kruskal-Wallis instead of ANOVA?

Use it when you have three or more groups and the values are ordered ratings, are clearly skewed, or have outliers that would distort group means. It compares ranks, so it does not need the groups to follow a bell curve.

What does the tie correction do?

When several values are equal, the plain H is a little too small. Dividing by the tie correction factor repairs that. With no ties the factor is exactly 1, and with only a few ties it is just under 1.

The p value is small. Which groups differ?

The overall test cannot say. Read the Dunn pair table: pairs with a small adjusted p value are the ones whose mean ranks are far enough apart. Pairs with large adjusted p values may still differ, but the data do not show it.

Can I use it with only two groups?

Yes, but the result is then the same kind of comparison as a Mann-Whitney test, and the Mann-Whitney page gives an exact p value for small samples that this chi-square version cannot.