ANOVA Calculator
Paste one column per group, with a header row. See the ANOVA table and which groups differ.
https://flxcode.com/anova-calculator/
Paste columns from Excel, Google Sheets or a CSV file: the first row holds the group names, each column is one group. 2 to 12 groups, at least 2 values each, different lengths are fine. Tab, semicolon or comma between columns.
Example One-way ANOVA
One-way ANOVA: the group means differ at α = 0.05
Read 3 groups (Control: 10, Treatment 1: 10, Treatment 2: 10), 30 values. The first row is used as the group names.
ANOVA table
| Source | SS | df | MS | F | p |
|---|---|---|---|---|---|
| Between groups | 3.7663 | 2 | 1.8832 | 4.846 | 0.01591 |
| Within groups | 10.492 | 27 | 0.3886 | ||
| Total | 14.258 | 29 |
Tukey HSD: every pair, 95% intervals
| Pair (A − B) | Difference | 95% low | 95% high | q | p (adjusted) | Differs? |
|---|---|---|---|---|---|---|
| Control − Treatment 1 | 0.371 | -0.32022 | 1.0622 | 1.882 | 0.390871 | No |
| Control − Treatment 2 | -0.494 | -1.1852 | 0.19722 | 2.506 | 0.197996 | No |
| Treatment 1 − Treatment 2 | -0.865 | -1.5562 | -0.17378 | 4.388 | 0.0120064 | Yes |
Group means with 95% confidence intervals. Dashed line: the mean of all values.
p ≤ α, so at least one group mean differs from the others. ANOVA does not say which. The Tukey HSD table below compares every pair.
Levene test for equal spreads: F(2, 27) = 1.237, p = 0.306195. No sign that the spreads differ.
Effect size: η² = 0.2641 means the groups explain 26.4% of the variation. By Cohen's rough rule f of 0.1 is small, 0.25 medium and 0.4 large (here 0.5991). ω² is the same idea with less bias in small samples (shown as 0 if it comes out negative).
| Groups (k) and values (N) | 3 and 30 |
|---|---|
| Mean of all values | 5.073 |
| Eta-squared (η²) | 0.2641 |
| Omega-squared (ω²) | 0.2041 |
| Cohen's f | 0.5991 |
| Levene test | F(2, 27) = 1.237, p = 0.306195 |
| Welch's test (no equal spreads) | F(2, 17.13) = 5.181, p = 0.0173928 |
| Classic test | F(2, 27) = 4.846, p = 0.01591 |
The steps, with your numbers
Group means: Control 5.032, Treatment 1 4.661, Treatment 2 5.526. Mean of all 30 values: 5.073.
SSB = Σ nᵢ(x̄ᵢ − x̄)² = 10 × (5.032 − 5.073)² + 10 × (4.661 − 5.073)² + 10 × (5.526 − 5.073)² = 3.7663
SSW = Σ (x − x̄ᵢ)² inside each group = 3.06 + 5.6693 + 1.7628 = 10.492
MSB = SSB / (k − 1) = 3.7663 / 2 = 1.8832. MSW = SSW / (N − k) = 10.492 / 27 = 0.3886
F = MSB / MSW = 1.8832 / 0.3886 = 4.846
p = P(F ≥ 4.846) with 2 and 27 degrees of freedom = 0.01591
Tukey HSD: for each pair q = |x̄ᵢ − x̄ⱼ| / √(MSW / 2 × (1/nᵢ + 1/nⱼ)), compared with the studentized range for k = 3 and 27 df. The 95% limit is q = 3.506.
Group means with 95% confidence intervals
| Group | n | Mean | SD | SE | 95% low | 95% high |
|---|---|---|---|---|---|---|
| Control | 10 | 5.032 | 0.58309 | 0.18439 | 4.6149 | 5.4491 |
| Treatment 1 | 10 | 4.661 | 0.79368 | 0.25098 | 4.0932 | 5.2288 |
| Treatment 2 | 10 | 5.526 | 0.44257 | 0.13995 | 5.2094 | 5.8426 |
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it. What this tool keeps and sends.
Problem or idea? Email us
Quick start
- Copy your groups from a spreadsheet, one column per group, group names in the first row, and paste them in the box. For two factors, switch to Two-way and paste three columns.
- The headline is F and the p-value. The ANOVA table and the pair-by-pair table come right under it.
- If the Levene line says the spreads differ, set Variance to Welch.
Worked examples
| Case | Data | Result | p | Note |
|---|---|---|---|---|
| Three plant treatments, classic | Control, Treatment 1 and Treatment 2, 10 plant weights each (the example above) | F(2, 27) = 4.846 | 0.01591 | Tukey HSD: Treatment 2 is above Treatment 1 by 0.865 (p = 0.0120064); the other pairs are not significant |
| Same data, Welch | The same three columns with unequal variances allowed | F(2, 17.13) = 5.181 | 0.0173928 | The second df is a fraction, as it should be for Welch |
| Very different spreads | A steady group, a wide group and a narrow group, 5, 8 and 6 values | F(2, 16) = 0.145 | 0.866167 | Brown-Forsythe p = 4.877e−5: the spreads differ, so Welch and Games-Howell are the better pair (Welch p = 0.000904693, 1 of 3 pairs differ) |
| Two factors | Fertilizer A or B, three watering levels, 3 plants per cell | Interaction F(2, 12) = 13 | 0.000990403 | Fertilizer p = 0.000207965, watering p = 1.497e−8 |
| Only two groups | Scores 78 84 69 91 88 75 82 80 and 72 70 85 66 74 79 68 73 77 | F(1, 15) = 5.125 | 0.0388453 | Equals the square of the pooled t-test's t (2.264² = 5.125) |
The first example is the PlantGrowth data that ships with R, so you can compare the numbers with R's own output (F = 4.846, p = 0.01591).
The formulas
The total variation SST = Σ (x − x̄)² splits into SSB = Σ nᵢ (x̄ᵢ − x̄)² between the groups and SSW = Σ (x − x̄ᵢ)² inside them. Divide by the degrees of freedom, MSB = SSB / (k − 1) and MSW = SSW / (N − k), and F = MSB / MSW. The p-value is the upper tail of the F distribution with k − 1 and N − k degrees of freedom, computed straight from the incomplete beta function, so a p of 1e-120 keeps its digits.
Welch's F weights each group by nᵢ / sᵢ² and uses a fractional second df. Tukey HSD compares q = |x̄ᵢ − x̄ⱼ| / √(MSW/2 × (1/nᵢ + 1/nⱼ)) with the studentized range for k groups and N − k df. Games-Howell uses each pair's own variances and Welch df. Two-way ANOVA splits the variation into factor A, factor B, their interaction and the error inside the cells. To look up a p-value for an F you already have, use the p-value calculator, and for two groups only there is the t-test calculator. The box plot maker draws the same columns side by side.
Excel and Google Sheets
Excel for Windows has Anova: Single Factor in the Data Analysis ToolPak, an add-in you have to switch on. Excel for the web has no ToolPak, and on a Mac the add-ins sit under Tools > Excel Add-ins. Google Sheets has no ANOVA function, just F.DIST.RT and F.INV.RT. Neither program has a Tukey test. You can build the one-way table with formulas. Put the example above in A1:C11 (names in row 1) and use:
| Cell | Formula | Gives |
|---|---|---|
| SST | =DEVSQ(A2:C11) | 14.2584 |
| SSW | =DEVSQ(A2:A11)+DEVSQ(B2:B11)+DEVSQ(C2:C11) | 10.4921 |
| SSB | =SST-SSW | 3.76634 |
| F | =(SSB/(k-1))/(SSW/(N-k)) with k = 3, N = 30 | 4.84609 |
| p | =F.DIST.RT(F,k-1,N-k) | 0.01591 |
| Critical F at 0.05 | =F.INV.RT(0.05,k-1,N-k) | 3.35413 |
The Download .xlsx button writes your data and a results sheet with these formulas already in place, so changing a value updates the table. For two-way data the sums of squares are written as values and F and p as formulas.
Numbers this uses
- Default α is 0.05. The common convention, chips for 0.01 and 0.10.
- Post-hoc is Tukey HSD or Games-Howell. Follows the Variance choice.
- Accuracy is matches scipy and statsmodels to 9 digits or better. Checked on 200 random datasets, the NIST reference sets and the studentized range on a grid.
- Limits is 12 groups, 100,000 values. Kept low so the page stays quick on a phone.
Limits
One-way takes 2 to 12 groups with at least 2 values each, and they can have different sizes. Two-way needs a balanced design with the same number of values (at least 2) in every cell; otherwise the page names the counts and stops. There is no repeated-measures ANOVA, no three-way ANOVA, no ANCOVA, no post-hoc test for the two-way table, and no rank-based test such as Kruskal-Wallis. The page does not test the bell-shape assumption. If a group is clearly skewed and small, treat the p-value with care.
FAQ
When do I use ANOVA instead of a t-test?
When you have three or more groups. A t-test compares two. Running many t-tests on the same data raises the chance of a false alarm: with 5 groups there are 10 pairs, and at α = 0.05 the chance of at least one false positive is about 40%.
What does a significant ANOVA tell me?
That at least one group mean is different from the rest. It does not say which one. In the PlantGrowth example F(2, 27) = 4.846, p = 0.01591, and the Tukey table shows that the only pair that stands out is Treatment 2 against Treatment 1.
Classic or Welch?
Classic ANOVA assumes the groups have about the same spread. Welch's version does not, and it loses little when the spreads are equal, so it is a safe choice. The Levene or Brown-Forsythe line under the result tells you if the spreads look different. Welch needs at least 2 values per group and a spread above 0 in every group. On the example, classic gives p = 0.01591 and Welch p = 0.0173928.
Tukey HSD or Games-Howell?
Tukey HSD goes with the classic test: it uses the pooled spread, and for groups of different sizes it uses the Tukey-Kramer adjustment. Games-Howell goes with Welch: each pair gets its own spread and its own degrees of freedom. Both control the chance of a false positive over all pairs together, and both use the studentized range distribution.
Levene or Brown-Forsythe?
Both test whether the groups have the same spread. Levene measures each value from its group mean, Brown-Forsythe from its group median. The median version copes better with skewed data, and many programs use it by default. A small p means the spreads differ.
Why does two-way ANOVA need the same count in every cell?
With unequal cell counts the factors overlap and the sums of squares depend on the order and on the "type" (I, II or III) you choose. Programs differ here, so numbers would not match the one you compare against. This page runs the balanced case, where all types agree, and tells you the counts when yours are not equal. Each cell also needs at least 2 values.
More from FLXCode
- T-Test CalculatorOne-sample, Welch, Student and paired t-tests from raw data or summary numbers, with p, CI and d.
- P-Value Calculatorp-value from a z, t, chi-square or F statistic, one or two tailed, with the tails shown.
- Box Plot MakerDraw box plots for up to 8 columns on one axis, with quartiles, outliers and PNG or SVG download.
- CSV to Excel ConverterTurn CSV files into an Excel .xlsx file. Leading zeros, long numbers and dates stay as they are. Nothing is uploaded.