Free tool · Sample size · Prevalence and registriesUpdated October 17, 2026

Sample size calculator for prevalence studies

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.

  • n = Z²p(1−p)/d²
  • Finite population and cluster design effect
  • Worked table for registries and surveys

Free sandbox · No credit card · 21 CFR Part 11 aligned

Demo: expected prevalence 20%, margin of error ±5 points, 95% confidence

Simple random sample

246

Cluster design (20 per site, ICC 0.05)

480

Enrol with 15% nonresponse

290

p = 10%, ±5139/400

139

p = 20%, ±5246/400

246

p = 30%, ±5323/400

323

p = 50%, ±5385/400

385

When you have no prior estimate, p = 50% gives the largest, safest n.

The short answer

  • For a single proportion, the sample size is n = Z² × p(1 − p) / d², where p is the expected prevalence, d the absolute margin of error (half-width of the confidence interval) and Z = 1.96 for 95% confidence.
  • Worked example: expected prevalence 20%, margin ±5 points: n = 1.96² × 0.20 × 0.80 / 0.05² = 245.9, so 246 people. With no prior estimate, p = 0.50 gives 385 for the same margin.
  • For a small, defined population, multiply by the finite population correction: n = n₀ / (1 + (n₀ − 1)/N). With N = 2,000, the 246 becomes 220.
  • For cluster sampling (sites, clinics, villages), multiply by the design effect 1 + (m − 1)ρ. With 20 participants per cluster and ρ = 0.05 the design effect is 1.95 and the example needs about 480 people in 24 clusters.
  • Then allow for nonresponse by dividing by the response rate: 246 / 0.85 = 290. Have a statistician confirm the expected prevalence, the interval method and the design effect before you fix the number.

Worked examples

Required sample size by expected prevalence and margin of error

Simple random sampling from a large population, 95% confidence (Z = 1.96), rounded up to the next whole person.

Expected prevalence pMargin ±10 pointsMargin ±5 pointsMargin ±3 pointsMargin ±2 points
5%1973203457
10%35139385865
20%622466831,537
30%813238972,017
50% (no prior information)973851,0682,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

Where the formula comes from and how to apply it

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.

Finite population correction

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.

Design effect for cluster sampling

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.

Nonresponse and incomplete data

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.

Turn the sample size into a data collection plan

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.

Build your study free

Beyond a single number

Subgroups, comparisons and what this formula does not cover

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

Running a prevalence survey, cross-sectional study or registry in an EDC

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

Choosing the right version of the formula

One large population, simple random sample

n = Z²p(1 − p)/d². Use p = 0.5 if you have no credible prior.

Small known population (n₀ > 5% of N)

Apply the finite population correction using the unrounded n₀.

Sampling by clinic, village or school

Multiply by 1 + (m − 1)ρ and report the number of clusters as well as people.

Rare condition (p below about 5%)

Ask a statistician about Wilson or exact intervals before relying on the normal formula.

Precision needed in subgroups

Size each subgroup separately; the overall n will not give subgroup precision.

Expected nonresponse

Divide by the response rate and round up, then plan how to check for nonresponse bias.

FAQ

Questions teams ask before they switch

Something not covered here? Ask us directly.

What is the sample size formula for prevalence?

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.

What prevalence should I assume if I do not know it?

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.

Do I need a finite population correction?

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.

What is the design effect and how do I apply it?

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.

How do I allow for nonresponse?

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.

Is the margin of error absolute or relative?

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.

Does this work for a rare condition?

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.

Is this calculator validated?

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.

Plan the number, then build the survey

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.

Build your study free