Complete guide
Use the calculator above to find the minimum sample size needed to achieve the precision you want — for estimating a mean, detecting a difference between two groups, or measuring a proportion. The right sample size protects you from drawing false conclusions and from over-spending on data collection.
What it is
What is sample size?
Sample size is the number of observations you need so that your estimate is precise enough, or that your hypothesis test has enough power to detect a real difference. Too small and the result is noise; too large and you waste effort and money. The right size depends on the variability of the data and the size of effect you want to detect.
Calculation logic
How the calculation works
For a mean: n = (Z × σ ÷ E)², where σ is the standard deviation and E is the margin of error you want. For a proportion: n = (Z² × p(1−p)) ÷ E². For comparing two groups, the formula includes both the desired statistical power and the minimum detectable difference. The calculator handles each case.
Common mistakes
Watch-outs before using sample size
- Skipping sample-size calculation and "just collecting some data" — then discovering the result is inconclusive.
- Using last project’s sample size as a default rather than recalculating for the new effect size and variability.
- Forgetting that detecting smaller effects requires disproportionately larger samples (n grows as the square of 1/E).
- Confusing precision (CI width) with power (ability to reject H₀) — they are related but distinct concepts.
- Using a normal-distribution formula on small samples that should use the t-distribution.
What to do next
Turn the result into action
Decide what effect size matters before collecting data. Use the calculator to find n, then add a margin (10-20%) for missing data and non-response. Re-check assumptions (σ, p) once early data is in.
How do you calculate sample size?
For a mean: n = (Z × σ ÷ E)². For a proportion: n = (Z² × p(1−p)) ÷ E². For comparing two groups, include desired power and the smallest difference you need to detect.
Why does sample size matter?
Too small and you cannot detect real differences; too large and you waste time and money. The right size delivers the precision you need at the minimum cost.
Is bigger always better for sample size?
No. Beyond a point, doubling sample size only narrows the interval by 1/√2 (~30%). The cost grows linearly while precision grows with the square root — diminishing returns set in quickly.
What confidence level should I use?
95% is the default for most business decisions. Use 99% for safety-critical or regulatory contexts. Use 90% only when speed and cost matter more than rigour.
How do you size for hypothesis tests?
Use power-based formulas that incorporate the desired statistical power (commonly 80%), the significance level (commonly 5%), and the smallest difference worth detecting (the minimum detectable effect).