How to use the sample size calculator
- Choose whether to find the sample size or the margin of error.
- Enter the confidence level. 95% is the usual choice.
- Enter the margin of error you can accept (for example ±5%), or the sample size you have.
- Enter the expected proportion: your best guess at the share of people who will give a particular answer. Leave it at 50% if you have no idea.
- If the whole group you are studying is small, enter the population size. Leave it blank for a large or unknown population.
The sample size formula
z is the critical value of the normal distribution for your confidence level (1.96 for 95%), p is the expected proportion as a decimal, and E is the margin of error as a decimal. The answer is always rounded up, because rounding down would leave you just short of the precision you asked for. The second line is the finite population correction: when the sample is a noticeable share of the population, you need fewer responses. Without a population size, the last square root is left out.
Worked example
The calculator opens with 95% confidence, a ±5% margin of error and p = 50%:
- z for 95% confidence = 1.95996
- n₀ = 1.95996² × 0.5 × 0.5 ÷ 0.05² = 3.84146 × 0.25 ÷ 0.0025 = 384.15
- Rounded up: 385 responses
If the population is only 10,000 people, the correction gives 384.15 ÷ (1 + 383.15 ÷ 10,000) = 369.97, so 370 responses are enough. At 99% confidence, z rises to 2.57583 and the sample size to 664.
Going the other way, 400 responses at 95% confidence give a margin of error of 1.95996 × √(0.25 ÷ 400) = ±4.9%.
How the inputs change the answer
| Confidence | ±5% | ±3% | ±1% |
|---|---|---|---|
| 90% | 271 | 752 | 6,764 |
| 95% | 385 | 1,068 | 9,604 |
| 99% | 664 | 1,844 | 16,588 |
These figures assume p = 50% and a large population. Halving the margin of error roughly quadruples the sample size, because E is squared in the formula. The population size matters only when it is small: for 500 people at 95% and ±5% you need 218, but for a million you need 384, almost the same as for a whole country.
The expected proportion matters less than people think. p = 50% gives the largest possible sample; if you are confident the answer is near 20%, the sample size at 95% and ±5% falls to 246. Use 50% when you are unsure.
What sample size can't fix
The formula covers random sampling error only. It assumes every member of the population had an equal chance of being picked. A poll of 2,000 people who all follow the same social media account can be far less accurate than 400 people chosen at random. Low response rates, leading questions and people who refuse to answer cause bias that a bigger sample doesn't remove.
Frequently asked questions
What margin of error should I use?
For most surveys, ±5% at 95% confidence is a reasonable standard. Political polls often aim for ±3%, which needs about 1,068 responses. For a quick internal survey, ±10% with 97 responses may be enough to spot clear preferences.
Why does the population size barely matter?
Precision depends on how many people you ask, not on what share of the population they are. Once the population reaches the tens of thousands, the correction changes the answer by only a few responses: 370 for 10,000 people, 383 for 100,000 and 385 for an unlimited population. That is why national polls of around 1,000 people work.
Does this work for averages, not just percentages?
This calculator is for proportions, such as the share of people who answer yes. For a mean, the formula is n = (z × σ ÷ E)², where σ is the standard deviation you expect and E is the margin in the same units.
How many people should I invite?
Divide the sample size by the response rate you expect. If you need 385 completed surveys and about 20% of people reply, invite 385 ÷ 0.2 = 1,925 people.
Related calculators
- Confidence Interval Calculator — Confidence interval and margin of error for a mean (t or z) or a proportion, at any confidence level.
- Z-Score Calculator — The z-score and percentile of a value, the probability between two values, and the value at any percentile.
- Probability Calculator — P(A and B), P(A or B) and P(not A) for independent events, at least one success in n tries, and binomial odds.
Results are calculated in your browser. Double-check anything important before you rely on it. See our disclaimer.