Sample Size Calculator

At 95% confidence, σ = 15 and a margin of ±5 need n = 35. A proportion with a ±5% margin needs n = 385, or 278 from a population of 1,000.

Did this solve your problem?
Prefer us on Google

How to use

  1. Choose "Mean" if you measure a number such as weight or time, or "Proportion" if you count a share such as yes/no answers.
  2. Pick a confidence level, then enter the standard deviation (mean) or the expected proportion (use 50% if unsure) and the margin of error you can accept.
  3. Add the population size if it is small and known. To go the other way, choose "Margin of error" and enter the sample size you have.

How it works

Mean: n = (z · σ / E)², where σ is the standard deviation and E the margin of error in the same unit.

Proportion: n = z² · p(1 − p) / E², with p and E as fractions. p = 0.5 gives the largest n, so use it when you have no estimate.

z is the two-sided critical value z = Φ⁻¹(1 − α/2) for confidence 1 − α, computed from the inverse normal distribution (1.96 for 95%, 2.5758 for 99%).

Finite population correction: n′ = n / (1 + (n − 1) / N). It matters when the sample is a noticeable share of the population N. The unrounded n goes into the correction.

Every sample size is rounded up, because rounding down would give a margin of error slightly larger than the one you asked for.

Margin of error from a sample: E = z · σ / √n (mean) or E = z · √(p(1 − p) / n) (proportion), multiplied by √((N − n) / (N − 1)) when N is given.

Critical values by confidence level

z comes from the inverse of the standard normal distribution, the same values as the NIST/SEMATECH e-Handbook table. The last column is the sample size for a proportion of 50% with a ±5% margin.

Confidence levelzn (p = 50%, ±5%)
80%1.2816165
85%1.4395208
90%1.6449271
95%1.9600385
98%2.3263542
99%2.5758664
99.9%3.29051,083

Sample size by population

95% confidence, p = 50%. The correction cuts the sample sharply for small populations and barely changes it above 100,000.

Margin of errorN = 500N = 1,000N = 10,000N = 100,000Unlimited
±10%8188969697
±5%218278370383385
±3%3415179651,0561,068
±2%4147071,9372,3452,401
±1%4769064,9008,7639,604

Checked against reference values

  • Mean, 95%, σ = 15, E = 5: (1.95996 × 15 / 5)² = 34.57, so n = 35.
  • Proportion, 95%, E = 5%: 1.95996² × 0.25 / 0.0025 = 384.15, so n = 385, the figure quoted in most survey textbooks.
  • Population 1,000: 384.15 / (1 + 383.15 / 1000) = 277.7, so n = 278. Correcting the rounded 385 instead would give 279.
  • The z values match the NIST table to at least nine decimal places, and the automated tests check every row above.

Assumptions

The formulas assume simple random sampling and a sampling distribution close to normal. For clustered or stratified designs, multiply by the design effect. For very small samples of a mean, a t value would give a slightly larger n.

FAQ

What sample size do I need for 95% confidence and a 5% margin of error?

385 for a proportion with p unknown (p = 0.5). With a population of 1,000 it drops to 278, and with 10,000 to 370.

Where do I get the standard deviation?

From a pilot study, earlier research or historical data. If you only know the range, range / 4 is a common rough guess. A larger σ gives a larger, safer sample.

Why use 50% when I do not know the proportion?

p(1 − p) is largest at p = 0.5, so 50% gives the biggest sample size. Whatever the true proportion is, that sample will be large enough.

When should I enter the population size?

When you know it and the sample would be more than about 5% of it. For large or unknown populations, leave it empty: the correction then changes almost nothing.

Does this account for people who do not respond?

No. The result is the number of completed responses you need. Divide it by the expected response rate to get how many people to invite, for example 385 / 0.4 ≈ 963.

Why is the answer rounded up?

A sample of 34 would give a margin slightly wider than requested, so the calculator always rounds up to the next whole number.