Sample size calculator. How many survey responses you need.

Sample size is the number of completed responses a survey needs for its results to be reliable. Enter a confidence level, a margin of error and your population size to calculate it, or switch the calculator to find the margin of error a sample gives you.

By Brady Heinrich · Updated

Solve for

Usually 90, 95 or 99.

How far the result may sit from the truth, plus or minus.

Leave empty for a very large or unknown population.

Keep 50 if you do not know. It gives the largest sample.

Sample size needed370

Completed responses for a result within 5% either way, at 95% confidence.

Z-score
1.96
For an unlimited population
385
Share of the population
3.7%
The formula

Sample size = z^2 x p x (1 - p) / e^2, then adjusted for population: n / (1 + (n - 1) / N)

A worked example

For 95% confidence (z = 1.96), a 5% margin of error and p = 0.5: 1.96^2 x 0.5 x 0.5 / 0.05^2 = 384.16, so 385 responses. For a population of 10,000: 384.16 / (1 + 383.16 / 10,000) = 369.98, so 370 responses.

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.

  1. Pick a confidence level and find its z-score: 1.645 for 90%, 1.96 for 95%, 2.576 for 99%.
  2. Pick a margin of error, e, as a decimal: 5% is 0.05.
  3. Set the expected proportion, p. Use 0.5 unless you have a reason not to.
  4. Calculate z^2 x p x (1 - p) / e^2. At 95% and 5% that is 384.16.
  5. 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 errorSample 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

  1. Counting invitations as the sample. Only completed responses count.
  2. Applying the overall margin to a segment. A subgroup of 50 inside a sample of 400 has a much wider margin of error.
  3. Ignoring who did not answer. Non-response can bias a result more than sample size can correct.
  4. 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.

How people search for a sample size calculator

  • sample size calculator6,600 a month

US monthly searches, Google Ads keyword data.

Questions

What is the sample size formula?

Sample size = z^2 x p x (1 - p) / e^2, where z is the z-score for the confidence level, p is the expected proportion and e is the margin of error. For a known population N, divide the result by 1 + (n - 1) / N.

What sample size do I need for 95% confidence?

With a 5% margin of error and a large population, 385 responses. With a 3% margin it is 1,068. Smaller populations need fewer: 370 for a population of 10,000 at a 5% margin.

Why does the calculator use 50% as the proportion?

Because p x (1 - p) is largest at 0.5, so it gives the biggest sample and the answer is safe whatever the true share turns out to be. If you expect a share near 10% or 90%, a smaller sample will do.

Does a bigger population need a much bigger sample?

No. Sample size grows quickly for small populations and then levels off. At 95% confidence and a 5% margin, it never rises above 385 however large the population gets.

Can I use this for an A/B test?

No. An A/B test compares two groups, so its sample size depends on the baseline rate, the smallest difference you want to detect and statistical power. This calculator sizes a survey that estimates one percentage.

Keep reading

Building something ambitious? Let's talk.

We reply within one business day.