Both tests compare group means, and both frequently show up in the same chapter of a research methods textbook โ which is exactly why students often aren't sure which one their own data actually calls for.
The choice between a t-test and ANOVA almost always comes down to one simple question: are you comparing two groups, or more than two?
| T-Test | ANOVA | |
|---|---|---|
| Number of groups compared | Exactly 2 | 3 or more |
| Example research question | Do male and female students score differently on average? | Do students taught by Method A, B, or C score differently on average? |
| What it tells you if significant | The two group means differ | At least one group mean differs from the others โ but not automatically which one(s) |
This is a common instinct when comparing three or more groups โ just run a t-test between each possible pair. The problem is that each individual test carries some risk of a false positive (typically 5%), and running multiple tests compounds that risk across the whole set of comparisons. Comparing four groups this way requires six separate t-tests, substantially inflating the chance of finding a "significant" difference that's actually just due to chance. ANOVA avoids this by testing all groups simultaneously in a single test, controlling the overall error rate properly.
A significant ANOVA result tells you that at least one group's mean is different from at least one other group's mean โ but it doesn't tell you which specific group(s) differ from which. To find that out, researchers typically follow a significant ANOVA with a post-hoc test (such as Tukey's HSD), which makes pairwise comparisons while still controlling for the multiple-comparisons problem described above.
| Type | Used when |
|---|---|
| Independent samples t-test | Comparing two separate, unrelated groups (e.g. male vs. female students) |
| Paired samples t-test | Comparing the same group measured twice (e.g. pre-test vs. post-test scores for the same students) |
Choosing the wrong type of t-test for your actual study design is a separate, common mistake worth watching for โ a pre/post comparison of the same students should almost always use a paired t-test, not an independent samples t-test.
Two groups, comparing the same variable once: independent samples t-test. Same group, measured twice: paired t-test. Three or more groups: ANOVA, followed by a post-hoc test if the result is significant.
Related: Correlation vs Regression ยท Independent vs Dependent Variables ยท Scholar's Corner overview