Tukey HSD Calculator
This Tukey HSD calculator computes the honestly significant difference, the threshold that two group means must exceed to be judged significantly different after a one-way analysis of variance. When an ANOVA shows that not all group means are equal, Tukey's test controls the family-wise error rate across every pairwise comparison, so you do not inflate the chance of a false positive by testing many pairs. The honestly significant difference is the studentized range critical value multiplied by the square root of the within-group mean square divided by the per-group sample size, the standard form documented in the US National Institute of Standards and Technology Engineering Statistics Handbook. Enter the studentized range value q for your number of groups and error degrees of freedom (read from a q table), the within-group mean square from the ANOVA, and the number of observations per group. The calculator returns the standard error and the HSD threshold; any pair of means farther apart than the HSD is significantly different. Use it to follow up an ANOVA with controlled pairwise tests. Every figure is computed deterministically from the Tukey formula shown in full below, with a worked example that reconciles exactly to the calculator so you can follow each step yourself.
The HSD scales the studentized range by the standard error: with q = 3.50, within-group mean square 10.00 and group size 5, the standard error is 1.414214 and the HSD is 4.95. Means farther apart than 4.95 differ significantly.
Tukey HSD formula
HSD = q x sqrt( MS_within / n )
q = studentized range critical value (from a q table)
MS_within = within-group (error) mean square from the ANOVA
n = number of observations per group
The square-root term is the standard error of a group mean. Multiplying it by the studentized range value q sets a single critical distance that controls the error rate across all pairwise comparisons at once, which is what makes the difference honestly significant rather than merely significant for one chosen pair.
Worked example
Find the HSD for q = 3.5, a within-group mean square of 10 and 5 observations per group.
- MS_within / n = 10 / 5 = 2.000000
- standard error = sqrt(2.000000) = 1.414214
- HSD = 3.5 x 1.414214 = 4.949747
- rounded, HSD = 4.95
The honestly significant difference is 4.95, so any two group means more than 4.95 apart are significantly different. These are the calculator's default inputs, so the result above matches the widget exactly.
How inputs move the HSD
Larger q values and larger error variance raise the threshold; larger groups lower it.
| q | MS error | n | HSD |
|---|---|---|---|
| 3.50 | 10 | 5 | 4.95 |
| 3.50 | 10 | 10 | 3.50 |
| 4.00 | 10 | 5 | 5.66 |
| 3.50 | 20 | 5 | 7.00 |
Tukey method reference: US National Institute of Standards and Technology (NIST) Engineering Statistics Handbook.
Tukey HSD Calculator: frequently asked questions
When do I use Tukey's HSD?
Use it after a one-way ANOVA has rejected the hypothesis that all group means are equal, when you want to know which specific pairs of groups differ. Tukey's test compares every pair while holding the overall false-positive rate at your chosen level, so it is the standard honest follow-up when you have equal or near-equal group sizes.
Where do I get the q value?
The studentized range value q comes from a published q table (or statistical software) indexed by your significance level, the number of groups, and the within-group degrees of freedom. This calculator takes q as an input because that table lookup depends on your exact design; supply the q that matches your number of treatments and error degrees of freedom.
What is the within-group mean square?
It is the error mean square from your ANOVA table, the pooled estimate of the variance within the groups. It equals the error sum of squares divided by the error degrees of freedom. Reading it straight from the ANOVA output and entering it here keeps the HSD consistent with the analysis it follows.
What if my groups are different sizes?
The basic HSD assumes equal group sizes n. When sizes differ, the Tukey-Kramer variant replaces n with a harmonic-style adjustment using the two group sizes in each comparison. This tool uses the equal-n form; for unequal groups, compute the standard error per pair with the Tukey-Kramer correction.
How do I interpret the result?
Compute the absolute difference between each pair of group means. If a difference exceeds the HSD, that pair is significantly different at your chosen level; if it is smaller, the pair is not distinguishable. The single HSD threshold applies to every pairwise comparison in the equal-n design.
Official sources
- Tukey method and ANOVA reference: US National Institute of Standards and Technology (NIST). As at 25 June 2026.
Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.