About this tool
Before you run a survey or experiment, you need to know how many responses are enough. Too few and the margin of error is too wide to be useful; too many and you waste time and money.
This calculator finds the minimum sample size for estimating a proportion or a mean to a chosen margin of error at a chosen confidence level. It shows the formula with your values substituted and, for small populations, how the finite population correction lowers the number you need.
How it works
For a survey question with a yes/no or percentage answer, choose a proportion. Enter the margin of error you can accept, such as ±5 percentage points, and the proportion you expect. If you have no idea, keep 50 %, which gives the largest, safest sample.
To estimate an average, choose a mean and enter an estimate of the standard deviation (from a pilot study or earlier data) and the margin of error in the same units. If you are sampling from a small, known population, enter its size to apply the finite population correction. The result is rounded up to the next whole number.
Example
For a poll with a ±5 % margin of error at 95 % confidence and an expected proportion of 50 %, , which rounds up to 385 responses. If the whole population is only 1,000 people, the correction gives , so 278 responses are enough.
To estimate an average with a standard deviation of about 15 to within ±5 at 95 % confidence, , so you need 35 observations.
Assumptions and limits
The sample size covers random sampling error only. It assumes a simple random sample; cluster or stratified designs need a design effect. It does not account for non-response, so invite more people than the result if you expect some not to answer, and it cannot fix bias from who chooses to respond.
For means, the result depends on your guess of the standard deviation: an underestimate gives too small a sample. The formulas use the normal approximation, which is less accurate for very small samples or for expected proportions close to 0 % or 100 %.
Frequently asked questions
Why use 50 % as the expected proportion?
The term is largest when , so 50 % gives the most conservative sample size. If earlier data suggest a proportion such as 20 %, entering it gives a smaller sample with the same margin of error.
Why is 385 the standard survey sample size?
It is the answer for a ±5 % margin of error at 95 % confidence with a 50 % expected proportion and a large population. Because the population hardly matters once it is large, 385 works for a city or a whole country alike.
When should I use the finite population correction?
When your sample would be a noticeable share of the whole population, roughly 5 % or more, for example surveying the employees of one company. For large populations the correction makes almost no difference.
How does the margin of error affect the sample size?
The sample size grows with the square of the precision: halving the margin of error from ±5 % to ±2.5 % roughly quadruples the sample, from 385 to 1,537.
What if I expect people not to respond?
Divide the result by the expected response rate. If you need 385 responses and expect 40 % to reply, invite about people.
Link with your values
Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.
| Parameter | Value | If omitted |
|---|---|---|
kindEstimate | one of: proportion, mean | default proportion |
confidence_level_pctConfidence level | percent: 6.5 means 6.5%; allowed > 0 – < 100 | default 95 |
margin_pctMargin of error | percent: 6.5 means 6.5%; allowed > 0 – < 100; used with kind = proportion | required |
proportion_pctExpected proportion | percent: 6.5 means 6.5%; allowed > 0 – < 100; used with kind = proportion | counted as 50 |
sdStandard deviation (σ) | number; allowed > 0; used with kind = mean | required |
marginMargin of error (E) | number; allowed > 0; used with kind = mean | required |
populationPopulation size (optional) | whole number; allowed 1–1000000000000 | optional |
Examples
?margin_pct=3&confidence_level_pct=99?sd=12&margin=2&population=5000
Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.
Result elements: [data-result-block="sample_size_calculator"]