A guide to calculating the sample size needed to estimate a population proportion (prevalence, rate, or percentage) with desired precision.
Proportion estimation is one of the most common sample size problems. It arises whenever you need to estimate the percentage of a population with a certain characteristic, for instance, the prevalence of a disease, the proportion of customers satisfied with a service, or the percentage of voters supporting a candidate.
This calculator determines the minimum number of subjects needed to estimate a proportion with a specified level of precision (margin of error) at a given confidence level. The required sample size depends on the expected proportion, the desired precision, and the confidence level.
Sample size is maximised when the expected proportion is 0.5 (maximum uncertainty). As the proportion moves towards 0 or 1, the required sample size decreases.
A public health department wants to estimate the proportion of children aged 12–23 months who have received all recommended vaccinations in a district. Based on previous surveys, the expected coverage is approximately p = 0.70 (70%). They want the estimate to be within ±5 percentage points (absolute precision = 0.05) with 95% confidence.
1 Open the Sample Size Calculator for Estimating a Single Proportion.
2 Set Confidence Level to 95%.
3 Enter the Expected Proportion as 0.70.
4 Enter the Precision as 0.05.
5 The calculator shows the required sample size: n = 323.
Rounding up: n = 323.
Finite population correction: If the district has only N = 2,000 children in the target age group:
Response rate: If an 80% response rate is anticipated, the sample size should be inflated: 323 / 0.80 = 404 (before FPC), or 278 / 0.80 = 348 (after FPC).
If the expected proportion is completely unknown, use p = 0.50 for the most conservative (largest) sample size:
| Output | Interpretation |
|---|---|
| Required Sample Size (n) | The number of subjects to sample. If the study has a binary outcome (e.g., vaccinated or not), each subject contributes one observation. |
| Live Interpretation | A sentence summarising the result, for example: “A sample of 323 subjects is required to estimate the proportion within ±5% with 95% confidence, assuming an expected proportion of 70%.” |
| Visualisation | Plots the required sample size across a range of expected proportions for several precision values. This is especially useful when the expected proportion is uncertain. |
| Tabulate | A table showing sample sizes for combinations of expected proportion and precision values, useful for study protocols. |
Practical tip: The sample size is most sensitive to changes in precision. Doubling precision (e.g., from ±5% to ±10%) reduces the required sample size by a factor of 4. Consider whether a slightly wider margin of error would be acceptable to reduce costs.
where:
When precision is expressed as a fraction of the expected proportion (e.g., “within 10% of the true proportion”), the formula becomes:
where \( \epsilon \) is the relative precision (e.g., 0.10 for 10% relative margin).
where \( R \) is the anticipated response rate (e.g., 0.80 for 80%).
A hospital wants to estimate the prevalence of hypertension among adults in a rural district.
Inputs: Expected prevalence p = 0.30, confidence level = 95%, margin of error = 5%, population = 12,000.
Result: n = 312 (after finite-population correction).
Interpretation: Surveying 312 adults will estimate the true hypertension prevalence within ±5 percentage points, 95% of the time.
A university surveys students to estimate the proportion who use the online tutoring platform.
Inputs: Expected proportion p = 0.50 (unknown, conservative), confidence level = 95%, margin of error = 4%.
Result: n = 601.
Interpretation: With no prior estimate, the maximum-variance assumption (p = 0.50) yields the largest necessary sample. Surveying 601 students ensures the estimate is within ±4 pp.
A quality control team needs to estimate the defect percentage on a production line producing 5,000 units per month.
Inputs: Expected defect percentage p = 0.03, confidence level = 99%, margin of error = 2%, population = 5,000.
Result: n = 275 (after finite-population correction).
Interpretation: Inspecting 275 units will estimate the true defect percentage within ±2 pp with 99% confidence.
A polling firm estimates the proportion of registered voters supporting a policy initiative.
Inputs: Expected support p = 0.45, confidence level = 95%, margin of error = 3%.
Result: n = 1,056.
Interpretation: A random sample of 1,056 voters will produce an estimate within ±3 pp. This is a typical sample size for national opinion polls.
An extension agency estimates the proportion of farms using organic methods in a district with 800 farms.
Inputs: Expected proportion p = 0.15, confidence level = 95%, margin of error = 5%, population = 800, design effect = 1.5 (cluster sampling).
Result: n = 262 (after FPC and cluster correction).
Interpretation: Visiting 262 farms accounts for the clustering within villages and estimates the organic-farming percentage within ±5 pp.
Back to Sample Size Calculator for Estimating a Single Proportion