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:

QuantitySymbolConventional ValueWhat It Means
Sample sizenSolve for thisNumber of participants per group
Effect sized, f, rDepends on fieldMagnitude of the difference/relationship
Significance levelα0.05Probability of false positive (Type I error)
Power1-β0.80Probability 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)Interpretationn per group (α=0.05, power=0.80)Total N
0.2Small394788
0.5Medium64128
0.8Large2652
Rule of Thumb

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.

Calculation

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 →

Frequently Asked Questions

What is power analysis?
Power analysis determines the minimum sample size needed to detect a true effect of a given size with a specified probability. It balances four quantities: sample size (n), effect size, significance level (α), and statistical power (1-β). You set three and solve for the fourth. Most commonly, you set effect size, α, and power to find the required n.
What sample size do I need for a t-test?
For a two-sample t-test with α=0.05, power=0.80, and Cohen's d=0.5 (medium effect), you need 64 participants per group (128 total). For d=0.8 (large effect), you need 26 per group (52 total). For d=0.2 (small effect), you need 394 per group (788 total). Use our calculator to find the exact n for your specific parameters.
What is the difference between α and β?
α (alpha) is the probability of Type I error — rejecting the null hypothesis when it's actually true (false positive). The conventional threshold is 0.05. β (beta) is the probability of Type II error — failing to reject the null when it's actually false (false negative). Power = 1-β. The conventional power threshold is 0.80, meaning you have an 80% chance of detecting a true effect.
Should I add extra participants for dropouts?
Yes. Always add 10-20% extra to your calculated sample size to account for dropouts, exclusions, and missing data. For example, if you calculate n=64 per group, recruit at least 72-78 per group. This is especially important for longitudinal studies where attrition rates can be 15-30%.