Skip to main content

ANOVA Calculator

Run a one-way ANOVA, two-way ANOVA, Tukey HSD post-hoc test, or find an F critical value — with a shaded F-distribution curve, group means bar chart, full ANOVA summary table, and complete step-by-step solutions.

Background

Analysis of Variance (ANOVA) tests whether the means of three or more groups are equal, extending the t-test beyond two groups. Rather than testing all possible pairs (which inflates the Type I error rate), ANOVA asks one omnibus question: is there any group that differs significantly from the others? It does this by comparing two estimates of variance — the variability between groups (which reflects both random error and any real group differences) and the variability within groups (which reflects only random error). If the between-group variance is much larger than the within-group variance, the F-statistic is large and the result is significant.

Run your ANOVA

Step 1 — Choose your analysis

Pick the test that matches your design.

Step 2 — Enter your data

Learning options

Result

No result yet. Enter your data above and click Calculate.

How to use this calculator

  • One-Way ANOVA: enter 3–6 groups of comma-separated values. The calculator computes the full ANOVA table with SS, df, MS, F, and p-value.
  • Two-Way ANOVA: enter data as a grid — one cell per combination of Factor A (rows) and Factor B (columns), with replicates per cell. Tests both main effects and the interaction.
  • Tukey HSD: run after a significant one-way ANOVA to find which specific group pairs differ. Enter group means, group sizes, and MSW from your ANOVA.
  • F Critical Value: enter df1, df2, and α to find the critical F value, or enter an F statistic to get the exact p-value.

How ANOVA works

The core idea. ANOVA partitions the total variability in your data into two parts: variability between groups (how much the group means differ from the grand mean) and variability within groups (how much individual observations differ from their own group mean).

The F-statistic. F = MS_between / MS_within. If H₀ is true (all group means are equal), both MS values estimate the same population variance, so F ≈ 1. A large F means between-group variability far exceeds within-group variability — evidence that group means truly differ.

Sums of squares. SS_between measures how much group means deviate from the grand mean, weighted by group size. SS_within measures how much individual observations deviate from their own group mean. SS_total = SS_between + SS_within.

Degrees of freedom. For k groups and N total observations: df_between = k − 1, df_within = N − k, df_total = N − 1.

Post-hoc tests. A significant ANOVA tells you that at least one group differs, but not which ones. The Tukey HSD (Honestly Significant Difference) test compares all pairs of groups while controlling the family-wise error rate.

Formulas Used

SS_between: Σ nᵢ(x̄ᵢ − x̄_grand)²

SS_within: Σᵢ Σⱼ (xᵢⱼ − x̄ᵢ)²

MS = SS / df

F = MS_between / MS_within

Tukey HSD: HSD = q × √(MSW / n), where q is the studentized range statistic

Two-Way SS_A: bn × Σ(ȳᵢ. − ȳ..)², SS_B: an × Σ(ȳ.ⱼ − ȳ..)², SS_AB: SS_total − SS_A − SS_B − SS_within

Fully Worked Example Problems

Example 1 — One-Way ANOVA step by step

Three fertilizers tested on plant height (cm).
Group A: 6, 8, 4, 5, 7  →  x̄A = 6.00
Group B: 10, 12, 11, 9, 13  →  x̄B = 11.00
Group C: 7, 8, 9, 8, 8  →  x̄C = 8.00

Step 1: Grand mean = (30 + 55 + 40) / 15 = 8.333

Step 2: SS_between
= 5(6−8.333)² + 5(11−8.333)² + 5(8−8.333)²
= 5(5.444) + 5(7.111) + 5(0.111) = 27.22 + 35.56 + 0.56 = 63.33

Step 3: SS_within
Group A: (6−6)²+(8−6)²+(4−6)²+(5−6)²+(7−6)² = 0+4+4+1+1 = 10
Group B: (10−11)²+…= 1+1+0+4+4 = 10   Group C: 1+0+1+0+0 = 2
SS_within = 10+10+2 = 22.00

