Percentages and Math

Sample Size and Margin of Error Calculator

Plan a survey by finding the sample size for a margin of error and confidence level, or check the margin of error you already have.

Your numbers

What do you want

The plus or minus you can accept, such as 5.

Use 50 if you have no idea. It gives the largest sample.

Leave blank for a very large or unknown population.

Result

Sample size needed

385

95% confidence, plus or minus 5%

Required sample size
385
Before population correction
385
Z value used
1.96
How this was calculated
  1. z for 95% confidence is 1.96, the point with 97.5% of a normal curve below it.
  2. n0 = z^2 x p x (1 - p) / e^2 = 1.96^2 x 0.5 x 0.5 / 0.05^2 = 384.146.
  3. No population size was entered, so no correction is applied.
  4. The result is rounded up to the next whole person.
  • This assumes a simple random sample and a yes or no question. Response rates, clustering, subgroups and nonresponse bias are not modeled, so plan for more people than the minimum.

Calculated using SumPanda.com · https://sumpanda.com/sample-size-calculator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the sample size and margin of error calculator

  1. Choose Sample size needed to plan a survey, or Margin of error to check the accuracy of results you already have.
  2. Pick a confidence level, such as 95%.
  3. For sample size, enter the margin of error you can accept. For margin of error, enter the sample size.
  4. Enter the expected proportion, using 50 if you do not know, and the population size if it is small and known. Leave the population blank for a large or unknown group.

Formula

z = the point on the normal curve with (1 + confidence) / 2 of the area below it

n0 = z squared x p x (1 - p) / e squared

With a population N: n = n0 / (1 + (n0 - 1) / N)

Margin of error = z x square root of (p x (1 - p) / n), times square root of ((N - n) / (N - 1)) with a population

p is the expected proportion as a decimal and e is the margin of error as a decimal. The result is rounded up to a whole person.

Worked example

For 95% confidence, z is 1.96. With a 5% margin and p = 50%, n0 = 1.96 squared x 0.25 / 0.05 squared = 384.15, so you need 385 responses.

If the population is only 10,000 people, the correction gives 384.15 / (1 + 383.15 / 10,000) = 369.97, which rounds up to 370.

Going the other way, 1,000 responses at 95% confidence and p = 50% give a margin of error of plus or minus 3.1%, and it falls to 2.77% if the whole population is 5,000.

What confidence level and margin of error mean

The margin of error is how far a survey result might be from the true value for the whole group. Confidence level is how often a method built this way would capture the true value. A 95% confidence level with a 5% margin means that, if you repeated the survey many times, about 95 in 100 results would land within 5 percentage points of the truth.

Why 50% is the safe choice

The sample you need is largest when the proportion is 50%, so using 50 gives a number that is safe whatever the real answer turns out to be. If you have good reason to expect that, say, only 10% will answer yes, you can enter 10 and need a smaller sample. For a 3% margin the sample falls from 1,068 to 385 in that case.

Beyond the minimum

Not everyone you contact answers, so you may need to invite many more people than the sample size. If you want results for subgroups, each subgroup needs its own sample. The formula also assumes a random sample, which is hard to get in practice. To work with the results afterward, see the z-score calculator and the percentage calculator.

Assumptions and limits

  • The answer is a yes or no style proportion from a simple random sample.
  • The z value comes from the normal curve for the confidence level you pick.
  • A population is used only for the finite population correction and should be a whole number.
  • Nonresponse, clustering and weighting are not modeled.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

How many survey responses do I need?

For a 95% confidence level and a 5% margin of error, about 385 responses for a large population. A smaller margin or higher confidence needs more.

Does population size matter?

Only when the population is small. Above tens of thousands, the sample size barely changes. For a small group, the correction lowers the number you need.

What is a good margin of error?

Many surveys use 3% to 5%. The right choice depends on how precise you need to be and how many people you can reach, since halving the margin takes about four times the sample.

What does the expected proportion do?

It is your guess at the share who will give a particular answer. Sample size is largest at 50%, so it is the cautious choice when you are unsure.