📊 Statistics & Probability
Sample Size Calculator
Calculate the required sample size for any survey or A/B test. Free sample size calculator with power analysis.
What This Calculator Tells You
This calculator tells you how many responses you need for a survey or poll so that your result lands within a chosen margin of error at a chosen confidence level. For the classic setup — ±5% at 95% confidence — the answer is 385.
It uses the standard formula for estimating a proportion: n = z² × p × (1 − p) ÷ E², rounded up.
What to Enter
- Desired margin of error (%) — how close you want the result to be to the true value. ±5% is common; ±3% for higher-stakes decisions.
- Confidence (%) — how sure you want to be that the true value falls within that margin. 95% is standard; the calculator accepts any level.
- Estimated proportion (0–1) — your best guess at the answer (for example, 0.2 if you expect about 20% to say yes). If you have no idea, leave it at 0.5: it gives the largest, safest sample.
Worked Examples
1. A standard customer survey
±5% margin of error, 95% confidence, no prior estimate (0.5).
- Result → 385 responses (z = 1.960).
2. Tightening the margin of error
Same survey, but you want ±3%.
- Result → 1,068 responses.
- Going from ±5% to ±3% nearly triples the sample — precision gets expensive quickly.
3. Higher confidence vs a better estimate
- ±5% at 99% confidence → 664 responses (z = 2.576).
- ±5% at 95% when you expect about 20% "yes" (p = 0.2) → 246 responses. A realistic prior estimate can cut the sample considerably.
How It’s Calculated
- n: Number of periods or sample size
- z: Z-score (standard normal)
- p: Sample proportion / p-value
How to Read Your Result
- The number is completed responses, not invitations. If 20% of people usually respond, you need to invite about five times as many.
- It applies to each group you want to report on. If you need separate results for two regions, each needs its own sample.
- Large populations need no adjustment. For populations of many thousands, the required sample barely changes with population size. For small populations (a few hundred), a finite-population correction lowers it.
- For the reasoning behind the formula, read confidence intervals and sample size.
Common Mistakes to Avoid
- Counting invitations instead of responses. Plan for your expected response rate.
- Ignoring who responds. A large sample from the wrong audience is still biased — 2,000 responses from your happiest customers will not represent all customers.
- Entering a percentage as the proportion. Use 0.2, not 20.
- Using this for A/B tests. Comparing two conversion rates needs a different calculation based on the smallest lift you want to detect.
When to Use This Calculator
- Plan customer satisfaction, NPS and market-research surveys.
- Budget for a paid survey panel.
- Check whether an existing survey is big enough to trust.
- Explain a survey's precision to stakeholders.
Frequently Asked Questions
Why is 385 the magic number?
Because 1.96² × 0.5 × 0.5 ÷ 0.05² ≈ 384.2, which rounds up to 385. It is the sample needed for ±5% at 95% confidence when you assume the worst-case proportion of 50%.
Does population size matter?
Barely, once the population is large. A national survey and a survey of a 50,000-customer list need almost the same sample. For small populations, apply a finite-population correction.
Why does p = 0.5 give the largest sample?
p × (1 − p) is largest at 0.5 (0.25). Any other estimate gives a smaller product and therefore a smaller sample.
What if I already have responses?
Use the margin of error calculator to see how precise your existing sample is.
Do you store the values I enter?
No. All calculations happen in your browser. Your data never leaves your device.
Related Guides
Related Calculators
Standard Deviation Calculator
Calculate sample and population standard deviation, variance, mean, and range from any list of numbers. Free online tool.
Calculate Now → σ²Variance Calculator
Calculate sample and population variance from any dataset. Free variance calculator with mean and SD output.
Calculate Now → 📊Z Score Calculator
Calculate z-score from a value, mean, and standard deviation. Free z-score calculator with probability lookup.
Calculate Now → 📊P Value Calculator
Calculate p-value from a z-score or t-score. Free p-value calculator for one-tailed and two-tailed tests.
Calculate Now →