Three or more groups, on ranks — and the correction most tools skip.
Three or more groups, on ranks
An optional name, a colon, then the values. Nothing separates them — H is small and p is far from significant.
H = 0.771429 on 2 degrees of freedom, 3 groups, 14 observations
p = 0.679965
No evidence that any group differs from the others.
A
7.2000
mean rank · median 2.9000 · n 5
B
9.0000
mean rank · median 3.2500 · n 4
C
6.6000
mean rank · median 2.8000 · n 5
H (tie-corrected)
0.771429
H (uncorrected)
0.771429
Tie correction factor
1.000000
no ties
ε² effect size
-0.111688
share of rank variance
Report the mean ranks, not the medians. Kruskal-Wallis compares stochastic ordering rather than medians, and the two coincide only when the groups share a shape — the same gap that makes Mann-Whitney not a median test. Load the “Same medians” preset, where all three medians are identical and the ranks still separate the groups, to see them come apart.
ε² is negative here, and that is a real value rather than an error. It is (H − k + 1)/(n − k), which goes below zero whenever H falls short of its expected value under the null — the groups are separating less than chance alone would produce. The same thing happens to adjusted R², and clamping it to zero would discard the finding.
What this tool shows
The tie correction can decide the result. On the tool’s ordinal preset it moves p from 0.0541 to 0.0199 — across the conventional threshold, on identical data. And all three of those groups have a median of exactly 3, which is why this is not a test of medians.
H, degrees of freedom and the p-value
The tie correction, applied and shown against the uncorrected value
Mean rank and median for every group
ε² effect size, which can legitimately go negative
The family-wise error rate of eyeballing the largest gap
Why the medians and the ranks can disagree
Three or more groups Tie correction shown Mean ranks reported ε² effect size
Identical medians of 3 in all three groups, separated at p = 0.0199.
Updated 9 September 2026 · Works in any browser, no installation
Kruskal-Wallis asks whether several groups differ in stochastic ordering. It pools every observation, ranks them, and compares each group’s mean rank against what chance would give — the rank-based counterpart to one-way ANOVA, making no assumption that the data is normal.
At a glance
Formula shown
Rank all N observations together with midranks, then H = 12/(N(N+1)) · Σ Rᵢ²/nᵢ − 3(N+1), compared against a chi-square distribution on k − 1 degrees of freedom. With ties, divide H by 1 − Σ(t³ − t)/(N³ − N); the correction always raises H, so omitting it makes the test conservative.
Scenario support
Comparing three or more groups on an ordinal or skewed measure; Likert responses across conditions; reaction times; small samples where normality cannot be checked; any ANOVA-shaped question whose data is not interval.
Educational estimate
Planning support from the values you enter — not professional advice.
The tie correction can change the verdict
The textbook H formula assumes no two observations are equal. On the data this test is usually chosen for, that is never true.
Ties reduce the spread of the rank sums, so the uncorrected H is systematically too small and the test comes out conservative — the real p-value is smaller than the one reported.
Load the “Same medians” preset and watch it cross the threshold. Uncorrected H is 5.8342 and p is 0.0541. Corrected, H is 7.8376 and p is 0.0199. Identical data, opposite conclusions at the conventional 5% line.
The correction is one division: divide H by 1 − Σ(t³ − t)/(N³ − N), summed over each group of tied values. It always raises H, never lowers it, so skipping it can only ever lose you a finding — not manufacture one.
It matters most on exactly the data a rank test is for. Likert scales, ratings out of five, rounded measurements and small integer counts are full of ties. The tool prints both H values and both p-values so the size of the effect is visible rather than assumed, and it is the same failure the Mann-Whitney tie correction exists to prevent.
With very heavy ties, a permutation test is better still. The chi-square approximation for H assumes reasonably large groups and degrades when a handful of distinct values dominate. Below about five per group, exact methods are the honest route.
It is not a test of medians
Kruskal-Wallis is described as “the non-parametric ANOVA on medians” almost everywhere. The first half is fair and the second is not.
What it tests is stochastic ordering — whether values drawn from one group tend to exceed values drawn from another. That is a statement about the whole distribution, not about its centre.
The tool’s “Same medians” preset has three groups whose medians are all exactly 3, and the test rejects at p = 0.0199. The medians are identical; the distributions are not.
The median reading needs an extra assumption: that the groups share a shape and differ only by a shift in location. Under that assumption a difference in stochastic ordering is a difference in medians. The assumption is rarely stated and it fails on data with different spreads or different skews — which is frequently why a rank test was reached for.
So report the mean ranks. They are what the statistic is built from, and the tool prints them for every group alongside the medians so the two can be compared directly. “The groups differed in distribution (H = 7.84, p = 0.020)” is accurate; “the medians differed” may be false while the p-value is real.
This is the same gap that makes Mann-Whitney not a median test, inherited directly — Kruskal-Wallis reduces to Mann-Whitney at two groups.
A significant H names no group
This limitation comes from the other parent, and it is structural rather than a gap in the output.
H pools every group into one number. It sums each group’s squared rank sum, so three groups at mean ranks 5, 10 and 15 produce the same H as three at 15, 10 and 5. The statistic never held them separately and cannot be read backwards.
The tool prints the mean ranks so the candidates are visible, and states plainly that the test did not rank them.
Picking the largest gap by eye is an uncorrected multiple comparison. With three groups there are three pairs and a 14.26% chance of at least one false positive at the 5% level; with five groups, ten pairs and 40.13%. The maximum of several differences is larger than any one of them by construction.
Dunn’s test is the standard post-hoc, and it is specifically the right one: it compares mean ranks using the ranking from the original pooled analysis, rather than re-ranking each pair separately, and applies a correction across the family. Running separate Mann-Whitney tests on each pair re-ranks within each comparison and controls nothing.
The two tests can disagree, and that is not a contradiction. A significant H does not guarantee any pair survives a post-hoc, and a non-significant H does not guarantee none would. They control different error rates over different families of hypotheses — exactly as ANOVA and Tukey can.
Against one-way ANOVA
The choice is usually framed as normal against non-normal, which is too crude to act on.
ANOVA’s normality assumption is about the residuals, not the data, and with moderate group sizes the central limit theorem does most of the work. A failed normality test on large groups detects a deviation too small to matter.
Use Kruskal-Wallis when the measure is genuinely ordinal. A five-point rating has no claim that the gap between 4 and 5 equals the gap between 2 and 3, and ANOVA treats it as though it does.
Use it when outliers would dominate. Ranks cap an extreme value’s influence at one rank position; ANOVA lets it move a group mean without limit, and the squared deviations amplify it.
The power cost is small, and often negative. Under perfect normality Kruskal-Wallis retains about 95% of ANOVA’s power. On heavy-tailed or skewed data it is frequently more powerful. “Non-parametric means weaker” holds only in the case where the parametric assumption actually holds.
Neither handles unequal variances well. This is the assumption people assume rank tests escape, and they do not: Kruskal-Wallis can reject because the groups differ in spread rather than in location. If the groups have visibly different variability, a significant H does not mean one group is higher — only that the distributions differ. Welch’s ANOVA or the Brown-Forsythe test target location under unequal spread more directly.
ε², and why it can go below zero
H and its p-value both grow with sample size, so neither says how large the difference is. Epsilon-squared is the standard effect size here, and it has a property worth understanding rather than clamping away.
ε² is (H − k + 1)/(n − k) — roughly the share of the rank variance the grouping accounts for, on a 0 to 1 scale.
It goes negative when H falls short of its expected value under the null. Under no real effect, H averages k − 1, so any H below that produces a negative ε². The tool’s first preset returns −0.12, and that is informative: the groups are separating less than chance alone would produce.
Software that clamps it to zero discards that. The same is true of adjusted R² and of an out-of-sample R², for the same reason: an unbiased-ish estimate of a bounded quantity is allowed to land outside the bound on a particular sample.
Eta-squared-H is the other convention in circulation, computed as (H − k + 1)/(n − k) as well in some sources and as H/(n − 1) in others. As with skewness, a named effect size here can mean more than one formula — state which you used.
And as always, report it alongside the p-value rather than instead of it. With large groups a trivial separation becomes significant; only the effect size distinguishes trivial from important.
Sources and methodology
References for the test, its correction and its post-hoc.
Method. Ranks use midranks and the tie correction is applied by default, with the uncorrected H and its p-value shown alongside — because on ordinal data the correction can move p across the conventional threshold, and many implementations skip it silently. The tail probability comes from the regularised incomplete gamma function rather than a table, so it is exact at any degrees of freedom. Mean ranks and medians are both printed, since the test compares the former and is routinely reported in terms of the latter. The suite asserts that the tie correction never lowers H and is exactly 1 when no ties are present, that the “Same medians” dataset has three identical medians of 3 while the corrected test rejects at p = 0.0199 and the uncorrected one does not at 0.0541, that H reduces to the Mann-Whitney comparison at two groups, and that ε² is reported negative rather than clamped when H falls below k − 1. That engine is verified on every change against 115 assertions. The count and the per-case breakdown are published on the formula verification page.
Related calculators
Where this goes next:
One-Way ANOVAThe full F table with eta and omega squared, plus every pairwise gap — because a significant F says something differs and never says which, and ten groups tested pairwise carry a 90% false-positive rate.
Mann-Whitney UMann-Whitney U with the tie correction and both medians shown, because it is not a test of medians — two samples with identical medians of 4 are separated at p = 0.01.
Wilcoxon Signed-RankReports how many zero differences it dropped and gives the Hodges-Lehmann shift, because the classical and Pratt variants disagree on the same data and the median of the differences is not what this test estimates.
Chi-SquareGoodness of fit and tests of independence with every expected count and per-cell contribution shown — because the validity condition is about expected counts, not observed ones, and most calculators hide them.
p-valueA p-value from a t or z statistic, one- or two-tailed — with a panel that holds an effect fixed and grows the sample, so you can watch significance appear from nothing but n.
Effect SizeCohen d, Hedges g and the overlap between groups, with a sample-size control that moves the p-value while leaving the effect size fixed — the same d gives t = 1.29 at n=30 and 23.57 at n=10,000.
An educational tool. Kruskal-Wallis compares distributions rather than medians, and it can reject because groups differ in spread rather than location — a significant H does not by itself mean one group is higher.
Published the rank-based alternative to one-way ANOVA with the tie correction applied and shown against the uncorrected value. On the built-in ordinal preset it moves p from 0.0541 to 0.0199 — across the conventional 5% line, on identical data — because ties shrink the rank sums and the uncorrected H is too small.
The same preset has three groups whose medians are all exactly 3 while the test still separates them, which is why this is not a test of medians. It compares stochastic ordering, and the median reading needs the extra assumption that the groups share a shape.
Prints every group's mean rank and states that a significant H identifies no group. Eyeballing the largest gap is an uncorrected multiple comparison carrying a 14.26% family-wise error rate at three groups; Dunn's test is the post-hoc that uses the pooled ranking rather than re-ranking each pair.
Reports a negative epsilon-squared rather than clamping it. It is (H - k + 1)/(n - k), which goes below zero when H falls short of its null expectation — the groups separating less than chance would produce, which is a finding rather than an error.
Add this calculator to your site
Responsive embed — and private: nothing your visitors type leaves their browser.