Sample Size Calculator
This calculator tells you how many responses you need to collect to achieve a target margin of error at a chosen confidence level. Before you run a survey, conduct an experiment, or commission a poll, you need to know the minimum sample size that will make your results statistically meaningful. Too small a sample and your margin of error will be too wide to draw reliable conclusions; too large and you waste time and money collecting more data than necessary. The required sample size depends on three things: the confidence level (how certain you want to be that your interval captures the true value), the margin of error (how wide a range you are willing to accept around your estimate), and the estimated proportion of the population with the characteristic you are measuring. When you have no prior estimate of the proportion, using 0.5 gives the most conservative and largest sample size, which ensures your results will be reliable regardless of what the true proportion turns out to be. The formula is n = (z squared times p times (1 minus p)) divided by e squared, where z is the critical value for your chosen confidence level and e is your desired margin of error as a decimal. Enter the confidence level, your target margin of error as a percentage, and the estimated proportion, and the calculator rounds the result up to the nearest whole number. This tool is useful for researchers designing studies, business analysts planning surveys, and students learning statistical methods. This calculator does not apply a finite population correction.
How it works
The formula for sample size when estimating a proportion is n = z² × p × (1 − p) ÷ e², where z is the critical value corresponding to the confidence level, p is the estimated proportion, and e is the margin of error expressed as a decimal. The result is always rounded up to the nearest whole number because you cannot survey a fraction of a person. The critical z-values are 1.6449 for 90%, 1.9600 for 95%, and 2.5758 for 99% confidence.
Worked example
You want to survey customers with 95% confidence and a 5% margin of error, and you have no prior estimate of the proportion so you use p = 0.5. The critical z is 1.96. Applying the formula: n = (1.96² × 0.5 × 0.5) ÷ 0.05² = (3.8416 × 0.25) ÷ 0.0025 = 0.9604 ÷ 0.0025 = 384.16, rounded up to 385. You need at least 385 completed responses.
Related calculators
- Confidence Interval Calculator: once you have your data, build a CI around your sample mean.
- Z-Score Calculator: find the z-score and percentile for an individual observation.
- Normal Distribution Calculator: find cumulative probabilities from the normal curve.
- Percent Error Calculator: measure the deviation of an observed result from an expected value.