Sample Size Calculator
Calculate the required sample size for surveys and experiments.
Typical: 3–5% for surveys
Use 0.5 if unknown, maximizes sample size
What Is the Sample Size Calculator?
The Sample Size Calculator determines how many respondents or subjects you need to achieve a statistically valid result at a given confidence level and margin of error. Enter your confidence level, margin of error, and expected proportion (use 0.5 if unknown). Optionally provide the population size for the finite population correction.
- ›Confidence level: probability that your interval contains the true value (90%, 95%, 99%)
- ›Margin of error: maximum acceptable difference between sample and population values
- ›Proportion p: expected percentage answering "yes", use 0.5 if unknown (most conservative)
- ›Finite correction: reduces required n when sampling more than ~5% of a known population
Formula
Sample Size Formulas
Infinite population
n = Z² × p(1−p) / E²
z-score (95%)
Z = 1.960
z-score (99%)
Z = 2.576
Proportion variance
p(1−p) max at p = 0.5 = 0.25
Finite correction
n_adj = n / (1 + (n−1)/N)
Margin of error E
Enter as decimal: 5% → 0.05
How to Use
- 1Select your confidence level (95% is standard for most surveys)
- 2Enter the margin of error as a percentage (3–5% is typical for polls)
- 3Enter the expected proportion (0.5 gives the maximum/safest sample size)
- 4Optionally enter the population size N for the finite population correction
- 5Click Calculate Sample Size, see the recommended n with step-by-step formula
- 6The quick reference table shows sample sizes for common confidence/margin combinations
Example Calculation
Survey: 95% confidence, ±5% margin, p=0.5, N=10,000:
E = 5% = 0.05
p(1−p) = 0.5 × 0.5 = 0.25
n₀ = (1.96)² × 0.25 / (0.05)² = 3.8416 × 0.25 / 0.0025
n₀ = 384.16 → rounded up to 385
Finite correction (N=10,000):
n = 385 / (1 + 384/10,000) = 385/1.0384 ≈ 371
Why n barely changes with large populations
A sample of ~385 gives ±5% margin at 95% confidence whether the population is 10,000 or 300 million. Sample size is driven by desired precision, not population size, which is why national polls survey ~1,000 people for the entire US.
Understanding Sample Size
Sample Size Quick Reference (95% confidence, p=0.5)
| Margin of Error | Sample Size (n) | Confidence | Typical Use |
|---|---|---|---|
| ±1% | 9,604 | 95% | Academic research, clinical trials |
| ±2% | 2,401 | 95% | Major political polls |
| ±3% | 1,067 | 95% | National surveys, news polls |
| ±4% | 600 | 95% | Regional surveys |
| ±5% | 385 | 95% | General business surveys |
| ±10% | 97 | 95% | Quick internal surveys |
| ±5% | 664 | 99% | Regulatory / high-stakes decisions |
Frequently Asked Questions
What is a confidence level?
The confidence level is a property of the procedure, not a specific result. You must choose it before collecting data based on how much certainty you need.
- ›90% CI: true value falls in 9 out of 10 repeated studies
- ›95% CI: true value falls in 19 out of 20 repeated studies (industry standard)
- ›99% CI: true value falls in 99 out of 100 repeated studies
- ›Higher confidence → larger required sample size for same margin of error
What is the margin of error?
The margin of error defines the width of your confidence interval. A poll saying "45% support X ± 3%" has a confidence interval of 42%–48%.
- ›±1% margin: need ~9,604 respondents (very precise, expensive)
- ›±3% margin: need ~1,067 respondents (used by professional polls)
- ›±5% margin: need ~385 respondents (common for smaller studies)
- ›±10% margin: need ~97 respondents (quick informal survey)
Why use p = 0.5 when unknown?
The product p(1−p) is maximized at 0.25 when p=0.5. Using 0.5 is the safe default when you cannot estimate the true proportion in advance.
- ›p=0.5: p(1−p) = 0.25 (maximum) → largest, most conservative sample
- ›p=0.3: p(1−p) = 0.21 → smaller required sample
- ›p=0.1: p(1−p) = 0.09 → much smaller required sample
- ›If you expect the proportion to be near 10% or 90%, use that estimate to reduce required n
What is the finite population correction?
The finite correction reduces required sample size when you are sampling more than about 5% of the population. The correction becomes substantial when n/N exceeds 10%.
- ›Population of 1,000 + infinite n₀=385: corrected n = 278 (28% reduction)
- ›Population of 5,000 + n₀=385: corrected n = 357 (7% reduction)
- ›Population of 100,000+: correction is negligible (<1%)
- ›Rule of thumb: apply correction only when N < 20× your uncorrected n₀
Why does sample size barely change for large populations?
This is a counterintuitive but statistically proven result. The formula n = Z²p(1−p)/E² has no population term, precision is independent of population size above a certain threshold.
- ›Gallup polls the entire US (330M people) with ~1,000–1,500 respondents
- ›Margin of error ~3% is achievable at any population scale with ~1,067 responses
- ›Population enters only through the finite correction (negligible for large N)
- ›This is why election polls use similar sample sizes regardless of state population
What is the difference between a random sample and a convenience sample?
The sample size formula assumes simple random sampling. Non-random samples can produce large, precise datasets that are nonetheless biased and wrong.
- ›Literary Digest 1936 poll: 2.4M respondents, predicted Landon over FDR, and was wrong (sampling bias)
- ›Gallup 1936 poll: 50,000 random respondents, correctly predicted FDR, proving randomness beats size
- ›Online opt-in polls have self-selection bias, the formula does not apply
- ›For valid results: random sampling + sufficient n is the only reliable approach
How does this differ from power analysis for experiments?
Two different statistical goals require two different sample size formulas. Survey sampling estimates a proportion; experimental power analysis detects a treatment effect.
- ›Survey: CI-based, need enough n for confidence level + margin of error
- ›A/B test: power-based, need enough n to detect a minimum detectable effect (MDE)
- ›Clinical trial: power typically set at 80% (β=0.2) with α=0.05
- ›Larger effect sizes require smaller samples; smaller effects need larger samples