Tukey HSD Calculator
Tukey’s HSD (Tukey–Kramer) post-hoc test after ANOVA — studentized range critical q, MSE, honestly significant difference and adjusted p-values and intervals for every pair.
How it works
MSE = ΣΣ(yᵢⱼ − ȳᵢ)² ÷ (N − k); for each pair q = |ȳᵢ − ȳⱼ| ÷ √[MSE/2 · (1/nᵢ + 1/nⱼ)]; p = P(Q_{k, N−k} > q); CI = (ȳⱼ − ȳᵢ) ± q_crit·√[MSE/2 · (1/nᵢ + 1/nⱼ)]; HSD = q_crit·√(MSE/n) for equal n
After an ANOVA says “some means differ”, Tukey’s honestly significant difference test finds which pairs do, while keeping the family-wise error rate at α across all comparisons. Every difference is compared with the studentized range distribution for k groups and N − k degrees of freedom; this calculator evaluates that distribution by numerical integration (the same quantity as R’s ptukey/qtukey), and uses the Tukey–Kramer form when group sizes differ.
Worked example
Three groups of five (means 23.8, 29.0 and 26.0), MSE = 2.9 on 12 df: the critical q is 3.773, so the HSD is 2.873. Groups 1 vs 2 (difference 5.2, p = 0.0011) and 2 vs 3 (difference −3.0, p = 0.0406) differ significantly; 1 vs 3 (2.2, p = 0.1444) does not — 2 of 3 pairs are significant.
Sources: NIST/SEMATECH e-Handbook — Tukey’s method · SciPy — scipy.stats.tukey_hsd
Frequently asked questions
Do I need a significant ANOVA first?
Strictly no — Tukey’s test controls the family-wise error on its own — but it is usually reported as the follow-up to a significant one-way ANOVA.
What does “honestly significant” mean?
That the error rate is controlled for all pairwise comparisons at once, unlike running many separate t-tests, which would find false differences far more often.
What if my group sizes differ?
The calculator automatically uses the Tukey–Kramer adjustment, which uses the harmonic combination of the two group sizes for each pair.
Tukey or Bonferroni?
For all pairwise comparisons Tukey is more powerful. Bonferroni is better when you only test a few planned comparisons.
What if the variances are unequal?
Use the Games–Howell procedure instead; check equal variances first with Levene’s test.
Related calculators
Educational tool: check the test’s assumptions (sample size, independence, distribution) before relying on a result for a real decision.