power calculation sample size calculator

Sample Size Calculator (Two Independent Means)

Use this tool for a basic power analysis when comparing two groups (A/B test, treatment vs control, intervention vs baseline) with a continuous outcome.

Small: 0.2, Medium: 0.5, Large: 0.8
Common choice: 0.05
Common choices: 0.80 or 0.90
1 = equal group sizes; 2 = Group 2 is twice Group 1

Why a power calculation matters

A power calculation sample size calculator helps you estimate how many participants you need before starting a study. Without this step, it is easy to run an underpowered experiment that cannot detect meaningful effects, or an oversized experiment that wastes time, money, and effort.

In practical terms, sample size planning is risk management. If your study is too small, you risk false negatives (missing a real effect). If your study is too large, you may overspend and delay decisions unnecessarily. A well-chosen design balances confidence and efficiency.

Core terms in statistical power analysis

1) Effect size (Cohen’s d)

Effect size is the magnitude of the difference you care about, standardized by the outcome variability. In this calculator, we use d for two independent means:

  • d = 0.2 → small effect
  • d = 0.5 → medium effect
  • d = 0.8 → large effect

2) Alpha (Type I error rate)

Alpha is the probability of a false positive if there is truly no effect. A common choice is 0.05. Lower alpha means stricter evidence requirements and usually larger required sample size.

3) Power (1 - beta)

Power is the probability of detecting your target effect if it truly exists. Many studies target 80% power; high-stakes settings often use 90% or higher.

4) One-tailed vs two-tailed tests

Two-tailed tests look for differences in either direction and are usually the default. One-tailed tests can reduce required sample size, but only when a directional hypothesis is justified ahead of time.

Formula used by this calculator

This page uses a normal approximation for two independent groups with continuous outcomes and common variance. For allocation ratio r = n2 / n1, the required sample for Group 1 is:

n1 = ((1 + 1/r) × (Zalpha + Zpower)2) / d2

Then Group 2 is n2 = r × n1. We round up both groups and then inflate for expected attrition.

How to use this power calculation sample size calculator

  • Enter your expected effect size (Cohen’s d).
  • Set alpha (usually 0.05).
  • Set target power (usually 0.80 or 0.90).
  • Choose one-tailed or two-tailed testing.
  • Choose an allocation ratio between groups.
  • Add expected dropout percentage.
  • Click Calculate Sample Size.

Quick example

Suppose you expect a medium effect (d = 0.5), want alpha = 0.05, power = 0.80, and use a two-tailed test with equal group sizes and 10% expected dropout. The calculator will return the minimum per-group and total enrollment targets, plus adjusted targets after attrition.

Common mistakes to avoid

  • Using an unrealistic effect size: optimistic values produce sample sizes that are too small.
  • Ignoring dropout: always inflate recruitment goals for attrition.
  • Switching tails after seeing data: define one-tailed vs two-tailed before data collection.
  • Forgetting design complexity: clustering, repeated measures, or multiple endpoints may require larger samples.

When to go beyond this simple calculator

This tool is a practical starting point. For complex studies, consider specialized software or a statistician, especially for:

  • Binary outcomes (conversion rates, pass/fail outcomes)
  • Survival analysis (time-to-event)
  • Non-inferiority or equivalence trials
  • Mixed models, longitudinal data, or cluster-randomized designs
  • Multiple primary comparisons with multiplicity control

Final note

Good research planning begins with transparent assumptions. Document your inputs (effect size, alpha, power, tails, attrition) in your protocol. That makes your sample size decision reproducible and defensible.

🔗 Related Calculators