Skip to content

Sample Size for a Proportion

Plan how many observations you need before collecting data, to estimate a proportion to a target margin of error.

As a decimal, e.g. 0.05 for plus or minus 5 percentage points.

Use 0.5 if unknown; it is the conservative, largest-sample assumption.

As a decimal, e.g. 0.1 for 10% expected dropout.

What this answers

This planner answers "how many observations do I need to collect, before I start, to estimate a proportion to a specific level of precision?" It is a design tool used before data collection, not an analysis tool used after it. Answering "how big should my sample be" always requires a decision about what precision and confidence you actually need; there is no single universal sample size that fits every question.

How it is calculated

Required sample size is the square of your confidence level's z critical value, times the expected proportion times one minus that proportion, divided by the square of your target margin of error, then rounded up to a whole number of observations. The expected proportion matters because a proportion near 0.5 has the most inherent variability to estimate; using 0.5 when you genuinely do not know the true proportion is the conservative choice, since it never underestimates the sample size you need. If you expect to lose participants after enrollment, an attrition-adjusted enrollment target inflates the raw requirement so the number who actually complete the study still meets your target.

Worked example

For a 95% confidence level, a 5 percentage point target margin of error, and the conservative assumption of p = 0.5: the required sample size works out to 385, matching the widely cited result for this exact combination. If you additionally expect 20% attrition, the enrollment target rises to 385 divided by 0.8, rounded up to 482, so that 385 people are still expected to remain after the expected dropout.

Assumption audit

Calculated from your data: whether your inputs (margin of error, baseline proportion, confidence level, attrition rate) fall within valid ranges, and whether the conservative p = 0.5 assumption was used.
Evidence to review: how plausible your assumed baseline proportion actually is. A baseline far from the true value can under- or over-estimate the sample you truly need; when in doubt, the conservative p = 0.5 protects against this at the cost of a larger recommended sample.
You must verify: that your actual recruitment or sampling design can reach genuinely independent, representative observations at the scale this calculator recommends. A larger sample size cannot fix a biased sampling method.

What this result does not mean

This required sample size describes statistical precision only. It says nothing about whether your sampling frame is representative, whether nonresponse will be random or systematic, or whether the margin of error you chose is actually small enough to answer your real decision. A correctly sized but poorly sampled study still produces a misleading estimate.

Limitations

This formula assumes a simple random sample and a normal approximation to the binomial distribution, which is accurate for the sample sizes typically involved here but does not account for clustering, stratification, or other complex survey designs. Those designs require a design effect adjustment beyond this calculator's scope.