How to calculate sample size
Square the z-score for your confidence level, multiply by p x (1 - p), and divide by the margin of error squared. This calculator uses that method, known as Cochran's formula, and then applies the finite population correction when you give a population size. Results are rounded up, because a fraction of a response is not enough.
- Pick a confidence level and find its z-score: 1.645 for 90%, 1.96 for 95%, 2.576 for 99%.
- Pick a margin of error, e, as a decimal: 5% is 0.05.
- Set the expected proportion, p. Use 0.5 unless you have a reason not to.
- Calculate z^2 x p x (1 - p) / e^2. At 95% and 5% that is 384.16.
- Adjust for population, N: divide by 1 + (n - 1) / N.
The calculator is for surveys and polls that estimate a percentage for one group. It is not for A/B tests, which compare two groups and need a different calculation based on the size of the difference you want to detect.
What do the inputs mean?
- Confidence level is how sure you want to be. At 95%, if you ran the same survey many times, about 95 in 100 would land within the margin of error of the true figure.
- Margin of error is the plus or minus around a result. If 60% of respondents say yes with a 5% margin, the true share is likely between 55% and 65%.
- Population size is the number of people the survey is meant to describe, such as all your customers. Leave it empty when the population is very large or unknown.
- Expected proportion is your best guess at the share who will give a particular answer. 50% produces the largest sample, so it is the safe choice.
How to read the result
The result is the number of completed responses, not the number of invitations. Divide by the response rate you expect to see how many people to ask: 370 responses at a 20% response rate means 370 / 0.20 = 1,850 invitations.
Precision is expensive. Halving the margin of error takes about four times the sample, as the table for 95% confidence and a large population shows.
| Margin of error | Sample size needed |
|---|---|
| 10% | 97 |
| 5% | 385 |
| 3% | 1,068 |
| 2% | 2,401 |
| 1% | 9,604 |
Population size matters much less than people expect. At 95% confidence and a 5% margin, a population of 1,000 needs 278 responses, 10,000 needs 370 and 100,000 needs 383. Past a few tens of thousands the answer barely moves.
What is a good sample size?
A good sample size is one that gives a margin of error small enough for the decision you are making. These are rules of thumb, not benchmarks:
- 95% confidence and a 5% margin is the usual starting point. Tighten it when a few points either way would change what you do.
- Small populations need a large share. With 100 customers you need 80 responses for the same precision, so in a small B2B customer base, aim to hear from nearly everyone.
- Size for the smallest group you will report on. If you plan to compare plans or regions, each segment needs enough responses of its own.
- A big sample does not fix a skewed one. The formula assumes a random sample. If only your happiest customers reply, more replies make the result more precise and no less wrong.
Common mistakes
- Counting invitations as the sample. Only completed responses count.
- Applying the overall margin to a segment. A subgroup of 50 inside a sample of 400 has a much wider margin of error.
- Ignoring who did not answer. Non-response can bias a result more than sample size can correct.
- Using it for a score, not a percentage. The formula fits yes or no style proportions. It is a reasonable guide for a metric like NPS, not an exact one.