How many people must you survey to estimate a prevalence within a stated margin of error? Enter the expected prevalence and the precision you need, then add a finite population correction, a design effect for cluster sampling and nonresponse.
Free sandbox · No credit card · 21 CFR Part 11 aligned
Simple random sample
246
Cluster design (20 per site, ICC 0.05)
480
Enrol with 15% nonresponse
290
139
246
323
385
The short answer
Worked examples
Simple random sampling from a large population, 95% confidence (Z = 1.96), rounded up to the next whole person.
| Expected prevalence p | Margin ±10 points | Margin ±5 points | Margin ±3 points | Margin ±2 points |
|---|---|---|---|---|
| 5% | 19 | 73 | 203 | 457 |
| 10% | 35 | 139 | 385 | 865 |
| 20% | 62 | 246 | 683 | 1,537 |
| 30% | 81 | 323 | 897 | 2,017 |
| 50% (no prior information) | 97 | 385 | 1,068 | 2,401 |
Illustrative values from n = Z²p(1 − p)/d². Halving the margin roughly quadruples the sample. The margin is in percentage points, not a relative percentage of p.
The calculation
A prevalence study estimates the proportion of a population with a condition, trait or exposure at a point in time. The estimate p̂ has a standard error of √[p(1 − p)/n], and a 95% confidence interval extends 1.96 standard errors either side. If you want that half-width to be no more than d, set 1.96 × √[p(1 − p)/n] = d and solve for n, which gives n = 1.96² p(1 − p) / d². For p = 0.20 and d = 0.05, that is 3.8416 × 0.16 / 0.0025 = 245.9, which rounds up to 246. The formula is the classical Cochran (1977) result and is the same one that appears in most prevalence sample size tables.
The product p(1 − p) is largest at p = 0.5, so using 50% when you have no good prior estimate returns the largest n for a given margin and is the conservative choice (385 at ±5 points). If you do have a defensible prior from a similar population, use it, but note that the choice cuts both ways: a true prevalence far from your assumption gives a different interval width than planned. The margin should be justified by how the estimate will be used. A ±5 point margin is common for a screening estimate; a ±1 point margin around a rare condition may be what a health authority needs and costs several times more participants.
The normal approximation behind the formula breaks down when p is very small or very large. For a prevalence of 1% with ±0.5 points the formula gives 1,522, but the interval around a small observed count is skewed, so many statisticians use the Wilson or Clopper–Pearson interval and a sample size calculated for that interval instead. Another common mistake is to define d as a relative error. A "20% relative precision" around p = 10% means d = 0.02, which needs 865 people, not the 35 that a ±10 point margin gives. State which one you mean in the protocol.
If the population is small and you sample a meaningful fraction of it (a registry of 2,000 known patients, one hospital’s ward), sampling without replacement gives a tighter interval than the formula assumes. The corrected sample size is n = n₀ / (1 + (n₀ − 1)/N), using the unrounded n₀ = 245.85. For N = 500 this is 166; for N = 2,000 it is 220; for N = 10,000 it is 240; and for a very large population it converges to 246. The correction is worth applying when n₀ is more than about 5% of N and is negligible otherwise.
When participants are sampled in groups, such as clinics or villages, people in the same cluster resemble each other, and the effective sample is smaller than the head count. The design effect (Kish) is DEFF = 1 + (m − 1)ρ, where m is the average participants per cluster and ρ the intraclass correlation. With m = 20 and ρ = 0.05, DEFF = 1.95, so the 246 becomes 479.4, which rounds up to 480 participants, or 24 clusters of 20. Recruiting more clusters with fewer people each is usually more efficient than a few big clusters: with m = 10 and ρ = 0.10 the design effect is 1.9, which needs 468 people in 47 clusters. The cluster-randomized sample size calculator covers the same inflation for comparisons between arms; ρ must come from similar data, and a statistician should check it.
The number computed is the number of analysable respondents. If you expect 15% of invitees not to respond or to have unusable data, enrol 245.85 / 0.85 = 289.2, so 290. Divide by the response rate rather than adding a percentage, for the reason explained in the dropout-adjusted sample size calculator. Nonresponse also introduces bias that no sample size repairs, so the plan should say how you will chase non-responders and check whether they differ.
Build the eCRFs, edit checks and visit schedule in the free sandbox with every feature. No credit card, no time limit. You pay only when you go live with real participants.
Beyond a single number
The formula gives precision for the overall prevalence. If you also want a prevalence estimate within each of five regions or two age bands, each subgroup needs its own n, and the total is the sum, not the overall n. A survey sized for ±5 points overall will give a margin of about ±11 points in a subgroup holding a fifth of the sample. List the subgroups that matter before fixing the sample.
If the aim is to compare prevalence between two groups, you are in the two-proportions problem, and the two-proportions sample size calculator applies, not this formula. If you are estimating a prevalence in order to show that a rate is below a regulatory or clinical threshold, the hypothesis-test version (one proportion against a fixed value) uses a different formula that includes power. The power analysis calculator shows how alpha and power enter. For background on the concepts, see the glossary entry on sample size calculation.
Prevalence estimates are also used outside prevalence studies, for example when a feasibility step needs the proportion of screened patients who meet the criteria, to forecast enrolment. The same formula applies to that proportion. The result feeds a recruitment plan, not an analysis, so a rough margin often suffices.
Collecting the data
A cross-sectional prevalence study collects one set of measurements per participant, which makes the eCRF design simple and the data quality rules important. In Capture, the study team builds the case report form with numeric, single-choice and date fields, uses skip logic so that only relevant questions appear, and adds range and custom edit checks that raise an auto-query when a value breaks a rule. Calculated fields such as BMI or age from date of birth are shown read-only during entry, so the case definition is applied the same way for every participant. Multi-site surveys can use site-level participant numbering and QR-code enrolment, and the exports can be filtered by site, which is exactly the cut a design-effect calculation needs.
For continuing data collection, see EDC for registry studies, EDC for observational studies and EDC for real-world evidence studies; participant-reported questionnaires fit ePRO for observational studies. The monitoring dashboard shows enrolment against the target so a shortfall is seen while there is still time to recruit, and CSV or Excel exports arrive with a data dictionary for the analysis. Every change to a value is captured in the field-level audit trail with a reason.
Decision rule
n = Z²p(1 − p)/d². Use p = 0.5 if you have no credible prior.
Apply the finite population correction using the unrounded n₀.
Multiply by 1 + (m − 1)ρ and report the number of clusters as well as people.
Ask a statistician about Wilson or exact intervals before relying on the normal formula.
Size each subgroup separately; the overall n will not give subgroup precision.
Divide by the response rate and round up, then plan how to check for nonresponse bias.
n = Z² × p(1 − p) / d², where Z is the normal value for your confidence level (1.96 for 95%), p the expected prevalence and d the absolute margin of error. With p = 20% and d = 5 points it gives 245.9, so 246 participants.
Use 50%. It maximises p(1 − p) and so gives the largest sample size for a given margin, 385 at ±5 points and 95% confidence. If a credible prior exists, use it, but confirm the choice with a statistician and test how the sample size changes if the true value is different.
Only when you sample a notable fraction of a small population. The corrected n = n₀ / (1 + (n₀ − 1)/N). For n₀ = 246, N = 2,000 gives 220 and N = 500 gives 166. For a large population the correction is negligible.
In cluster sampling, similarity within clusters inflates the variance by DEFF = 1 + (m − 1)ρ, where m is the average cluster size and ρ the intraclass correlation. Multiply the simple random sample size by DEFF. With m = 20 and ρ = 0.05 the factor is 1.95.
Divide the required number of analysable respondents by the expected response rate and round up: 246 / 0.85 = 290. Also plan follow-up to check whether non-responders differ from responders, because a larger sample does not remove nonresponse bias.
The formula uses an absolute margin in percentage points. If a protocol states a relative precision (for example 20% of p), convert it first: 20% of a 10% prevalence is d = 0.02, which needs 865 participants.
The normal approximation is weak when p is very small or close to 100%. Use it for a first estimate, then have a statistician check the plan using a Wilson or exact interval, and consider whether a registry rather than a sample suits the question.
No. The tables and examples on this page were checked with an independent script, but it is a planning aid, not validated software. Confirm the final sample size, the interval method and any design effect with a statistician before a protocol is submitted.
Keep exploring
Two-proportions sample size calculator
Compare two prevalences or response rates.
Cluster-randomized sample size calculator
Design effect for clustered trials.
Dropout-adjusted sample size calculator
Why you divide by the response rate.
EDC for registry studies
Ongoing prevalence and outcome capture.
EDC for observational studies
Cross-sectional and cohort data collection.
Sample size calculator for clinical trials
The two-arm trial case.
Build the eCRFs, edit checks and visit schedule in the free sandbox with every feature. No credit card, no time limit. You pay only when you go live with real participants.