Sample size calculator
How many observations do you need to detect a difference between two groups? Enter the effect size you care about, your significance level, and the power you want — the calculator does the rest.
You have the number. Now you need the data. When it arrives, Stratum runs the test — ANOVA with effect sizes and the post-hoc the data supports, diagnostics in the same report.
Try Stratum freeHow to use it
This sizes the classic comparison of two group means (the design behind a two-sample t-test or a simple A/B test).
- Effect size (Cohen's d) — the smallest difference worth detecting, in standard-deviation units. Don't have one? Use the effect-size calculator on pilot data, or start from the 0.2 / 0.5 / 0.8 conventions.
- Significance level α — your false-positive rate. 0.05 is the usual default.
- Power (1 − β) — the chance of detecting a real effect of that size. 0.80 is conventional; 0.90 is stricter and needs more data.
n = 2 · ( (z1−α/k + z1−β) / d )², rounded up, where k is 2 for a two-tailed test and 1 for one-tailed, and the z values are standard-normal quantiles. It's the standard normal approximation — exact enough for planning, and slightly conservative for very small samples.
Reading the result
The headline number is observations per group; the detail line shows the total across both. Notice the trade-offs as you change inputs: a smaller effect, a lower α, or higher power all push the sample size up — often steeply. Halving the effect size roughly quadruples the sample you need.
See also
- Other calculators
- P-value calculator · Effect-size calculator
- Learn the concept
- Effect size · Confidence interval
- Do it on real data
- Run a t-test