Sample Size Calculator

Work out how many people to survey for a result you can trust, or check the margin of error of a sample you already have.

Find
Common choices: 90, 95 or 99.
The ± range you can accept, e.g. 5 for ±5 percentage points.
Use 50% if you have no prior estimate. It gives the largest, safest sample.
Leave blank for a very large or unknown population.

Result

Required sample size
385
  • Critical value (z)1.959964
  • Sample size before rounding384.1459
  • PopulationUnlimited
  • n₀ = z² × p(1 − p) ÷ E² = 1.96² × 0.25 ÷ 0.05² = 384.1459
  • No population size entered, so no finite population correction is applied.
  • This is the number of completed responses you need. If you expect only some people to respond, divide by the expected response rate to get how many to invite.

How to use the calculator

Choose Sample size to plan a survey, or Margin of error to check one you have already run. Then fill in:

  • Confidence level: usually 95%. Use 90% for a quick read or 99% when a wrong conclusion would be costly.
  • Margin of error: the ± band you can accept, in percentage points.
  • Population proportion: your best guess at the share who will answer “yes”. Leave it at 50% if you do not know.
  • Population size: optional. Fill it in only when the group is small enough that you might survey a sizeable part of it.

The formula

The calculator uses Cochran’s formula for a proportion:

n₀ = z² × p(1 − p) ÷ E²

Here z is the critical value for the confidence level (1.96 for 95%), p is the proportion as a decimal and E is the margin of error as a decimal. When you enter a population size N, it applies the finite population correction:

n = n₀ ÷ (1 + (n₀ − 1) ÷ N)

The result is always rounded up, because rounding down would give a margin slightly wider than you asked for.

In reverse, the margin of error for a sample of n is E = z × √(p(1 − p) ÷ n), multiplied by √((N − n) ÷ (N − 1)) when the population size is known.

The calculator works out z exactly from the normal distribution, so any confidence level works, not only the ones printed in tables.

Worked example

With the default settings, 95% confidence, a ±5% margin of error and a 50% proportion:

  1. Critical value: z = 1.959964.
  2. Variability term: p(1 − p) = 0.5 × 0.5 = 0.25.
  3. Sample size: n₀ = 1.959964² × 0.25 ÷ 0.05² = 3.841459 × 0.25 ÷ 0.0025 = 384.15.
  4. Round up: you need 385 completed responses.

Now suppose the whole population is a company of 1,000 staff. The correction gives 384.15 ÷ (1 + 383.15 ÷ 1,000) = 277.73, so 278 responses are enough.

Switch to Margin of error with a sample of 400 and an unlimited population, and the margin is 1.959964 × √(0.25 ÷ 400) = ±4.9%.

How the inputs change the answer

The margin of error shrinks with the square root of the sample size. Halving the margin from ±5% to ±2.5% needs four times the sample, about 1,537 responses. Moving from 95% to 99% confidence raises the requirement from 385 to 664. A lopsided proportion helps: if you expect about 10% to say “yes”, p(1 − p) is 0.09 instead of 0.25, and 139 responses give ±5%.

To see how an interval for a mean is built once your data is in, use the standard deviation calculator to find the spread first.

Limitations

  • The formula assumes a simple random sample. Convenience samples, such as people who choose to answer an online poll, can be biased however large they are.
  • It covers estimating a single proportion. Comparing two groups, or estimating a mean, needs a different formula.
  • The normal approximation is less reliable when the sample is very small or the proportion is close to 0% or 100%.
  • Sampling error is only one source of error. Poorly worded questions and people who do not respond can matter more.

Frequently asked questions

Why is 50% the default proportion?

The term p(1 − p) is largest when p is 50%, so 50% gives the biggest sample size. If you have no reliable earlier estimate of the answer, it is the safe choice. With a good prior estimate, such as 20%, you can use it and need fewer responses.

Does the population size matter?

Only when the sample is a noticeable share of the population. For a city of a million people, 385 responses give about ±5% at 95% confidence, which is almost the same as for a country of 300 million. For a group of 1,000, the correction brings the requirement down to 278.

What is the difference between the confidence level and the margin of error?

The margin of error is the width of the ± band around your result. The confidence level is how often a band built this way would contain the true value if you repeated the survey many times. Raising either one makes the required sample larger.

Do I need to survey more people than the sample size?

Usually, yes. The result is the number of completed responses. If you expect 25% of invited people to reply, invite four times as many.

Last reviewed: