Tukey HSD Calculator - Post Hoc Test With Tukey-Kramer

    Which group means differ after a significant ANOVA? Run Tukey HSD from raw values, a summary table or means plus MSE and get q, HSD and every pair's interval and p.

    Parameters

    Enter data for calculations

    Values, a summary, or an ANOVA table

    Family-wise rate for all pairs together

    Form progress0 / 2 fields

    💡 Fill in all required fields to unlock the calculate button

    Tukey HSD: which group means differ after an ANOVA

    A significant ANOVA says the group means are not all equal; it does not say which ones differ. The Tukey HSD test compares every pair at once and keeps the chance of even one false alarm across all pairs at your chosen α, 0.05 by default. This calculator accepts raw measurements, a summary table of sizes, means and SDs, or just the group means plus the MSE and error degrees of freedom from an ANOVA table. It returns the critical q, the HSD for equal groups, a simultaneous confidence interval, q and p for every pair, and switches to the Tukey-Kramer version when the groups are not the same size.

    Four numbers from the NIST worked example

    4 × 5
    four groups of five measurements, so 6 pairs and 16 error degrees of freedom
    4.0461
    the critical q(0.05; 4, 16) the whole test rests on
    2.087
    the honestly significant difference: any two means further apart than this differ
    4 of 6
    pairs that differ; groups 1 and 4, and 2 and 3, do not

    Setting it up in four choices

    1. Type of data - raw measurements, a summary per group (size, mean, SD), or group means with the MSE from an ANOVA table you already have.
    2. The groups - one per line with an optional name before a colon. Raw values separated by spaces, commas or semicolons (G1: 6.9 5.4 5.8 4.6 4.0), a summary as size, mean, SD (5, 5.34, 1.117), or size and mean only in the third mode (5, 5.34). From 2 to 10 groups.
    3. MSE and error df - only in the third mode: the mean square of the "Within groups" or "Error" row of the ANOVA table, and its degrees of freedom, N - k in a one-way design (1.331 and 16 in the NIST example).
    4. Significance level - the family-wise rate for all pairs together: 0.05, 0.01 or 0.10.
    5. Read the result - the number of significant pairs, the critical q and HSD, then one row per pair with the mean difference, the simultaneous interval, q, p and the verdict.

    All six pairs of the NIST example

    The NIST/SEMATECH e-Handbook prints the six 95% simultaneous intervals for this data set to two decimals. The calculator reproduces every one of them; a pair differs when its interval does not contain zero.

    Pair Difference 95% interval p Verdict
    2 vs 12.380.29 to 4.470.0228differ
    3 vs 13.221.13 to 5.310.0022differ
    1 vs 4-0.16-2.25 to 1.930.9961no difference
    2 vs 3-0.84-2.93 to 1.250.6645no difference
    2 vs 42.220.13 to 4.310.0352differ
    3 vs 43.060.97 to 5.150.0035differ

    Studentized range table: q at α = 0.05

    Columns are the number of groups, rows the error degrees of freedom. The values match Table B.5 of the studentized range statistic; the calculator agrees with all 396 cells of that table (α 0.05 and 0.01, 2 to 10 groups) within rounding. To get the HSD for equal groups, multiply q by the square root of MSE / n.

    Error df 2 3 4 5 6 10
    103.153.884.334.654.915.60
    202.953.583.964.234.455.01
    302.893.493.854.104.304.82
    602.833.403.743.984.164.65
    1202.803.363.683.924.104.56
    Infinite2.773.313.633.864.034.47

    Four facts hiding in the q table

    Two groups bring you back to the t-test. With k = 2, q equals √2 times the two-sided t value: at 4 degrees of freedom t = 2.776 and q = 3.926, so Tukey with two groups is the pooled t-test.
    Every extra group raises the bar for every pair. At 30 error degrees of freedom, q climbs from 2.89 for two groups to 4.82 for ten. The same two means can be "significantly different" in a three-group study and not in a ten-group one, because the test protects more pairs at once.
    Large samples flatten the table. Going from 10 to 120 error degrees of freedom lowers q for five groups from 4.65 to 3.92; beyond that the infinite row, 3.86, is almost reached.
    Unequal groups make the test stricter, not looser. With unequal sizes the calculator uses Tukey-Kramer, a separate standard error for each pair. NIST notes that the Tukey method is conservative when sample sizes are unequal: the real family-wise error rate is then below α.

    Three kinds of user, three ways in

    A spreadsheet with every value. Paste the groups in the first mode. For the corn data of the NCSS one-way ANOVA chapter (13, 16 and 14 plots) the test switches to Tukey-Kramer with q(0.05; 3, 40) = 3.442: C differs from A (p = 0.0049) and from B (p = 0.0048), A and B do not (p = 0.9856).
    An ANOVA table and a list of means. Four diets, 12 people each, means 4.1, 5.9, 6.4 and 4.6, MSE 2.25 with 44 df: q = 3.776, HSD = 1.635, and three pairs differ (A-B, A-C, C-D).
    A significant ANOVA that Tukey cannot place. Groups of 8, 15 and 11 with means 21.4, 24.9 and 25.1 and SDs 3.2, 3.6 and 2.9 give F(2, 31) = 3.62, p = 0.0385 in the ANOVA calculator, yet the closest Tukey-Kramer pair stops at p = 0.0542. The overall test pools the evidence; the pairwise test asks more of each pair. Report both.

    Post hoc questions, briefly

    What does HSD stand for and when is it shown?
    Honestly significant difference: q × √(MSE / n), the smallest gap between two means that counts as significant. It is a single number only when all groups have the same size, so the calculator shows it for equal groups; with unequal groups each pair has its own threshold.
    Where do I find MSE and the error df in software output?
    In the ANOVA table, on the row labeled Within Groups, Error or Residuals: the "MS" or "Mean Sq" column is the MSE and the "df" column is the error df. In the NIST example those are 1.331 and 16, which give q = 4.0461 and HSD = 2.088 in the third mode.
    Why are the p-values not multiplied by the number of pairs?
    That would be the Bonferroni correction. Tukey's p already comes from the distribution of the largest gap among k means, so it accounts for all pairs by construction; multiplying again would double-count.
    What if the group variances are very different?
    Tukey pools them into one MSE and assumes they are equal. Check the variance warning in the ANOVA calculator first; if it fires, the pooled MSE is a poor summary of the spread and the Tukey result deserves caution.

    Related tools

    ANOVA Calculator

    The overall F-test that usually comes first, with Welch's version and a variance check - See the calculator

    Kruskal-Wallis Test Calculator

    The rank-based route, with Dunn's pairwise comparisons in place of Tukey - See the calculator

    Two-Sample T-Test Calculator

    One planned comparison of two groups, with Welch and paired versions - See the calculator

    Confidence Interval Calculator

    An interval for a single mean, to set beside the simultaneous ones - See the calculator

    P-Value Calculator

    Turns an F, t, z or chi-square from a printout into a p-value - See the calculator

    Standard Error Calculator

    The standard error of each group mean, from data or a report - See the calculator

    Sample Size Calculator

    How many observations per group a planned comparison needs - See the calculator

    Similar calculators from this section