Run the Kruskal-Wallis H test (non-parametric one-way ANOVA) on three or more independent groups with ties-corrected H, χ²(k − 1) p-value, epsilon-squared and eta-squared effect sizes, and Dunn's post-hoc. Plus the Friedman test for repeated measures and the Jonckheere-Terpstra trend test. Paste your groups by hand or import them straight from a comma-separated values file or an Excel spreadsheet. Reproducible R, Python, and APA output.
Whitespace, commas, semicolons, and tabs all separate values. Label is optional; if omitted, groups are named "Group 1, 2, ..." in order.
Upload a spreadsheet in wide format (one column per group) or long format (agroup column and a value column). The groups populate the box above.
Drag & drop a file or
CSV, TSV, Excel (.xlsx/.xls) - max 500 rows
Group rank sums and mean ranks
Effect sizes
Strong effect (ε² ≥ .36).
Dunn's post-hoc (holm, α = 0.05)
| Comparison | Δ mean rank | z | p (raw) | p (adj) |
|---|---|---|---|---|
| Control vs Low dose | -5.92 | -1.92 | 0.0543 | 0.1086 |
| Control vs High dose | -11.83 | -3.85 | 1.19e-4 | 3.56e-4 |
| Low dose vs High dose | -5.92 | -1.92 | 0.0543 | 0.1086 |
William Kruskal and W. Allen Wallis (1952) introduced the H statistic as a one-way non-parametric analogue of the F-test for analysis of variance. The motivation was practical: parametric ANOVA depends on the assumption that residuals are approximately normal, which breaks down for ordinal Likert scales, heavily skewed continuous outcomes, and small samples. Kruskal-Wallis bypasses the distributional assumption entirely by ranking all observations across groups and then asking whether the average ranks differ more than would be expected by chance. Mathematically H = 12/(n(n+1)) × Σ(Rⱼ² / nⱼ) − 3(n+1), and under the null hypothesis of identical distributions, H follows approximately a χ² distribution with k − 1 degrees of freedom.
The test reduces to the Mann-Whitney U when k = 2, which is why both papers cite the same Wilcoxon (1945) rank-sum origin. Like Mann-Whitney, the Kruskal-Wallis test has two interpretive frames: under the strong location-shift assumption (all groups share the same shape, differing only in location) it tests for differences in median; under the weaker stochastic-dominance frame it tests whether one group is stochastically larger than another. The choice matters for interpretation; dispersion differences can produce a significant H without a true location shift, in which case the Conover-Iman or Brunner-Munzel test should be used as a sensitivity check.
Ties are the dominant practical concern for ordinal data. The average-rank assignment does not bias H's mean but inflates its variance, so the χ² p-value becomes anti-conservative if the correction is omitted. The calculator divides H by the correction factor C = 1 − Σ(tⱼ³ − tⱼ) / (n³ − n), which is the standard formula used by R's kruskal.test() and SciPy's scipy.stats.kruskal. For heavily tied 5-point Likert data the correction is non-trivial; the calculator reports both corrected and uncorrected H so you can verify the adjustment.
A significant omnibus H requires a post-hoc test to identify which pairs differ. Dunn's (1964) test compares mean ranks using the global ties-corrected variance and adjusts the family-wise error rate via Bonferroni, Holm (1979), or Sidak. The calculator defaults to Holm, which is uniformly more powerful than Bonferroni while controlling the family-wise error rate at the same level. The Conover-Iman (1979) test is an alternative that uses pooled-variance t-statistics; it is uniformly more powerful than Dunn's but is valid only when the omnibus Kruskal-Wallis is significant. Both are available in R's PMCMRplus package and Python's scikit-posthocs, and the calculator emits code for both.
The Friedman test (1937) is the calculator's repeated-measures companion. Ranks are assigned within each subject (block) across the k conditions, and the column rank sums are compared to their null expectation via the χ²_r statistic. The Iman-Davenport (1980) F-transformation is more powerful than χ²_r for small samples and is reported alongside the conventional p-value. Kendall's W = χ²_r / (n(k − 1)) is the natural effect-size companion, interpretable as the proportion of agreement across raters or repeated measurements. For ordered alternatives (increasing dose, increasing severity, increasing exposure), the Jonckheere-Terpstra test sums the pairwise Mann-Whitney U counts across all i < j pairs and is uniformly more powerful than Kruskal-Wallis. APA and dose-response guidelines explicitly recommend it.
The Kruskal-Wallis test sits in the broader k-group testing surface. For approximately normal continuous outcomes with similar variances, the parametric ANOVA calculator (one-way, two-way, repeated measures) is slightly more powerful. For two-group comparisons, see the Mann-Whitney U test calculator (its k = 2 special case) or the two-sample t-test calculator. For 2 × 2 categorical comparisons, see the Fisher's exact test calculator. And for a publication-ready APA write-up of any non-parametric analysis with the full Dunn post-hoc and Kendall's W by a PhD statistician, the statistical analysis service covers everything end-to-end.
Kruskal-Wallis H (default) for three or more independent groups; Friedman for repeated measures / matched blocks; Jonckheere-Terpstra for an ordered alternative (dose-response, trend).
Kruskal-Wallis / Jonckheere: one group per line with an optional 'Label:' prefix. Friedman: one subject per row, conditions across columns, with an optional header row.
Tie-corrected H (highlighted) is the default report; uncorrected H also shown. χ²(k − 1) approximation yields the asymptotic p; tie correction tightens it for ordinal data.
Epsilon-squared (ε²), eta-squared (rank), and Kendall's W are reported. Friedman additionally reports the Iman-Davenport F; Jonckheere-Terpstra reports the J statistic and its z.
Pairwise mean-rank comparisons with Bonferroni, Holm (default), or Sidak adjustment. Significant pairs at α are highlighted; copy the full table to R or Python for reporting.
Reproducible snippets for kruskal.test, PMCMRplus::kwAllPairsDunnTest / Conover, friedman.test, JonckheereTerpstraTest, scipy.stats.kruskal, scikit_posthocs.posthoc_dunn, and an APA results sentence.
Next step
A PhD statistician adds Dunn's, Conover-Iman, and Steel-Dwass post-hocs with adjusted CIs, Friedman or aligned-rank repeated-measures analysis, Jonckheere-Terpstra trend tests, and a publication-ready APA results section.
Our promise: Free re-run and re-write if reviewers question the analysis or reporting.
Timeline
Most projects deliver in under 2 weeks. We confirm an exact date in your quote.
If reviewers push back
If reviewers question the analysis, assumptions, or reporting, we re-run and re-write free.
Confidentiality
NDA available on request before any project discussion. Your data, study design, and manuscript stay private either way.
Want a PhD methodologist to handle the whole project?
Get a complete rank-based ANOVA workup with Dunn's, Conover-Iman, and Steel-Dwass post-hocs, Friedman or aligned-rank for repeated measures, Jonckheere-Terpstra trend tests, ordinal-logistic alternatives, and APA-formatted reporting by a PhD statistician. Free re-run and re-write if reviewers question the analysis or reporting. Pay only after you approve your quote.
H = 12 / (n(n + 1)) × Σ Rⱼ² / nⱼ − 3(n + 1)
Rank all observations 1..n across groups (average rank for ties). Rⱼ is the rank sum of group j. Under H₀, H ~ χ²(k − 1). The Mann-Whitney U is the special case k = 2.
C = 1 − Σ(tⱼ³ − tⱼ) / (n³ − n) H_corrected = H / C
tⱼ is the size of the j-th tied group. C ≤ 1. Without the correction the χ² p-value is too large; for heavily tied ordinal data (Likert) C may be < 0.95.
z = (R̄ᵢ − R̄ⱼ) / √(Var(R̄) × (1/nᵢ + 1/nⱼ))
Var(R̄) = (n(n + 1) / 12) − Σ(tⱼ³ − tⱼ) / (12 (n − 1)) uses the global ties-corrected variance. Adjust p with Holm (default), Bonferroni, or Sidak.
χ²_r = 12 / (n k (k + 1)) × Σ Rⱼ² − 3 n (k + 1)
n = number of subjects (blocks), k = number of conditions. Ranks are assigned within each row, then column rank sums are compared. Tie-corrected: divide by C = 1 − Σ(tᵢ³−tᵢ) / (n(k³−k)).
J = Σᵢ<ⱼ Uᵢⱼ z = (J − E[J]) / √Var(J)
Uᵢⱼ counts (a, b) pairs with a < b across ordered groups i < j (plus ½ ties). E[J] = (n² − Σnᵢ²) / 4; uniformly more powerful than Kruskal-Wallis when the alternative is monotonic.
ε² = H / ((n² − 1) / (n + 1)) η² = (H − k + 1) / (n − k) W = H / (n(k − 1))
Epsilon-squared is the rank generalisation of η²; rank-based η² is the proportion of rank variance explained; Kendall's W extends to Friedman as a coefficient of concordance.
The Kruskal-Wallis H test (Kruskal & Wallis, 1952) is a non-parametric procedure for comparing three or more independent groups. It is the rank-based generalisation of the Mann-Whitney U test from two groups to k groups, and the non-parametric counterpart of one-way ANOVA. The H statistic measures how unevenly the rank sums are distributed across groups: H = 12/(n(n+1)) × Σ(Rⱼ² / nⱼ) − 3(n+1). Under H₀ that all groups come from the same distribution, H is approximately χ²-distributed with k − 1 degrees of freedom.
Use the Kruskal-Wallis test when (1) the outcome is ordinal rather than truly continuous, (2) the residuals from a parametric ANOVA are not approximately normal (especially with small samples), or (3) the data are heavily skewed or contain outliers. For normally distributed continuous data with similar variances, the one-way ANOVA is slightly more powerful. For approximately normal data with unequal variances, prefer Welch's ANOVA. For ordinal Likert scales and heavily skewed continuous data, Kruskal-Wallis is the standard non-parametric reference, recommended by APA and major reporting guidelines.
When tied observations exist, the average-rank assignment leaves the mean of H under the null unaffected but inflates its variance. The tie correction divides H by the factor C = 1 − Σ(tⱼ³ − tⱼ) / (n³ − n), where tⱼ is the size of the j-th tied group and n is the total sample size. Without this correction the asymptotic p-value is too large, especially for heavily tied ordinal data (Likert scales, ordinal grades). The calculator applies the correction automatically and reports both the corrected and uncorrected H.
Dunn's (1964) test is the standard non-parametric post-hoc: it compares mean ranks across all pairs using a z-statistic that re-uses the global ties-corrected variance and adjusts the family-wise error rate (Bonferroni, Holm, or Sidak). The Conover-Iman (1979) test is an alternative that uses pooled-variance t-statistics and is uniformly more powerful than Dunn's but requires the omnibus Kruskal-Wallis to be significant first. The Steel-Dwass-Critchlow-Fligner test is another option; the calculator provides Dunn's with all three common corrections and the R/Python code prints both Dunn's and Conover-Iman.
Three effect sizes are commonly reported. Epsilon-squared (ε²) = H / ((n² − 1) / (n + 1)) is the most direct generalisation of η² for rank data and ranges from 0 to 1. The rank-based η² = (H − k + 1) / (n − k) is the proportion of rank variance explained, also bounded 0 to 1. Kendall's W = H / (n(k − 1)) extends to Friedman as a coefficient of concordance. Conventional ε² benchmarks are: weak (≈ .01), moderate (≈ .08), strong (≈ .26). The calculator reports all three so you can match whichever your reviewer expects.
The Friedman test (Friedman, 1937) is the non-parametric counterpart of repeated-measures ANOVA. Use it when the same subjects (or matched blocks) are measured under k ≥ 3 conditions or time points. Ranks are assigned within each row (subject) across the k conditions, and the test checks whether the column rank sums differ from their null expectation. The Iman-Davenport (1980) F-transformation is more powerful than the χ²_r approximation for small samples; Kendall's W is the natural effect-size companion, interpretable as the proportion of agreement on rankings across subjects.
The Jonckheere-Terpstra test (Jonckheere 1954; Terpstra 1952) is the non-parametric test for ordered alternatives H₁: F₁ ≤ F₂ ≤ ... ≤ Fₖ (with at least one strict). It is far more powerful than the Kruskal-Wallis when there is a real monotonic trend across the groups, for example increasing doses of a drug, increasing severity of disease, or increasing exposure. The J statistic is computed by summing the Mann-Whitney U counts across all pairs i < j; under the null, J is approximately normal with mean (n² − Σnᵢ²)/4 and a known variance. Most online calculators omit it entirely; APA and dose-response guidelines explicitly recommend it for ordered hypotheses.
Three assumptions. (1) Independent observations within and between groups (no clustering or repeated measures, use Friedman for repeated measures). (2) The dependent variable is at least ordinal. (3) Under the strong location-shift interpretation, the groups have the same distributional shape and differ only in location; under the weaker stochastic-dominance interpretation, the test compares P(X > Y) across groups. The test does NOT require normality. Crucially, when group shapes or variances differ markedly, a significant H may reflect dispersion rather than location differences. In that case, report the Brunner-Munzel or Conover-Iman test as a sensitivity check.
A significant omnibus H test means at least one group differs from at least one other. It does not identify which pairs differ; that requires a post-hoc test (Dunn's, Conover-Iman, Steel-Dwass). Always pair the H statistic with (a) an effect size (ε², η², or Kendall's W), (b) descriptive medians and IQRs for each group, and (c) post-hoc pairwise comparisons with a multiple-comparison adjustment if the omnibus is significant. Reporting only H and p without group medians and post-hoc comparisons is incomplete by APA and CONSORT standards.
Report the group sizes, the tie-corrected H statistic with its degrees of freedom, the exact or asymptotic p-value, an effect size, and the post-hoc pairwise comparisons that are significant. APA example: 'A Kruskal-Wallis H test was conducted to compare pain scores across three treatment groups (control: n = 25, Mdn = 6.0; standard: n = 27, Mdn = 4.0; experimental: n = 26, Mdn = 2.5). There was a statistically significant difference between groups, H(2) = 18.42, p < .001, ε² = .23. Dunn's pairwise comparisons with Holm correction showed experimental < control (z = −4.12, p < .001) and experimental < standard (z = −2.45, p = .014); standard did not differ from control (z = −1.66, p = .097).' For Friedman: χ²_r(df), p, Kendall's W. For Jonckheere-Terpstra: J statistic, z, p.
For the parametric counterpart on three or more groups with normally distributed residuals, see the ANOVA calculator (one-way, two-way factorial, repeated measures). For two-group rank-based testing, the special case k = 2, use the Mann-Whitney U test calculator. For approximately normal two-group continuous data, the two-sample t-test calculator (Student and Welch) is the parametric reference. For 2 × 2 categorical comparisons, see the Fisher's exact test calculator. For standardised effect sizes (Cohen's d, Hedges' g), see the effect size calculator. For sample-size planning under a target effect, see the sample size calculator and power analysis calculator.
Reviewed by
Dr. Sarah Mitchell holds a PhD in Biostatistics from Johns Hopkins Bloomberg School of Public Health and has over 15 years of experience in systematic review methodology and meta-analysis. She has authored or co-authored 40+ peer-reviewed publications in journals including the Journal of Clinical Epidemiology, BMC Medical Research Methodology, and Research Synthesis Methods. A former Cochrane Review Group statistician and current editorial board member of Systematic Reviews, Dr. Mitchell has supervised 200+ evidence synthesis projects across clinical medicine, public health, and social sciences. She reviews all Research Gold tools to ensure statistical accuracy and compliance with Cochrane Handbook and PRISMA 2020 standards.
From data cleaning and assumption checks to the full analysis and a publication-ready results section, we handle the numbers so you can focus on the science.
Our promise: Free re-run and re-write if reviewers question the analysis or reporting.
Your project is led by a named PhD methodologist with real credentials and published work.
4.9 / 5 across 1,194+ delivered projects