Sample Size Calculator

Work out how many survey responses you need for a margin of error and confidence level, with the finite population correction, or the margin of error a sample gives.

The interactive tool loads here when JavaScript runs.

About this tool

What is the Sample Size Calculator?

Before you send a survey or start a study you need to know how many responses are enough. Enter the confidence level and the margin of error you can live with and this calculator gives the minimum sample size, for estimating a percentage (the usual survey case) or a mean. If you know the size of the population, it applies the finite population correction, which can cut the number sharply for small groups such as a company of 500 people.

It also runs in reverse: give it the sample you already have and it reports the margin of error. A table shows the sample size for common combinations of confidence level and margin, and an optional response rate turns the number of completed responses into the number of people you need to invite.

  • Sample size for a proportion or a mean
  • Finite population correction with before and after figures
  • Reverse mode: margin of error from a sample size
  • Response-rate adjustment for invitations
  • Lookup table for 90%, 95% and 99% across common margins
  • Formula shown with your numbers
Read the guide: Confidence Intervals and Sample Size, Worked Through

How to use the Sample Size Calculator

  1. Choose Survey (proportion) for percentages, Estimate a mean for averages, or Margin of error from n for the reverse.
  2. Pick the confidence level (95% is standard) and type the margin of error you want.
  3. Leave the expected proportion at 50% unless you have a reliable earlier estimate. For a mean, enter the expected standard deviation.
  4. Add the population size if the group is small and well defined, such as employees or members. Leave it blank for the general public.
  5. Optionally enter the expected response rate to see how many people to invite, then copy the result or share the link.

Worked examples

The classic survey size

Input

95% confidence, ±5%, p = 50%, large population

Output

385 responses (n₀ = 384.146)

This is the figure quoted in most research methods books. With a 25% response rate you would invite 1,540 people.

A staff survey

Input

95%, ±5%, p = 50%, population 500

Output

218 responses (217.49 rounded up)

The finite population correction cuts 385 to 218 because the sample is a large share of everyone. Without it you would survey far more people than needed.

Tighter margin, mid-sized population

Input

95%, ±3%, p = 50%, population 2,000

Output

697 responses (1,068 before the correction)

Going from ±5% to ±3% nearly triples the uncorrected size. The correction matters a lot here because 1,068 would be over half the population.

Margin of error of a 1,000-person poll

Input

Margin of error from n: n = 1,000, 95%, p = 50%

Output

± 3.099%

This is where the "plus or minus 3 points" on national polls comes from.

Background and insight

For a proportion the calculation is Cochran's formula, n₀ = z² p(1 - p) / E², where z is the critical value for the confidence level, p is the expected proportion and E is the margin of error as a fraction. At 95% confidence, ±5% and p = 0.5 this gives 1.959964² x 0.25 / 0.0025 = 384.15, which rounds up to the familiar 385. Using p = 0.5 maximises p(1 - p), so it is the safe choice when you have no prior estimate; if you expect around 20%, n drops to 246.

When the population N is not much larger than the sample, sampling without replacement gives more information per response, and the corrected size is n = n₀ / (1 + (n₀ - 1) / N). For N = 1,000 that turns 385 into 278; for N = 100 it is 80. For populations above about 100,000 the correction barely matters, which is why national polls of 1,000 people work for countries of any size.

For a mean the formula is n = (zσ / E)², where σ is the standard deviation you expect, typically from a pilot study or earlier research. The reverse calculation is E = z√(p(1 - p) / n), multiplied by √((N - n) / (N - 1)) for a finite population. All of these assume simple random sampling. Cluster or multi-stage designs need a design effect (often 1.5 to 2) on top, and none of the formulas fix bias from a poor sampling frame or low response.

Common use cases

  • Customer and employee surveys

    Find how many completed responses you need and how many invitations to send.

  • Academic research proposals

    Justify a sample size in a methods section with the formula and assumptions spelled out.

  • Quality sampling

    Decide how many items from a batch to inspect to estimate the defect rate within a target margin.

  • Reading a poll

    Check whether a reported margin of error is consistent with the sample size the poll used.

Tips and limitations

  • If you do not know p, leave it at 50%. Any other value gives a smaller sample, so guessing wrong can leave you short.
  • Sample size depends on the margin squared: halving the margin multiplies the sample by four.
  • The population size only matters when the sample is a noticeable fraction of it (more than about 5%).
  • Plan for subgroups. If you need ±5% for each of four regions, you need roughly 385 in each region, not 385 in total.
  • This calculator is for estimating a value. Comparing two groups (A/B testing) needs a power calculation, which also depends on the effect size you want to detect.

Frequently asked questions

How do you calculate sample size for a survey?

Use n = z² p(1 - p) / E². At 95% confidence (z = 1.96), a ±5% margin (E = 0.05) and p = 0.5, n = 384.15, so you need 385 responses. For a small population, divide by 1 + (n - 1) / N.

Why is 385 the standard sample size?

It is what Cochran's formula gives for 95% confidence, a ±5% margin of error and the most conservative proportion of 50%, in a large population. Change any of those and the number changes.

Does population size affect sample size?

Only when the population is small. For 1,000 people the 385 drops to 278 and for 100 people to 80, but for 1,000,000 people it is 384. Beyond about 100,000 the population size is almost irrelevant.

What margin of error should I use?

Five percent is common for internal and market surveys and 3% for published opinion polls. Pick the largest error that would not change the decision you are going to make with the results.

What sample size do I need for 99% confidence?

For ±5% and p = 50% in a large population, 664 responses. For ±3% it is 1,844.

How many people should I invite to a survey?

Divide the required number of responses by the response rate you expect. If you need 385 responses and expect 20% to reply, invite about 1,925 people.

Is there an in-depth guide to the Sample Size Calculator?

Yes. “Confidence Intervals and Sample Size, Worked Through” covers the background, how it works, common pitfalls and worked examples. Read the full guide.