Step 4: df_b=2, df_w=12 → MS_b=31.667, MS_w=1.833
F = 31.667 / 1.833 = 17.27, p = 0.0003 < 0.05 → Reject H₀

Example 2 — Tukey HSD step by step (from Example 1)

After the significant ANOVA above, find which pairs differ.
Given: k=3 groups, df_within=12, MSW=1.833, n=5 per group, α=0.05

Step 1: Find q_crit(α=0.05, k=3, df=12) = 3.773

Step 2: HSD = 3.773 × √(1.833/5) = 3.773 × 0.6055 = 2.285

Step 3: Compare each pair to HSD
A vs B: |6.00 − 11.00| = 5.00 > 2.285 → Significant ✓
A vs C: |6.00 − 8.00| = 2.00 < 2.285 → Not significant
B vs C: |11.00 − 8.00| = 3.00 > 2.285 → Significant ✓

Conclusion: Fertilizer B produces significantly more growth than both A and C. A and C do not differ significantly.

Example 3 — Two-Way ANOVA step by step

2×2 design: Factor A = diet type (A1, A2), Factor B = exercise (B1, B2), n=2 per cell.
A1B1: 8,10   A1B2: 14,16   A2B1: 12,14   A2B2: 18,20

Cell means: A1B1=9, A1B2=15, A2B1=13, A2B2=19
Row means: A1=12, A2=16   Col means: B1=11, B2=17   Grand mean: 14

SS_A = 2×2×[(12−14)² + (16−14)²] = 4×[4+4] = 32.00
SS_B = 2×2×[(11−14)² + (17−14)²] = 4×[9+9] = 72.00
SS_AB = 2×[(9−12−11+14)²+(15−12−17+14)²+(13−16−11+14)²+(19−16−17+14)²] = 0.00
SS_within = (8−9)²+(10−9)²+…= 8.00

F_A=32/2=16.00, F_B=72/2=36.00, F_AB=0/2=0.00 (df_within=4, MSW=2)
No interaction — both main effects are significant.

Example 4 — Reading the F-distribution

For the fertilizer ANOVA above: df₁=2, df₂=12, α=0.05.

Step 1: Find F_crit
From the F-table (or this calculator's F Critical Value mode): F_crit(2, 12, 0.05) = 3.885

Step 2: Apply the decision rule
Computed F = 17.27 > F_crit = 3.885 → Reject H₀
Equivalently: p = 0.0003 < α = 0.05 → same decision.

Step 3: Interpret
We have strong evidence (p=0.0003) that at least one fertilizer produces a different mean plant height. To find which ones, proceed to Tukey HSD (see Example 2).

Key insight: F_crit depends on both df values. Larger df_within (more data) → smaller F_crit → easier to detect real differences.

Frequently Asked Questions

What does a significant ANOVA tell me?

A significant F-test (p ≤ α) tells you that at least one group mean differs significantly from the others. It does not tell you which groups differ — for that, you need a post-hoc test like Tukey HSD.

What are the assumptions of one-way ANOVA?

Independence of observations, normality within each group (or large enough sample sizes by CLT), and homogeneity of variances across groups (roughly equal standard deviations). ANOVA is fairly robust to mild violations of normality when group sizes are equal.

What is MSW (mean square within)?

MSW (also called MSE, mean square error) is the pooled estimate of within-group variance. It represents the average variability within groups and serves as the denominator of the F-statistic — the baseline measure of "noise" against which between-group differences are judged.

When should I use two-way instead of one-way ANOVA?

Use two-way ANOVA when you have two categorical independent variables (factors) and want to test their individual effects and whether they interact. For example, studying both diet type and exercise level simultaneously lets you test whether the combination of diet and exercise produces effects beyond what either does alone.

What is the difference between SS_between and SS_within?

SS_between measures how much the group means vary around the grand mean — it captures the signal (real group differences if any). SS_within measures how much individual scores vary around their own group mean — it captures only noise (random error). The F-statistic is the ratio of these, so a large F means the signal is large relative to the noise.

Why does Tukey HSD use the studentized range distribution?

The studentized range statistic q accounts for the fact that when comparing all possible pairs, the largest difference is expected to be inflated by chance. Using q instead of t controls the family-wise error rate — meaning the probability of making at least one false positive across all pairwise comparisons stays at α.

Steps in Hypothesis Testing
9. Hypothesis Testing for One Sample
7 problems
Topic
Ally
Two Means - Unknown, Unequal Variance
10. Hypothesis Testing for Two Samples
3 problems
Topic
Justin
Multiple Comparisons: Tukey Test
14. ANOVA
5 problems
Topic
9. Hypothesis Testing for One Sample
1 topic 3 problems
Chapter
David-Paige
10. Hypothesis Testing for Two Samples
3 topics 6 problems
Chapter
Brendan
14. ANOVA
1 topic 3 problems
Chapter
Traits and Variance
20. Quantitative Genetics
7 problems
Topic
Kylia
Analyzing Trait Variance
20. Quantitative Genetics
7 problems
Topic
Kylia
Heritability
20. Quantitative Genetics
7 problems
Topic
Kylia
20. Quantitative Genetics
5 topics 14 problems
Chapter
Nicole
Analysis of Variance (f-Test)
4 & 5. Statistics, Quality Assurance and Calibration Methods
5 problems
Topic
The Gaussian Distribution
4 & 5. Statistics, Quality Assurance and Calibration Methods
5 problems
Topic
Mean Evaluation
4 & 5. Statistics, Quality Assurance and Calibration Methods
5 problems
Topic
4 & 5. Statistics, Quality Assurance and Calibration Methods - Part 1 of 2
4 topics 12 problems
Chapter
4 & 5. Statistics, Quality Assurance and Calibration Methods - Part 2 of 2
2 topics 6 problems
Chapter
Steps in Hypothesis Testing
9. Hypothesis Testing for One Sample
10 problems
Topic
Ernest
Performing Hypothesis Tests: Means
9. Hypothesis Testing for One Sample
10 problems
Topic
Laura
Two Means - Unknown, Unequal Variance
10. Hypothesis Testing for Two Samples
10 problems
Topic
Ally
Introduction to ANOVA
14. ANOVA
10 problems
Topic
Ally
9. Hypothesis Testing for One Sample
3 topics 15 problems
Chapter
Brendan
10. Hypothesis Testing for Two Samples
3 topics 15 problems
Chapter
Ally
14. ANOVA
1 topic 15 problems
Chapter
Ally
Probability Distribution Calculator
Calculate probabilities for normal, binomial, Poisson, t, chi-square, F, and other common distributions
Heritability & Quantitative Genetics Calculator
Calculate heritability (H², h²), breeder’s equation, and selection response
Critical Value Calculator
Find critical values for Z, t, χ², or F distributions using α and tail type
Degrees of Freedom Calculator
Calculate degrees of freedom for t-tests, χ², ANOVA, F, and regression
Z-Score Calculator
Calculate z-scores, percentiles, and reverse-solve x, μ, or σ
Chi-Square Calculator
Run chi-square goodness-of-fit and independence tests - with distribution curves and step-by-step solutions
Mean Median Mode Calculator
Calculate mean, median, and mode from a list of numbers or a frequency table
Confidence Interval Calculator
Calculate confidence intervals for means, proportions, or raw data inputs
P-Value Calculator
Compute p-values from Z, t, χ², or F test statistics with one- or two-tailed options
Statistics & Data Analysis Lab
Upload datasets, analyze statistics visually, run hypothesis tests, and interpret results with interactive charts
Normal Distribution Calculator
Calculate normal distribution probabilities, z-scores, percentiles, and shaded bell-curve areas
Standard Deviation Calculator
Calculate standard deviation, variance, and mean from data
Hypothesis Testing Calculator
Perform hypothesis tests with p-values, critical values, effect sizes, and visual step-by-step solutions
Standard Error Calculator
Calculate standard error for mean, proportion, or raw data inputs
Back to all calculatorsAll calculators