Sample Size Calculator

Survey sample size depends on confidence level, acceptable error, expected response distribution and population assumptions. Raising confidence or lowering error usually requires more responses.

Find the Sample Size

Computes the minimum number of samples needed to meet your desired confidence level and margin of error.

Find the Margin of Error

Computes the margin of error (confidence interval) for a survey or observation you've already run.

Quick answer. Sample size depends on confidence level, margin of error and the expected proportion. For a large population, 95% confidence, 50% expected proportion and a margin of error of ±5%, you need 385 responses. Cutting the margin in half takes about four times as many.

What sample size means for a survey

A survey cannot ask everyone, so it asks a sample and uses it to estimate the whole population. The margin of error says how far the sample result is likely to be from the true value, and the confidence level says how sure you want to be that the true value falls inside that range. The calculator tells you how many responses you need to hit both targets, or the margin of error you get from a sample you already have.

The formula

For a proportion (the share of people who answer “yes”), the starting sample size is n₀ = z² × p × (1 − p) ÷ e², where z is the value for your confidence level, p is the expected proportion and e is the margin of error as a decimal. For a limited population of size N, it is reduced by the finite population correction: n = n₀ ÷ (1 + (n₀ − 1) ÷ N). The result is always rounded up.

Worked example with the default numbers

For a large population, 95% confidence (z = 1.96), p = 50% and a margin of error of ±5%: n₀ = 1.96² × 0.5 × 0.5 ÷ 0.05² = 384.16, which rounds up to 385 responses.

If the population is limited to 1,000 people, the correction brings the number down to 278. A small population needs a much larger share of its members, while for a very large population the answer barely changes.

How the margin of error drives the sample size

Margin of errorResponses needed (95% confidence, p = 50%)
±1%9,604
±2%2,401
±3%1,068
±4%601
±5%385
±7%196
±10%97
Responses needed at 95% confidence for each margin of errorHalving the margin of error from 10% to 5% takes the sample from 97 to 385, roughly four times as many responses.Responses needed at 95% confidence for each margin of error±1%9,604±2%2,401±3%1,068±5%385±10%97
The relationship is inverse-square: to cut the margin in half, you need about four times as many responses.

Confidence level and expected proportion

Confidence levelz-valueResponses at ±5%
80%1.28164
90%1.65273
95%1.96385
99%2.58666
Responses needed at a margin of error of 5%Going from 95% to 99% confidence raises the sample from 385 to 666.Responses needed at a margin of error of 5%90% confidence27395% confidence38599% confidence666
Higher confidence is more expensive. Most surveys settle for 95%.

The expected proportion also matters. If you have no idea, use 50%, the most cautious choice because it needs the largest sample. If earlier data suggests a different value, you need fewer responses:

Expected proportionResponses at 95% confidence and ±5%
10%139
20%246
30%323
50%385

Finding the margin of error from a sample you have

The second tool works backwards. With 400 responses, 95% confidence and p = 50%, the margin of error is about ±4.9%. So if 60% of respondents answer yes, the true figure is probably between about 55% and 65%.

Planning example: surveying customers

A company wants to survey its 5,000 customers at 95% confidence and a margin of error of ±5%. With the finite population correction, it needs 357 completed responses. If past surveys got a 40% response rate, it should invite about 893 customers (357 ÷ 0.40, rounded up). For the same goal across a very large population the number would be 385, so a small, known population needs a larger share of its members but fewer total responses.

When the formula does not apply

  • Non-random samples: a self-selected online poll can be biased no matter how big it is. The formula assumes a random sample.
  • Subgroups: the margin applies to the whole sample. Results for a subgroup (for example, one age band) have a larger margin because fewer people are in it.
  • Non-response: if only 30% of people reply, you must contact about three times as many to get the responses you need.
  • Averages instead of proportions: measuring a mean needs the standard deviation, not p.
  • Complex designs: clustered or weighted surveys usually need more responses than this simple formula.

Common mistakes

  • Using the sample size for the whole survey when you need enough responses for each subgroup.
  • Forgetting non-response when planning how many people to invite.
  • Entering the population size for a very large group, which adds nothing.
  • Treating the margin of error as the only source of error. Bad questions and biased sampling are bigger risks.
  • Entering 5 when the field expects a percentage and vice versa.

How to read your result

The number is the minimum number of valid responses. Plan to invite more people than that to allow for non-response, and use the same confidence level when reporting results. If the required sample is too large, accept a wider margin of error or lower confidence level, or narrow the question to a smaller population.

This calculator assumes a simple random sample. Survey design, question wording and response rates can matter more than the sample size itself.

What to do next

Common questions

Why does population size stop mattering above a certain point?

The finite population correction approaches 1 as the population gets large compared with the sample. Once the population is around 20 times the sample or more, the correction is negligible, so very large or unlimited populations give essentially the same answer.

What confidence level should I use?

Most surveys use 95%. Use 99% when mistakes are costly, but remember it needs a noticeably larger sample. 90% is sometimes used for quick, low-stakes estimates.

Why use 50% for the expected proportion?

It is the most conservative choice because p × (1 − p) is largest at 50%, so it gives the biggest sample size. If you have a good estimate from earlier work, a different value gives a smaller sample.

What is the margin of error?

It is the plus-or-minus range around your sample result. If 60% of a sample says yes with a margin of ±5%, the true share is probably between 55% and 65% at the stated confidence level.

Is a bigger sample always better?

It reduces random error, but with diminishing returns, and it cannot fix bias from a poor sampling method or badly worded questions.

How many responses do I need for subgroups?

Calculate the sample size for each subgroup you want to report on separately. The margin of error for a subgroup is based on its own number of responses.

Sources: NIST/SEMATECH e-Handbook: Sample sizes required (for a mean)

More Math Calculators

Pick another tool to jump straight to it.