gizmobench

Tukey Comparison Calculator

Compare every pair of group means in one worksheet. Enter 2 to 20 independent numeric groups to see group summaries, pooled MSE, error degrees of freedom, adjusted p-values and simultaneous intervals. Equal group sizes use Tukey HSD; unequal sizes use Tukey-Kramer.

Tukey HSD · equal sizes

Example preview. Replace the groups below to compare your own observations.

Independent groups2 to 20 groups

Optional name, then a colon. Separate numbers with commas, spaces or tabs. Use a decimal point; commas separate observations, so omit thousands separators.

At least 2 values in every group. Up to 10,000 observations in total. Calculated in your browser.

Group summaries18 values
Group counts, means and sample variances
GroupnMeans²
A63.53.5
B69.53.5
C615.53.5
Pooled MSE
3.5
Error df
15
95% critical q
3.673378
95% simultaneous intervalsDots mark signed mean differences. The center line is zero. Numeric estimates and significance labels are in the comparison table below.
All pairwise comparisonsDifference = first − second
Tukey HSD, family alpha 0.05, 95% simultaneous confidence intervals
PairDifferenceSE for qqAdjusted p95% simultaneous CISignificant
A − B-60.76376267.8558440.000153773[-8.805589, -3.194411]Yes
A − C-120.763762615.711693.53142e-8[-14.80559, -9.194411]Yes
B − C-60.76376267.8558440.000153773[-8.805589, -3.194411]Yes
Comparisons
3 pairs
Pooled MSE
3.5
Error df
15
Family confidence
95%

Displayed estimates are rounded. CSV preserves unrounded numeric estimates; very small p-values remain bounds.

Try a worked example

Accuracy. Tukey HSD assumes independent, approximately normal errors with a common population variance; unequal group sizes use Tukey-Kramer. Studentized-range probabilities and simultaneous intervals are numerical estimates, with p-values below 1e-10 shown as a bound. This worksheet does not verify assumptions or choose a test.

How the comparisons are calculated

The pooled mean square error is the sum of within-group squared deviations divided by N − k. Each group variance uses n − 1 in its denominator.

SEᵢⱼ = √[MSE × (1/nᵢ + 1/nⱼ) / 2]
q = |meanᵢ − meanⱼ| / SEᵢⱼ
Simultaneous interval = (meanᵢ − meanⱼ) ± critical q × SEᵢⱼ

Adjusted p-values use the studentized-range distribution with k groups and N − k error degrees of freedom. Family alpha applies to the set of all pairwise comparisons. Equal counts use Tukey HSD; unequal counts use Tukey-Kramer.

The omnibus F test is available in the one-way ANOVA calculator. This worksheet reports pairwise comparisons and does not establish whether the model assumptions hold.

Common questions

How do I enter data for a Tukey HSD test?
Enter one group per line. You can begin each line with a name and a colon, such as A: 1, 2, 3. Separate observations within a group with commas, spaces or tabs. Use decimal points and omit thousands separators. Every group needs at least 2 values, with 2 to 20 groups and no more than 10,000 observations in total. Then select a family alpha and compare all pairs.
What changes when the groups have unequal sample sizes?
The worksheet uses Tukey-Kramer. Each pair has its own standard error: the square root of MSE × (1/ni + 1/nj) / 2. The studentized-range distribution still uses the total number of groups and the pooled error degrees of freedom. With equal group sizes, this reduces to Tukey HSD.
What do the adjusted p-values and simultaneous intervals mean?
The adjusted p-value is the upper-tail probability from the studentized-range distribution for that pair's q statistic, accounting for all pairs in the group family. Choosing alpha 0.05 gives 95% simultaneous intervals; alpha 0.01 gives 99% intervals. An interval that excludes zero is marked significant at the selected family alpha. Probabilities below 1e-10 are displayed as a bound.
Which direction is the mean difference?
Every difference is the first named group mean minus the second. A negative difference means the first mean is smaller. Reversing a pair changes the sign of its difference and reverses the interval endpoints, while leaving q and the adjusted p-value unchanged.
Why are my Tukey results undefined when MSE is zero?
A pooled MSE of zero means there is no observed within-group variation. The standard error for every pair is then zero, so this worksheet marks q, adjusted p-values and simultaneous intervals as undefined. It still shows group summaries and signed mean differences.
Does this calculator also run the omnibus ANOVA?
This worksheet computes pairwise Tukey comparisons. The omnibus F test is provided separately by the linked one-way ANOVA calculator. Neither the pairwise results nor the input checks verify independence, approximately normal errors or a common population variance.
Can I copy or export the full comparison results?
Copy report includes the method, group summaries, pooled MSE, error degrees of freedom, every comparison and the assumptions. Export CSV includes unrounded numeric estimates and preserves small p-values as bounds. Computation and file preparation happen in your browser.

Tukey HSD assumes independent, approximately normal errors with a common population variance; unequal group sizes use Tukey-Kramer. Studentized-range probabilities and simultaneous intervals are numerical estimates, with p-values below 1e-10 shown as a bound. This worksheet does not verify assumptions or choose a test.