ANOVA Calculator (One-Way)
A one-way ANOVA tells you whether three or more groups have genuinely different averages, or whether the gaps you see are just random noise. How the test works, how to read your results, and three worked examples follow.
What does a one-way ANOVA test actually do?
It compares the means of three or more independent groups in a single test. If p is 0.05 or less, at least one group mean is different from the others. If p is above 0.05, you do not have strong evidence that the groups differ.
The reason you use ANOVA instead of running several t-tests is error control. Every extra t-test raises your chance of a false positive. ANOVA checks all groups together in one shot, so that risk stays fixed.
The test works by splitting the total variation in your data into two parts. One part is the variation between the group means. The other is the variation within each group. When the between-group variation is large compared to the within-group variation, the F statistic climbs and the p-value drops. That is your signal that the groups are not the same.
How do you read the F statistic and p-value?
Your results come down to two numbers.
- The F statistic is the ratio of between-group variation to within-group variation. A larger F means the group means sit further apart relative to the spread inside each group. An F near 1 means the groups look about the same.
- The p-value translates that F into a probability. It answers one question: if every group really had the same mean, how likely is an F this large by pure chance? A small p-value means "very unlikely," so you reject the idea that the means are equal.
The standard cutoff is 0.05:
- p ≤ 0.05 → reject the null hypothesis. At least one group mean is different.
- p > 0.05 → fail to reject the null hypothesis. No strong evidence of a difference.
One important limit: ANOVA tells you that a difference exists, not which groups differ. To pinpoint the specific pairs, you run a post-hoc test such as Tukey or Bonferroni after a significant result. If p is above 0.05, you stop there. There is nothing to chase.
How to read the ANOVA summary table
Every ANOVA result is reported as a table with three rows and six columns. Once you know what each cell means, you can read any ANOVA output.
| Column | What it means |
|---|---|
| Source | Where the variation comes from: Between Groups, Within Groups, or Total. |
| DF | Degrees of freedom. Between = k − 1, Within = N − k, Total = N − 1. |
| SS | Sum of squares. The raw amount of variation for that source. |
| MS | Mean square. SS divided by its DF, an average amount of variation. |
| F | The test statistic: MS Between divided by MS Within. |
| P-Value | The probability of seeing this F if all group means were equal. |
Here k is the number of groups and N is the total number of values across all groups. The "fill in the ANOVA table" problems you see in homework are just asking you to compute these cells one at a time. Our degrees of freedom calculator handles the DF column on its own if you need it separately.
The one-way ANOVA formulas
Six formulas turn your raw data into an F statistic. The calculator runs all of them, but here they are so you can follow the working.
Sum of squares between groups (SSB)
This measures how far each group mean sits from the overall mean.
SSB = Σ ni (x̄i − x̄)²
where ni is the size of each group, x̄i is each group mean, and x̄ is the grand mean of all values. A bigger SSB means the group means are further apart.
Sum of squares within groups (SSW)
This measures the spread inside each group, pooled together.
SSW = Σ (ni − 1) si²
where si² is the variance of each group. A smaller SSW means values sit close to their own group mean. You can check any single group's spread with the variance calculator.
Total sum of squares (SST)
SST = SSB + SSW
This is the total variation in the whole dataset. It always equals the between part plus the within part.
Mean squares (MSB and MSW)
Each sum of squares is divided by its degrees of freedom to get an average.
MSB = SSB / (k − 1)
MSW = SSW / (N − k)
where k is the number of groups and N is the total sample size.
The F statistic
F = MSB / MSW
This is the final ratio. The calculator then converts F, together with the two degrees of freedom, into the p-value.
Worked example: three groups, step by step
Take three groups of five values each. These are the calculator's default numbers, so you can follow along:
- Group 1: 5, 1, 11, 2, 8
- Group 2: 0, 1, 4, 6, 3
- Group 3: 13, 9, 8, 15, 7
The group means are 5.4, 2.8, and 10.4. The grand mean of all 15 values is 6.2.
- Step 1, SSB: 5(5.4 − 6.2)² + 5(2.8 − 6.2)² + 5(10.4 − 6.2)² = 149.2
- Step 2, SSW: pooling each group's variance gives 139.2
- Step 3, SST: 149.2 + 139.2 = 288.4
- Step 4, MSB: 149.2 / (3 − 1) = 74.6
- Step 5, MSW: 139.2 / (15 − 3) = 11.6
- Step 6, F: 74.6 / 11.6 = 6.431
With degrees of freedom 2 and 12, the p-value is 0.0126. Since 0.0126 is below 0.05, the result is significant. At least one group mean is different. Those two numbers are counted differently. The 2 is the number of groups minus one, the 12 is the total values minus the number of groups, and swapping between-group and within-group degrees of freedom moves the F cutoff far enough to reverse the verdict.
Worked example: clean numbers you can check by hand
Here is a smaller set that gives round numbers, useful for checking your own working.
- Group A: 8, 9, 10
- Group B: 6, 7, 8
- Group C: 10, 11, 12
Means are 9, 7, and 11. Grand mean is 9.
SSB = 3(9−9)² + 3(7−9)² + 3(11−9)² = 0 + 12 + 12 = 24
SSW = each group has variance 1, so (2)(1) × 3 groups = 6
SST = 24 + 6 = 30
MSB = 24 / 2 = 12
MSW = 6 / 6 = 1
F = 12 / 1 = 12
With df 2 and 6, the p-value is 0.0080. Significant, so the three groups differ.
Worked example: comparing test scores across three classes
A common real setup. Three teaching methods, three students each, scored out of 100.
- Method 1: 85, 90, 88
- Method 2: 78, 82, 80
- Method 3: 92, 95, 91
Means are 87.67, 80, and 92.67. The between-group spread is large and the within-group spread is small, which points to a strong result.
SSB = 244.22, SSW = 29.33, SST = 273.56
MSB = 244.22 / 2 = 122.11, MSW = 29.33 / 6 = 4.89
F = 122.11 / 4.89 = 24.977
With df 2 and 6, the p-value is 0.0012. Strongly significant. The teaching methods produce different average scores. A post-hoc test would then show Method 3 as the top performer.
What assumptions does ANOVA need?
Before you trust an ANOVA result, three conditions should hold.
- Independence. Each value must be unrelated to the others. One measurement should not affect another. This is usually about how you collected the data.
- Normality. The values in each group should be roughly normally distributed. ANOVA copes well with mild departures, but heavy skew in small samples can distort the p-value.
- Equal variances. The groups should have similar spread, sometimes called homogeneity of variance. If one group is far more scattered than the others, the standard test can mislead. In that case a Welch's ANOVA is the safer choice, since it does not assume equal variances.
One-way vs two-way ANOVA: which do you need?
A one-way ANOVA, which is what this calculator runs, tests one factor. For example, "does fertilizer type affect plant height?" You have one grouping variable with three or more levels.
A two-way ANOVA tests two factors at once and their interaction, for example fertilizer type and sunlight level together. If your data has two separate grouping variables, one-way is not the right tool for that design. A problem that asks you to compare group means on a single factor is a one-way test, which is what this calculator runs.
When should you use this calculator?
Reach for one-way ANOVA when you have three or more groups, numerical data, and a single factor separating them. Two groups only? A t-test is simpler and answers the same question. Comparing categories rather than means? A chi-square test fits better. For everything in between, with three or more numeric groups and one factor, this is the test.
After a significant result, run a post-hoc comparison to find which groups differ, then report the effect size so readers can see the size of the difference.
Frequently Asked Questions (FAQs)
What do you do after a significant ANOVA result?
Run a post-hoc test to find which pairs actually differ. Tukey HSD is the usual choice when the groups are the same size: compare each pair of means against q × √(MSW / n), where q comes from a studentized range table for k groups and N − k degrees of freedom. With unequal group sizes use Tukey-Kramer instead. Bonferroni is stricter and works for a small number of planned comparisons.
How do you run a one-way ANOVA in Excel or Google Sheets?
In Excel, turn on the Analysis ToolPak under File, Options, Add-ins, then use Data, Data Analysis, Anova: Single Factor. Point it at your columns and it returns the full table. Google Sheets has no built-in ANOVA tool, so you calculate SSB, SSW, MSB and MSW in cells, divide to get F, and finish with =F.DIST.RT(F, df1, df2).
How do you find the p-value from an F statistic by hand?
Use an F distribution table. Find the column for df1, the row for df2, and read the critical value at your significance level. At df 2 and 12 the 0.05 critical value is 3.885, so an F of 6.431 clears it and the result is significant. A table gives you a yes or no rather than an exact p. For the exact figure a spreadsheet returns it directly.
Can you run ANOVA with only the group means and standard deviations?
Yes, as long as you also have each group size. SSW is the sum of (ni − 1) × si² and SSB compares the group means against the weighted grand mean. For three groups of 10 with means of 12, 15 and 18 and a standard deviation of 3 in each, SSB = 180 and SSW = 243, giving MSB = 90, MSW = 9 and F = 10 on df 2 and 27. This calculator asks for raw values, so summary-only data needs the steps above.
Does this calculator handle two-way or three-way ANOVA?
No. It runs one-way ANOVA, which means a single grouping factor. Two-way ANOVA adds a second factor and tests the interaction between them, and three-way adds a third. Excel's Anova: Two-Factor options cover the two-factor case, and R or SPSS handle designs beyond that.
What is the difference between SSB, SSTR, SSW and SSE?
Nothing, they are the same quantities under different names. SSB, SSTR and sum of squares between groups all describe the treatment variation. SSW, SSE and sum of squares within all describe the error or residual variation. The same holds one level down: MSB is MSTR, and MSW is MSE. Textbooks and software pick different labels, the arithmetic stays identical.
Can the groups have different sizes?
Yes. One-way ANOVA does not require equal group sizes, and the formulas already carry ni for each group separately. Unequal sizes do make the test more sensitive to unequal variances, so check the spread in each group first. If one group is far more scattered than the rest, Welch's ANOVA is the safer test.
Try these next
- Hypothesis Testing Calculator
- P-Value Calculator
- Critical Value Calculator
- Sum of Squares Calculator