Sample Size Calculator
Calculate the minimum sample size for your study — whether you're running a t-test, ANOVA, proportion comparison, or correlation. Get statistical power analysis in seconds.
Open the calculator →Why sample size matters (a lot)
Picture this: you run a 6-month experiment, collect data, and get p = 0.07. "No significant effect," you write. But was there truly no effect, or did you just not have enough people to see it?
An underpowered study is worse than no study at all. You spent the money, burned the time, and got an answer you can't use. A proper power analysis before data collection tells you exactly how many participants you need to detect an effect — if it's there.
The Four Quantities
Power analysis involves four interrelated quantities. You set three and solve for the fourth:
| Quantity | Symbol | Conventional Value | What It Means |
|---|---|---|---|
| Sample size | n | Solve for this | Number of participants per group |
| Effect size | d, f, r | Depends on field | Magnitude of the difference/relationship |
| Significance level | α | 0.05 | Probability of false positive (Type I error) |
| Power | 1-β | 0.80 | Probability of detecting a true effect (1 - Type II error) |
Sample Size for t-Tests
For a two-sample independent t-test, the required sample size per group depends on Cohen's d (effect size):
| Effect Size (Cohen's d) | Interpretation | n per group (α=0.05, power=0.80) | Total N |
|---|---|---|---|
| 0.2 | Small | 394 | 788 |
| 0.5 | Medium | 64 | 128 |
| 0.8 | Large | 26 | 52 |
For a medium effect (d=0.5) with standard parameters (α=0.05, power=0.80), you need 64 participants per group (128 total). Always add 10-20% for dropouts.
Worked Example: Clinical Trial Planning
You're designing a drug trial. Previous studies suggest the drug reduces blood pressure by about 8 mmHg (SD ≈ 16 mmHg), giving Cohen's d ≈ 0.5. You want 80% power at α=0.05.
n = 64 per group × 1.15 (15% dropout buffer) = 74 per group (148 total)
If you can only recruit 50 per group (100 total), your power drops to ~0.65 — meaning you have only a 65% chance of detecting the effect. You'd need a larger effect size (d=0.63) or a larger α (0.10) to maintain 80% power with n=50.
Common mistakes
- Post-hoc power analysis. You already have the p-value. Computing "observed power" from it tells you nothing new. Plan power before you collect data.
- Forgetting about dropouts. A longitudinal study with 30% dropout needs 43% more people than your power analysis says (1/0.7 ≈ 1.43). Factor attrition in from day one.
- Picking arbitrary effect sizes. "d = 0.5 because it's medium" isn't a justification. Use pilot data, published literature, or the smallest effect you'd care about clinically.
- Ignoring practical significance. With n = 10,000, you can detect a d = 0.02 as "significant." But is a 2% difference worth a 10,000-person trial? Probably not.
Figure out your n
Plug in your effect size, alpha, and power. Get the minimum sample size. Includes power curves for t-tests, ANOVA, and correlation.
Open the calculator →