Two-Way ANOVA Calculator

Two-Way ANOVA Calculator

Test two factors at once — and their interaction. Paste each cell’s scores as a comma-separated list and get the full ANOVA table, effect sizes and an interaction plot.

ANOVA

One score per value, separated by commas or spaces. Cell sizes may differ — the calculator uses Type III sums of squares, so every effect is tested after allowing for the others. With unequal cell sizes the effect sums of squares do not add up to the total.

ANOVA table

Cell means

Interaction plot — cell means

Lines that are not parallel signal an interaction: the effect of factor A changes across the levels of factor B. Crossing lines mean the effect reverses.

Calculation

    Before you trust the table

    • Scores are independent — no person or plot appears in more than one cell.
    • Scores are roughly normal within each cell (check with a histogram or a normality plot).
    • Spread is similar across cells — Levene’s test checks this formally.
    • No extreme outliers are driving a cell mean.

    A two-way ANOVA tests two factors at once — for example teaching method and class size — and, crucially, whether they interact. Enter your data as a table and this calculator returns the full ANOVA table: sums of squares, degrees of freedom, F statistics, p-values and effect sizes for factor A, factor B and the A×B interaction.

    How to use the two-way ANOVA calculator

    1. Choose the number of levels for factor A and factor B (2–4 each).
    2. Name the levels, then paste each cell’s scores into the grid — one value per score, separated by commas or spaces. Cell sizes can differ.
    3. Pick a significance level α (usually 0.05) and click Calculate.
    4. Read the headline interaction result first, then the ANOVA table, the cell-means table and the interaction plot.

    Try it now: load Example 1 (teaching method × class size) and you will get F(1, 16) = 32.40 for the interaction, p < 0.0001, and η² = 0.1244.

    What is a two-way ANOVA?

    A two-way ANOVA (two-factor ANOVA) tests two categorical independent variables — the factors — against one continuous outcome, in a single analysis. It answers three questions at once: does factor A matter, does factor B matter, and does the effect of one factor depend on the level of the other? That last question is the interaction, and it is the reason to run a two-way ANOVA instead of two one-way ANOVAs.

    The method partitions the total variability in the scores:

    SStotal = SSA + SSB + SSA×B + SSerror (with equal cell sizes)

    Each effect is tested with an F ratio: F = MSeffect / MSerror, where MS = SS / df. The p-value comes from the F-distribution with the effect’s and the error’s degrees of freedom.

    Effect size is reported as eta-squared (η² = SSeffect / SStotal) and partial eta-squared (partial η² = SSeffect / (SSeffect + SSerror)). Roughly, η² of 0.01 is small, 0.06 is medium and 0.14 is large. Partial η² is the figure most papers report, because it is the share of variance the effect explains once the error is taken out — it is always at least as large as η².

    When should you use a two-way ANOVA?

    • You have two categorical factors and one continuous outcome — for example teaching method (A or B) and class size (small or large) against exam score.
    • Every observation sits in exactly one cell of the design, and observations are independent of one another.
    • Scores are approximately normal within each cell (with small samples, check a histogram or a normality plot).
    • Spread is similar across cells — homogeneity of variance. Levene’s test is the usual formal check.
    • Each cell has at least two scores, so the error degrees of freedom are at least 1.

    If you have only one factor, use a one-way ANOVA calculator instead. If the outcome is a count in categories rather than a score, a chi-square test is the right tool.

    How to read the ANOVA table — interaction first

    Read the table from the interaction row up, not from the top down:

    1. Interaction (A × B) first. If it is significant, the effect of factor A changes across the levels of factor B. The two main effects then describe averages that no real group shows, so do not quote them on their own — compare cell means instead, and follow up with simple effects or a post-hoc test such as Tukey HSD within each level.
    2. Main effects second. If the interaction is not significant, each main effect can be read directly: a significant factor A means the row means differ; a significant factor B means the column means differ.
    3. Effect sizes third. A tiny p-value with a tiny η² is a small effect that happened to be measured precisely. Report η² (or partial η²) beside every F, and let the size — not the p-value — carry the practical conclusion.
    4. Check the plot. In the interaction plot, parallel lines mean no interaction; lines that fan apart or cross mean the effect of A depends on B.

    Worked examples

    Example 1 — teaching method × class size (significant interaction)

    Twenty students are taught by method A or method B, in small or large classes (n = 5 per cell). Scores: Method A / Small [78, 82, 76, 80, 79], Method A / Large [70, 74, 71, 73, 72], Method B / Small [85, 83, 86, 82, 84], Method B / Large [66, 69, 67, 70, 68]. The grand mean is 75.75; cell means are 79, 72, 84 and 68.

    SourceSSdfMSFpη²Partial η²
    Method (A)1.2511.250.400.53600.00150.0244
    Class size (B)661.251661.25211.60< 0.00010.81260.9297
    A × B101.251101.2532.40< 0.00010.12440.6694
    Error50.00163.125————
    Total813.7519—————

    SS check: 1.25 + 661.25 + 101.25 + 50.00 = 813.75. Class size matters hugely (η² = 0.8126), and the interaction is significant — the method effect reverses with class size. Method B wins in small classes (84 vs 79) but loses in large ones (68 vs 72), so the non-significant main effect of method (p = 0.5360) must not be read on its own.

    Example 2 — fertiliser × light (both main effects large, interaction small)

    Twenty-four plants are grown with fertiliser A or B under low, medium or high light (n = 4 per cell). Cell means: A–Low 13, A–Med 19, A–High 23; B–Low 17, B–Med 25, B–High 31. The grand mean is 21.3333.

    SourceSSdfMSFpη²
    Fertiliser (A)2161216324< 0.00010.2617
    Light (B)581.33332290.6667436< 0.00010.7044
    A × B1628120.00050.0194
    Error12180.6667———
    Total825.333323————

    Both main effects are large, and the interaction is significant but small (η² = 0.0194): fertiliser B helps more under high light, but the ranking never reverses — B beats A at every light level, so here the main effects can still be reported, with the interaction noted as a difference in size rather than direction.

    How to report a two-way ANOVA in APA style

    Report each effect as F(dfeffect, dferror) = value, p = value, η² = value. Give p-values to three decimals in APA style, writing p < .001 for anything below that (the calculator shows p < 0.0001, which is the same statement). State the interaction first when it is significant, and give the cell means that explain it.

    Copy-ready sentence (Example 1): “A two-way ANOVA revealed a significant main effect of class size, F(1, 16) = 211.60, p < .001, η² = .81, and a significant teaching method × class size interaction, F(1, 16) = 32.40, p < .001, η² = .12. The main effect of teaching method was not significant, F(1, 16) = 0.40, p = .536, η² < .01.”

    Cite this tool

    Shafiq, A. (2026). Two-way ANOVA calculator. Empirical Rule Calculators. https://empiricalrulecalculators.com/two-way-anova-calculator/

    Frequently asked questions

    What is the interaction in a two-way ANOVA?

    The interaction (A × B) asks whether the effect of one factor depends on the level of the other. In Example 1, method B is better in small classes but worse in large ones — the lines on the interaction plot cross. A significant interaction means you cannot describe either factor with a single overall effect; report the cell means instead.

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

    Use a one-way ANOVA when you have a single factor. Use a two-way ANOVA when you have two factors and want to test both — plus their interaction — in one analysis. Running two separate one-way ANOVAs cannot detect an interaction and splits your error term, so it is both weaker and easier to misread.

    What do I do if the interaction is significant?

    Do not interpret the main effects on their own. Compare the cell means (or run simple-effects tests), look at the interaction plot, and follow up with a post-hoc test such as Tukey HSD within each level of one factor. Report which combinations differ, not just that “the interaction was significant”.

    What if my cell sizes are unequal?

    The calculator uses Type III sums of squares, which test each effect after allowing for the others, so unequal cell sizes are handled correctly. Two things to note: with unequal n the effect sums of squares do not add up to the total, and very unbalanced cells make the interaction harder to detect — collect balanced data when you can.

    What is the difference between eta-squared and partial eta-squared?

    Eta-squared (η² = SSeffect / SStotal) is the share of all the variation in the data that an effect explains. Partial eta-squared (partial η² = SSeffect / (SSeffect + SSerror)) is the share of the variation left after the error is removed, so it is always at least as large. Both are shown in the table; most journal articles report partial eta-squared.

    How do I report a two-way ANOVA in APA style?

    Give each effect as F(dfeffect, dferror) = value, p = value, η² = value — for example, “a significant interaction, F(1, 16) = 32.40, p < .001, η² = .12”. Report the interaction first when it is significant, and give the cell means that show what the interaction looks like.

    Source: the sums-of-squares decomposition and the two-way ANOVA formulas on this page follow the NIST/SEMATECH e-Handbook of Statistical Methods, 7.4.3.7. The two-way ANOVA. All examples on this page were checked against that reference.

    See all 106 free statistics tools on Empirical Rule Calculators.

    Next steps

    One-Way ANOVA Calculator

    Have only one factor? Test a single categorical variable against a continuous outcome.

    ● LiveANOVA
    Try Calculator →

    F-Distribution Calculator

    Look up F critical values and p-values for any degrees of freedom.

    ● LiveProbability
    Try Calculator →

    Eta-Squared Calculator

    Turn any ANOVA result into an effect size with eta-squared and partial eta-squared.

    ● LiveConfidence & Error
    Try Calculator →

    More Tools to Explore

    Keep going with the calculators that pair with the two-way ANOVA — one-way ANOVA, the F-distribution, effect sizes and p-values.

    One-Way ANOVA Calculator

    Have only one factor? Test a single categorical variable against a continuous outcome.

    ● LiveANOVA
    Try Calculator →

    F-Distribution Calculator

    Look up F critical values and p-values for any degrees of freedom.

    ● LiveProbability
    Try Calculator →

    Eta-Squared Calculator

    Turn any ANOVA result into an effect size with eta-squared and partial eta-squared.

    ● LiveConfidence & Error
    Try Calculator →

    Chi-Square Test Calculator

    Test counts in categories for independence or goodness of fit.

    ● LiveConfidence & Error
    Try Calculator →

    P-Value Calculator from Z-Score

    Turn a z-score into a p-value in one step.

    ● LiveProbability
    Try Calculator →

    T-Distribution Calculator

    Look up any area, p-value or critical t on the t-distribution for any degrees of freedom.

    ● LiveProbability
    Try Calculator →

    Explore All Tools →

    Browse all 106 free statistics tools — every calculator on this site in one place.