Statistics Concepts
Sample Size Explained: How Many Responses Do You Need?
The sample size you need depends on three things: how precise the estimate must be (the margin of error), how confident you want to be, and how variable the data are. For a proportion at 95% confidence with the safest assumption p = 0.5, ±5% needs 385 responses and ±3% needs 1,068. Halving the margin of error quadruples the sample.
Sample size for a proportion
n₀ = z² × p × (1 − p) / E²
z = 1.96 for 95% confidence, p = expected proportion, E = margin of error
With no idea of p, use 0.5: it makes p(1 − p) as large as it can be (0.25), so the answer is on the safe side. At 95% confidence:
| Margin of error | Required sample size (p = 0.5) |
|---|---|
| ±10% | 97 |
| ±5% | 385 |
| ±3% | 1,068 |
| ±2% | 2,401 |
| ±1% | 9,604 |
Because E is squared in the formula, going from ±2% to ±1% multiplies the sample by exactly four. If you do have a credible estimate of p, use it: for p = 0.3 and E = 5% the formula gives 322.69, so 323 responses instead of 385.
The sample size calculator uses the exact z of 1.959964 instead of the rounded 1.96 of the formula above, so its unrounded n₀ is 384.1459 for p = 0.5 and E = 5% rather than 384.16 (and 322.6825 rather than 322.69 for p = 0.3). Rounded up, the answers are the same: 385 and 323.
Correcting for a small population
When the sample is a large share of a finite population of size N, the required sample shrinks:
n = n₀ / (1 + (n₀ − 1) / N)
For N = 2,000, E = 5% and p = 0.5, n₀ = 384.16 and n = 322.4, which rounds up to 323. For N = 100,000 the same calculation gives 383, so the correction is negligible for large populations. The sample size calculator applies it when you enter a population size.
Sample size for a mean
n = (z × σ / E)²
Suppose σ is about 15 and you want the mean within E = 3 at 95% confidence. Then n = (1.96 × 15 / 3)² = 9.8² = 96.04, so 97. If σ is only an estimate, the NIST Engineering Statistics Handbook replaces z with the t critical value for n − 1 degrees of freedom, which itself depends on n. The answer is the smallest n with n ≥ (t × σ / E)²: here 98 respondents fall short (the requirement at n = 98 is 98.48) and 99 is enough, slightly more than the z formula because t is larger than z when n is small. The margin of error calculator shows the reverse calculation, the precision you get from a given n.
Sample size for comparing groups
Comparing two groups is a hypothesis test, so the sample size comes from a power analysis. Detecting a medium standardised difference (d = 0.5) with 80% power at α = 0.05 (two-sided) needs 62.79 per group by the normal approximation and 64 per group with the exact t distribution. Smaller effects need far more: see statistical power explained and effect size explained.
Allow for dropout and non-response
The formulas give the number of usable responses. If only a fraction r of the people you contact will answer, contact n / r people. To end with 385 responses when 80% respond, contact 385 / 0.8 = 481.25, so 482 people.
Common mistakes
- Using 30 as a universal minimum. Precision depends on σ or p and on the margin of error.
- Sampling a percentage of the population. Absolute sample size matters, not the share of the population, until the population is small.
- Ignoring bias. A larger sample reduces random error only; a biased sampling method stays biased, as the margin of error guide explains.
- Not planning for subgroups. Each subgroup you want to report needs its own precision, so the total may be several times larger.
Try the Sample Size Calculator
Sample size for a proportion or a mean, with finite population correction and margin of error from n.
Try the Statistical Power Calculator
Required sample size for t tests, proportions, ANOVA and correlation at a chosen power.
Frequently Asked Questions
What sample size do I need for a survey?
For a large population at 95% confidence and the safest assumption p = 0.5, you need 385 responses for a margin of error of ±5%, 1,068 for ±3% and 2,401 for ±2%. The requirement depends on the margin of error and confidence level you want, not on how large the population is.
Is a sample of 30 enough?
There is no general rule that 30 is enough. The size that you need depends on the variability of the data, the precision you want and, for tests, the effect size and power. A sample of 30 gives a margin of error of about ±18% for a proportion near 0.5 at 95% confidence, which is too wide for most decisions.
Does the population size matter?
Only when the sample is a noticeable share of the population. For a population of 100,000 the requirement for ±5% is 383, almost the same as 385 for an infinite population. For a population of 2,000 it drops to 323. The correction is n = n₀ / (1 + (n₀ − 1) / N).
Why do 385 and 1,068 appear so often?
They come from assuming p = 0.5, which gives the largest possible value of p(1 − p) and therefore the largest sample size. It is the safe choice when you have no idea of the true proportion. If you do have a credible estimate, such as p = 0.3, you need fewer responses (323 for ±5%).
How do I choose the standard deviation when estimating a mean?
Use a value from a pilot study, an earlier survey or published research on a similar population. There is no valid way to compute the required sample size without some estimate of σ. If σ itself is only estimated, the t-based iteration used by the sample size calculator gives a slightly larger n than the z formula.
How do I find the sample size for comparing two groups?
Use a power analysis rather than a margin of error. You need the effect size you want to detect, the significance level and the power. Detecting a medium standardised difference (d = 0.5) with 80% power in a two-sided t test takes 64 people per group.
Should the result be rounded up or to the nearest whole number?
Always up. A sample size of 96.04 means that 96 respondents would give slightly less precision than you asked for, so the answer is 97. The same applies after correcting for dropout.