Sample Size Calculator

Determines the number of participants needed to detect a target effect at a chosen power and significance level, for continuous (two-sample t-test), binary (two-proportion), survival, cluster-randomized, and longitudinal designs. Supports superiority, non-inferiority, and equivalence framing, unequal allocation, and dropout adjustment.

How it works

Each design uses its standard closed-form sample-size expression under a normal approximation: the standardized effect (difference divided by its standard deviation) sets the base sample size, which is then adjusted for allocation ratio, non-inferiority or equivalence margins, and expected dropout. Cluster-randomized designs apply a design effect from the intraclass correlation and cluster size (with a small-cluster t-correction); longitudinal designs use the effective variance for a slope, endpoint, or change-from-baseline analysis.

When to use it

  • You are planning a two-arm trial or A/B test with a continuous or binary primary outcome.
  • You need a quick, transparent sample size for a survival, cluster-randomized, or repeated-measures design.
  • You want to see how allocation, margins, and dropout change the required sample size.

Assumptions & limitations

  • Results use a normal (large-sample) approximation; for very small samples or proportions near 0 or 1, exact methods (e.g., Fisher's exact) are more appropriate.
  • The survival option here uses the Schoenfeld formula with two-sided testing only; for one-sided tests or the Freedman comparison, use the dedicated Survival Sample Size calculator.
  • Cluster and longitudinal results depend on the intraclass correlation and correlation structure, which are often uncertain — sensitivity analysis is recommended.
  • Inflating the sample size for dropout does not address informative missingness, which requires a separate analysis strategy.