Percentages and Math

Two-Way ANOVA Calculator

Paste one measurement per line with its two factor levels to test both factors and their interaction.

Your numbers

One measurement per line as "level of A, level of B, value". Every combination needs the same number of values, at least 2. Example data.

Result

p value for the A x B interaction

0.0008

F(1, 8) = 27.7056.

p value, factor A
0.0006
p value, factor B
0.6451
p value, interaction
0.0008
F, factor A
29.1636
F, factor B
0.2290
F, interaction
27.7056
Levels of A and B
2 and 2
Values per cell
3
Grand mean
6.0583

Analysis of variance

SourceSum of squaresdfMean squareFpEta squared
Factor A5.200815.200829.16360.00060.4480
Factor B0.040810.04080.22900.64510.0035
A x B interaction4.940814.940827.70560.00080.4256
Error (within cells)1.426780.17830.1229
Total11.6092111.0554

Cell means

XYRow mean
Low4.76.15.4
High7.36.13336.7167
Column mean66.11676.0583
How this was calculated
  1. The 12 values sit in 4 cells of 3 each. The total sum of squares 11.6092 splits into A 5.2008, B 0.0408, A x B 4.9408 and error 1.4267.
  2. Error mean square = 1.4267 / 8 = 0.1783.
  3. Each F is a mean square divided by the error mean square, for example A: 5.2008 / 0.1783 = 29.1636.
  4. The p values come from the F distribution with the degrees of freedom shown.
  • When the interaction is large, the effect of one factor depends on the level of the other, so the main effect p values are hard to read on their own. Compare the cell means. The calculation assumes equal cell sizes, independent values and similar spread in every cell.

Calculated using SumPanda.com · https://sumpanda.com/two-way-anova-calculator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the two-way anova calculator

  1. Enter one measurement per line as level of A, level of B, value, separated by commas.
  2. Make sure every combination of levels has the same number of values, at least 2.
  3. Read the p value of the interaction first, then the p values for factor A and factor B.
  4. Use the cell means table to see which combinations drive the result.

Formula

SS(A) = b r x sum of (mean of A level - grand mean)^2

SS(B) = a r x sum of (mean of B level - grand mean)^2

SS(AB) = r x sum of (cell mean - A mean - B mean + grand mean)^2

SS(error) = sum of (value - its cell mean)^2

F = mean square / MSE, with df: A a - 1, B b - 1, AB (a - 1)(b - 1), error a b (r - 1)

a and b are the numbers of levels and r the values per cell. p values come from the F distribution. Eta squared is each sum of squares divided by the total.

Two factors with three measurements per cell

Factor A has levels Low and High, factor B has levels X and Y, and each cell holds 3 values. Cell means are Low/X 4.7, Low/Y 6.1, High/X 7.3 and High/Y 6.1333. The grand mean is 6.0583.

The sums of squares are A 5.2008, B 0.0408, interaction 4.9408 and error 1.4267 with 8 degrees of freedom, so MSE = 0.1783. The F ratios are 29.1636 for A (p = 0.0006), 0.2290 for B (p = 0.6451) and 27.7056 for the interaction (p = 0.0008).

Reading an interaction

A two-way ANOVA splits the variation in the data into what comes from factor A, from factor B, from their combination and from random scatter inside the cells. The interaction asks whether the effect of one factor depends on the level of the other. In the example, B hardly matters on average, yet the interaction is large: Y raises the value at Low but not at High.

When the interaction is clear, the main effects can be misleading on their own, so compare the cell means. Plotting the cell means with one line per level of A makes the pattern visible: lines that cross or fan out indicate an interaction.

Balanced designs only

This page requires the same number of values in every cell. That keeps the three effects separate, so the order in which effects are tested does not change the answer. If your cells have unequal sizes, software must choose a type of sum of squares, and that choice changes the results, so unbalanced data are rejected here instead of being handled silently.

For a single factor use the one-way ANOVA. For ranked data with several groups see the Kruskal-Wallis test. To follow a significant result with a plan for several comparisons, the multiple comparison p adjuster helps.

Assumptions and limits

  • Values in a cell are independent, and each measurement appears on one line only.
  • Within every cell the values are roughly bell shaped, and the spread is similar across cells.
  • The design is balanced: equal values per cell, with at least 2 per cell and every combination present.
  • Factor levels are fixed choices, not random draws; mixed or random-effects models are not covered.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

Why does the page refuse unequal cell sizes?

With unequal cells the effects overlap, and different software defaults give different sums of squares. Rather than pick one without telling you, the page asks for a balanced table where the answer is unambiguous.

What if the interaction is significant but a main effect is not?

It means the factor has opposite or unequal effects at different levels of the other factor that cancel out on average, as with factor B in the example. Look at the cell means and discuss the effect level by level.

What does eta squared show here?

It is each effect's sum of squares divided by the total sum of squares, so it is the share of all variation attributed to that effect in this sample. The shares for A, B, the interaction and error add up to 1.

How many values per cell do I need?

At least 2, so the error can be estimated. More values per cell make the F tests more sensitive; with only 2 the error has few degrees of freedom and the p values are rough guides.