To calculate sample size for a survey, use n = z² × p(1 − p) ÷ e², where z is the critical value for your confidence level (1.96 for 95%), p is the expected proportion (0.5 if unknown) and e is the margin of error as a decimal. At 95% confidence and ±5%, that gives 384.16, so you need 385 responses.
That number surprises people in both directions. It feels too small for a country of 330 million and too large for a company of 500 employees. Both reactions point at the same two ideas: precision depends on the size of the sample, not the population, until the sample becomes a big slice of the population. This guide covers Cochran’s formula step by step, the finite population correction, sample size for a mean, response rates, and why chasing a tiny margin of error is usually a waste of money.
To skip the arithmetic, use our sample size calculator. It applies the correction for small populations and converts the result into the number of invitations to send.
The three inputs you need to choose
Every sample size calculation for a survey proportion rests on three choices. None of them comes from the data; you decide them before you collect anything.
1. Margin of error (e)
The margin of error is the ± range you are willing to accept around your result. If 62% of respondents prefer a new design and your margin is ±5 points, the true figure is plausibly between 57% and 67%. Political polls usually aim for ±3 to ±4 points; internal feedback surveys can live with ±5 to ±10. The margin of error calculator works the other way round if you already have a sample and want to know how precise it is.
2. Confidence level (z)
The confidence level is how often the method should capture the true value if you repeated the survey many times. It enters the formula through its critical value z:
- 90% confidence: z = 1.645
- 95% confidence: z = 1.96
- 99% confidence: z = 2.576
95% is the convention in most fields. The critical value calculator gives z for any other level.
3. Expected proportion (p)
The term p(1 − p) measures how variable the answers will be. It peaks at p = 0.5, where p(1 − p) = 0.25. If you have no idea what the answer will be, use 0.5. It is the conservative choice and guarantees your margin of error will be no worse than planned. If a previous survey found about 20% saying yes, using p = 0.2 shrinks the required sample noticeably.
How to calculate sample size with Cochran’s formula
The standard formula for estimating a proportion was popularised by William Cochran in his 1953 textbook Sampling Techniques, and it is still what most survey tools use:
n₀ = z² × p × (1 − p) ÷ e²
Worked example: a customer satisfaction survey
You want to estimate the share of customers who would recommend your service, at 95% confidence with a ±5% margin, and you have no prior estimate.
- z = 1.96, so z² = 3.8416
- p = 0.5, so p(1 − p) = 0.25
- e = 0.05, so e² = 0.0025
- n₀ = 3.8416 × 0.25 ÷ 0.0025 = 384.16
- Always round up: 385 completed responses
Round up, never to the nearest whole number. Rounding 384.16 down to 384 would give a margin slightly wider than ±5%.
If last year’s survey showed about 20% of customers were detractors and that is what you are estimating, p = 0.2 gives p(1 − p) = 0.16, and n₀ = 3.8416 × 0.16 ÷ 0.0025 = 245.86, so 246 responses. That is 36% fewer, simply from having a reasonable prior estimate.
How confidence and margin of error change the answer
The table below shows the required sample for a large population with p = 0.5. These are the numbers worth memorising.
| Margin of error | 90% confidence | 95% confidence | 99% confidence |
|---|---|---|---|
| ±10% | 68 | 97 | 166 |
| ±5% | 271 | 385 | 664 |
| ±3% | 752 | 1,068 | 1,844 |
| ±2% | 1,692 | 2,401 | 4,148 |
| ±1% | 6,766 | 9,604 | 16,590 |
Two patterns stand out. First, halving the margin of error roughly quadruples the sample, because e is squared in the denominator: ±5% needs 385, ±2.5% would need about 1,537. Second, moving from 95% to 99% confidence adds about 72% more respondents. That is why most national polls settle on around 1,000 to 1,500 interviews: going from ±3% to ±2% would more than double the cost for one point of precision.
The finite population correction
Cochran’s basic formula assumes the population is effectively infinite. When your sample is more than about 5% of the population, you can apply the finite population correction (FPC) and get away with fewer responses:
n = n₀ ÷ (1 + (n₀ − 1) ÷ N)
Worked example: an employee survey
A company with N = 2,000 employees wants ±5% at 95% confidence. Starting from n₀ = 384.16:
- (n₀ − 1) ÷ N = 383.16 ÷ 2,000 = 0.1916
- n = 384.16 ÷ 1.1916 = 322.4
- Round up: 323 responses
For a team of 500, the same calculation gives 218. For a city of 100,000, it gives 383, barely different from the infinite case. That is the answer to the “how can 1,000 people represent a whole country” question: once the population is large, its size hardly matters. A spoonful of soup tells you how salty the pot is whether the pot holds one liter or a hundred, provided you stir first. The stirring is random sampling.
Sample size for estimating a mean
If you are measuring a number rather than a yes/no share (average spend, average commute, average blood pressure), use the standard deviation instead of p(1 − p):
n = (z × σ ÷ E)²
where σ is the expected standard deviation and E is the margin of error in the original units.
Example: you want to estimate average weekly grocery spend to within ±$3 at 95% confidence, and a pilot suggests σ ≈ $15. n = (1.96 × 15 ÷ 3)² = 9.8² = 96.04, so 97 households.
The hard part is guessing σ. Use a pilot study, a previous survey or published data. If you have a range instead, a rough rule is σ ≈ range ÷ 4. The standard deviation calculator gives σ from pilot data, and our guide to standard deviation explained covers what it means. The logic is the same as for proportions: the margin of error is z times the standard error, and you pick n to make that product small enough.
From responses to invitations
The formulas give you completed responses, not people contacted. If you expect 20% of invitees to answer, you need to send 323 ÷ 0.20 = 1,615 invitations to the employee survey above. Online surveys often see response rates well below that, so a realistic estimate here matters more than any decimal in the formula.
Low response creates a bigger problem than needing more invitations: nonresponse bias. If the people who answer differ systematically from those who do not, no sample size fixes it. A survey of 10,000 self-selected volunteers can be less accurate than a random sample of 400. The US Census Bureau’s American Community Survey methodology shows how much effort large official surveys put into follow-up and weighting to keep response representative.
Why bigger is not always better
More responses always shrink the margin of error, but with sharply diminishing returns. At p = 0.5 and 95% confidence:
- n = 100 gives ±9.8%
- n = 400 gives ±4.9%
- n = 1,000 gives ±3.1%
- n = 2,500 gives ±1.96%
Going from 100 to 400 cuts the margin in half. Going from 1,000 to 2,500 shaves off barely a point. Past a certain size, money is better spent on question design, follow-up reminders and reaching under-represented groups, because those reduce errors the margin of error does not even measure. The margin of error only covers random sampling error. It says nothing about leading questions, a bad sampling frame or people misremembering. The NIST/SEMATECH e-Handbook of Statistical Methods is a solid free reference for the statistics behind all of this.
There is one case where you should plan for a larger sample: subgroups. If you want ±5% for each of four regions separately, you need roughly 385 in each region, not 385 in total.
Experiments and A/B tests
Comparing two groups (for example, a control and a new checkout page) needs a different calculation based on statistical power, the minimum effect you care about and the baseline rate. The power analysis calculator handles that case, and the A/B test calculator analyses the results once they are in.
Common mistakes
- Scaling the sample to the population. 10% of the population is not a rule. A city of 1 million and a country of 100 million need almost the same sample.
- Rounding down. Always round up to the next whole respondent.
- Forgetting the response rate. The formula gives completes; plan invitations around realistic response.
- Using p = 0.5 when you have good prior data. It is safe but can overshoot by a third or more.
- Ignoring subgroups. Each group you want to report separately needs its own sample.
- Treating a big convenience sample as accurate. Random selection matters more than raw size.
Frequently asked questions
What is a good sample size for a survey?
For most purposes, 385 responses give ±5% at 95% confidence for any large population, and about 1,068 give ±3%. Smaller populations need fewer once you apply the finite population correction.
Why use 0.5 for the proportion?
p(1 − p) is largest at 0.5, so it produces the biggest, safest sample size. If you have a reliable estimate from earlier research, using it gives a smaller sample with the same precision.
Does population size affect sample size?
Only when the sample is a meaningful share of the population, roughly 5% or more. For large populations, the required sample is almost the same whether the population is 100,000 or 100 million.
How do I calculate sample size in Excel?
Use =ROUNDUP(NORM.S.INV(0.975)^2*0.5*0.5/0.05^2,0) for 95% confidence and ±5%, which returns 385. Swap 0.975 for 0.995 to get 99% confidence.
What sample size do I need for 99% confidence?
At ±5% and p = 0.5, you need 664 responses. At ±3%, you need 1,844.
Pick your margin of error and confidence level first, use 0.5 for p unless you have good data, run Cochran’s formula, correct for small populations and divide by your expected response rate. That gives a defensible number in a few minutes. Then spend the rest of your planning time on who you reach and how you ask, because that is where most survey error really comes from. For more on reading the results as percentages, see how to calculate percentage.
