Two-way ANOVA calculator

Test two factors at once, for example fertiliser and watering, or teaching method and class size. Type the values of each cell of the design and get the two-way ANOVA table with the main effects, the interaction and partial eta squared.

One row per level of factor A, rows separated by semicolons; cells (levels of factor B) separated by |; values in a cell by spaces or commas. Every cell needs the same number of values.
Between 0 and 1, usually 0.05.
p, factor A (rows)4.4e-8
p, factor B (columns)7.45e-9
p, interaction A × B0.001953
Factor A at α
p < α: significant effect
Factor B at α
p < α: significant effect
Interaction at α
p < α: significant effect
Factor A
SS = 54 df = 1 MS = 54 F = 81 p = 4.4e-8
Factor B
SS = 84 df = 2 MS = 42 F = 63 p = 7.45e-9
Interaction A × B
SS = 12 df = 2 MS = 6 F = 9 p = 0.001953
Error (within cells)
SS = 12 df = 18 MS = 0.666667
Total
SS = 162 df = 23
Partial η², factor A
0.818182
Partial η², factor B
0.875
Partial η², interaction
0.5
Cell means (rows A, columns B)
A1: 5 8 11 A2: 3 6 6
Design (A levels × B levels × values per cell)
2 × 3 × 4

Several values per cell, so the interaction is tested against the variation within cells.

Runs in your browser: nothing you enter is sent anywhere.

How to use it

Type one row per level of factor A, with the cells for the levels of factor B separated by |:

4 5 6 5 | 7 9 8 8 | 10 12 11 11; 3 4 3 2 | 6 5 7 6 | 6 7 5 6

is 2 levels of A × 3 levels of B with 4 values per cell. Read the p-values at the top and the full table below.

Formulas

For a levels of A, b levels of B and r values per cell, with grand mean G, row means Āᵢ, column means B̄ⱼ and cell means x̄ᵢⱼ:

  • SS_A = b·r·Σ(Āᵢ − G)², df a − 1
  • SS_B = a·r·Σ(B̄ⱼ − G)², df b − 1
  • SS_AB = r·Σ(x̄ᵢⱼ − G)² − SS_A − SS_B, df (a − 1)(b − 1)
  • SS_E = Σ(x − x̄ᵢⱼ)², df ab(r − 1)

Each MS = SS/df, F = MS/MS_E, and p is the upper tail of the F distribution. Partial η² = SS/(SS + SS_E).

Worked example

A 2 × 2 design with two values per cell: 1 3 | 5 7; 2 4 | 10 12. The cell means are 2, 6 (row A1) and 3, 11 (row A2), G = 5.5, the row means 4 and 7 and the column means 2.5 and 8.5.

  • SS_A = 2·2·(1.5² + 1.5²) = 18, SS_B = 2·2·(3² + 3²) = 72
  • SS_cells = 2·(3.5² + 0.5² + 2.5² + 5.5²) = 98, so SS_AB = 98 − 18 − 72 = 8
  • SS_E = 8 (each value is 1 away from its cell mean), df 4, MS_E = 2

F_A = 18/2 = 9 (p = 0.03994), F_B = 72/2 = 36 (p = 0.003883), F_AB = 8/2 = 4 (p = 0.1161). At α = 0.05 both factors are significant and the interaction is not.

Tips and common mistakes

  • Keep the cells in the same order of B levels in every row.
  • ANOVA assumes independent observations, roughly normal residuals and similar variances in all cells.
  • A significant factor with more than two levels tells you that the means differ, not which ones; follow up with pairwise comparisons and a multiple-testing correction.

Frequently asked questions

What does a two-way ANOVA test?

Three null hypotheses: factor A has no effect, factor B has no effect, and there is no interaction, meaning the effect of A is the same at every level of B. Each gets its own F and p-value.

What is an interaction?

When the effect of one factor depends on the other. In a plot of cell means the lines are not parallel. With a significant interaction, interpret the main effects with care.

What if I have only one value per cell?

Then the within-cell error cannot be estimated, and the interaction is used as the error term (two-way ANOVA without replication). Only the main effects are tested.

Why must the design be balanced?

With equal cell sizes the sums of squares split cleanly into A, B, interaction and error. Unequal sizes need type II or III sums of squares from a regression model, which this calculator does not do.

More in Math

All tools in this category: Math ·Updated November 4, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.