Sample Size Calculator

Before you run a voter poll, customer survey, or factory measurement batch, you need to know how many responses will be enough.

About this calculator

Before you run a voter poll, customer survey, or factory measurement batch, you need to know how many responses will be enough. Too few and your margin of error is wide; too many wastes time and money.

This calculator supports two common setups. For proportions (yes/no, approve/disapprove, defect rate), enter the confidence level, margin of error as a percentage, and expected proportion. If you do not know the proportion, leave it at 50% — that is the conservative choice used by most election survey planners in India.

For means (average weight, voltage, exam score), switch to mean mode and enter the margin of error in the same units as your measurement plus the standard deviation from a pilot run. The formula returns the minimum n, always rounded up to a whole number.

Example: 95% confidence, ±5% margin, p = 50% needs about 385 responses. For means with σ = 10 and e = 2 at 95%, you need 97 observations.

Use with the [[confidence-interval]] calculator after you collect data, the [[probability]] calculator for event odds, and [[mean-median-mode]] to estimate σ from a pilot sample.

Common uses

  • Plan voter or market survey sample size before fieldwork
  • Size a factory QC batch to estimate average weight within ±2 grams
  • Decide how many A/B test users you need for a conversion estimate
  • Budget interview counts for academic research proposals
  • Check whether an existing dataset is large enough for a target margin

Frequently asked questions

How many people do I need for a survey with 95% confidence and 5% margin?

With unknown proportion, use p = 50%. The formula gives n ≈ 385. If you already expect about 30% yes responses, the required n drops to roughly 323.

Why use 50% for expected proportion when I do not know it?

p(1−p) is largest at p = 0.5, so the sample size you get is the worst-case (safest) number. You will not undershoot if the true proportion differs.

What margin of error should I pick for an election poll?

National polls often target ±3% at 95% confidence, which needs about 1,067 responses with p = 50%. State-level polls with ±5% need around 385.

How do I get standard deviation for the mean sample size formula?

Run a small pilot — 20 to 30 measurements — and compute SD from those values. You can paste them into the [[mean-median-mode]] calculator if needed.

Does sample size change with 99% vs 95% confidence?

Yes. Higher confidence uses a larger z, which increases n. Moving from 95% to 99% typically adds 50–70% more responses for the same margin of error.