Sample size calculator
Estimate the sample needed for a proportion or a mean at 90, 95, or 99 percent confidence, with an optional finite population correction.
Browser compute / no account / no upload
Estimate the sample size for a proportion or a mean at a chosen confidence level and margin of error. Add a population size to apply the finite population correction.
Method
- For a proportion, n0 = z^2 p(1-p) / e^2. For a mean, n0 = (z sigma / e)^2. The result is rounded up to the next whole respondent.
- When the population is finite, the correction n = n0 / (1 + (n0 - 1)/N) reduces the required sample. Leave the population blank for an unlimited population.
- The estimate assumes a simple random sample, a normal approximation, and no design effect. Multiply by the design effect for a cluster sample and divide by the expected response rate.
Reference: NIST/SEMATECH e-Handbook: Sample Sizes
Formulas
| Confidence | z | Typical use |
|---|---|---|
| 90% | 1.645 | Exploratory work |
| 95% | 1.960 | Most survey reporting |
| 99% | 2.576 | High-stakes estimates |
Worked example: a survey proportion
Example 1
95% confidence, 5 point margin
Problem
How many respondents are needed to estimate a proportion within 5 percentage points at 95 percent confidence when no prior estimate is available?
Solution
Use for the largest required sample.
Convert the margin to a proportion: .
Compute .
Round up to the next whole respondent.
Answer
385 respondents
Worked example: a finite population
Example 2
Correcting for 1,000 people
Problem
The same survey covers a population of 1,000. What sample is needed with the finite population correction?
Solution
Start from .
Apply with .
The denominator is .
Divide: .
Answer
278 respondents
Worked example: a mean
Example 3
Estimating a mean within 2 units
Problem
A pilot study suggests a standard deviation of 10. How many observations are needed to estimate the mean within 2 units at 95 percent confidence?
Solution
Use .
Substitute , , and .
Compute .
Answer
97 observations
Common mistakes
- Entering 5 for a 5 percentage point margin instead of 0.05.
- Using a prior proportion that is far from 0.5 without justification. Values near 0.5 require the largest sample.
- Forgetting the finite population correction when the population is small.
- Ignoring cluster design effects, which can multiply the required sample severalfold.
- Rounding down. Always round up to the next whole observation.
- Treating the result as a guarantee. It is a planning estimate under stated assumptions.
Limits and assumptions
Key takeaways
- Sample size depends on confidence, margin of error, and the planning proportion or standard deviation.
- Use p = 0.5 when no prior proportion is available.
- The finite population correction reduces the sample for small populations.
- Add nonresponse and design effects before fielding the study.