Sample Size Calculator for Proportion
Before conducting a survey or study involving a proportion (such as the percentage of voters who favor a policy), you need to decide how many respondents to include. Too few and your results will be imprecise; too many wastes resources. This calculator uses the standard formula n = z squared times p(1-p) divided by E squared to find the minimum sample size needed for your chosen confidence level and margin of error. If you have an estimate of the expected proportion, enter it; otherwise, use 50%, which gives the most conservative (largest) sample size.
Sample size formula
n = z² × p × (1 - p) / E²
Where z is the critical z value (1.645 for 90%, 1.960 for 95%, 2.576 for 99%), p is the expected proportion as a decimal, and E is the margin of error as a decimal. The result is always rounded up to the nearest whole number.
Choosing inputs
- Set the confidence level to 95% for most surveys and research studies.
- A margin of error of 5% is conventional for general-purpose surveys. Use 3% or 2% for higher-stakes decisions.
- If you have pilot data or prior research, use that proportion. Otherwise, 50% maximizes the required sample size and ensures you will not be under-powered.
- For a finite population, apply the correction: n(adj) = n divided by (1 plus (n-1) divided by N).
Frequently asked questions
What is the formula for sample size when estimating a proportion?
n = z squared times p times (1-p) divided by E squared, where z is the critical value for the chosen confidence level, p is the expected proportion (use 0.5 if unknown), and E is the desired margin of error expressed as a decimal.
Why use 50% as the expected proportion?
When the true proportion is unknown, using p = 0.5 produces the largest possible sample size because p(1-p) is maximized at p = 0.5. This is a conservative choice that ensures sufficient precision regardless of the true proportion.
What margin of error should I use?
For most surveys, a margin of error of 5% (0.05) at 95% confidence is standard, resulting in a sample size of about 385. For higher precision (such as for policy decisions), use 2% or 3%, which requires larger samples.
Does sample size depend on population size?
For large populations (more than 10,000), the required sample size is essentially independent of the population size. For small populations, apply a finite population correction: n_adjusted = n divided by (1 plus (n-1) divided by N), where N is the population size.
How does confidence level affect sample size?
Higher confidence levels require larger samples. At 95% confidence with a 5% margin of error, you need about 385. At 99% confidence, you need about 664. The critical z value squares in the formula, so increasing confidence has a large impact on required sample size.
Official sources
- NIST/SEMATECH e-Handbook of Statistical Methods: Sample Sizes Required.
- NIST/SEMATECH e-Handbook: Engineering Statistics Handbook.
Reviewed by the CalculatorHub team, edited by James Graham, 15 June 2026. See our methodology.