ANOVA Calculator

Run a one-way analysis of variance (ANOVA) to test whether three or more groups have significantly different means. Enter your groups below, and see the formula, a worked example, and ready-to-use Python code underneath.

Enter your groups

One number per line or comma-separated, within each group. Add up to 8 groups.

Please enter at least 2 values in each of at least 2 groups.

F-statistic
df (between, within)
P-value
Decision at chosen α

What ANOVA tells you

One-way ANOVA (analysis of variance) tests whether the means of three or more groups are significantly different from each other, using a single test instead of many pairwise comparisons. It works by comparing how much variation exists between the group means to how much variation exists within each group.

If between-group variation is large relative to within-group variation, that suggests the groups don't all share the same underlying mean. A significant ANOVA result tells you that at least one group differs — it doesn't identify which one, which is what a post-hoc test like Tukey's HSD is for.

ANOVA formula

F = MS_between / MS_within
MS_between = SS_between / (k − 1),  MS_within = SS_within / (N − k)
k is the number of groups, N is the total number of observations across all groups, SS_between is the sum of squares between groups, and SS_within is the sum of squares within groups. df_between = k − 1, df_within = N − k.

Python code

SciPy runs one-way ANOVA directly from the raw groups:

# SciPy
from scipy.stats import f_oneway

group_a = [5, 6, 7, 5, 6]
group_b = [8, 9, 7, 8, 9]
group_c = [6, 5, 6, 7, 5]

f_stat, p_value = f_oneway(group_a, group_b, group_c)
print(f_stat, p_value)  # 13.7143 0.000795

Worked example

A researcher measures plant growth (cm) under three fertilizers. Is there a significant difference in mean growth, at α = 0.05?

Fertilizer AFertilizer BFertilizer C
586
695
776
587
695
  1. 1
    Compute the grand mean and each group's mean.
    Grand mean = 6.6. Group means: A = 5.8, B = 8.2, C = 5.8
  2. 2
    Compute SS between and SS within.
    SS_between = 19.2, SS_within = 8.4
  3. 3
    Compute mean squares.
    df_between = 2, df_within = 12  →  MS_between = 9.6, MS_within = 0.7
  4. 4
    Compute F and the p-value.
    F = 9.6 / 0.7 = 13.7143  →  p = 0.0008

Since p = 0.0008 is well below α = 0.05, we reject the null hypothesis — at least one fertilizer produces a significantly different mean growth than the others.

Frequently asked questions

What does ANOVA test, and why not just run several t-tests?

ANOVA tests whether at least one group mean differs from the others across three or more groups, in a single test. Running many pairwise t-tests instead inflates the overall false-positive rate, since each individual test carries its own chance of a false alarm — ANOVA avoids that by testing all groups together.

What does a significant ANOVA result actually tell me?

A significant result means at least one group mean is likely different from the others, but it doesn't say which group (or groups) differ. Identifying which specific pairs differ requires a follow-up post-hoc test, such as Tukey's HSD test.

What are the assumptions behind one-way ANOVA?

One-way ANOVA assumes each group is approximately normally distributed, the groups have roughly equal variances, and observations are independent of one another. ANOVA is reasonably tolerant of mild departures from normality, especially with similar group sizes, but is more sensitive to unequal variances.

What is the difference between SS between and SS within?

SS between (sum of squares between groups) measures how much the group means vary around the overall grand mean. SS within (sum of squares within groups) measures how much individual observations vary around their own group's mean. ANOVA compares these two sources of variation.

Can I use ANOVA with only two groups?

Yes — with exactly two groups, one-way ANOVA is mathematically equivalent to an independent two-sample t-test (assuming equal variances), and gives the same p-value. ANOVA becomes necessary once you have three or more groups to compare at once.

Advertisement