Sample Size Calculator
Calculate the minimum number of respondents needed to estimate a population proportion within a given margin of error at a chosen confidence level — the standard formula behind almost every survey, poll, and quality audit. Includes the finite-population correction so you can plan surveys of small populations without over-sampling.
About this calculator
The calculator uses the worst-case proportion-based sample size formula with finite-population correction: n = (z² · 0.25) / [ (e/100)² + (z² · 0.25) / N ], where z is the critical value of the standard normal at your chosen confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%), e is the margin of error expressed as a percentage, and N is the population size. The factor 0.25 is p·(1 − p) evaluated at p = 0.5 — the value of p that maximises required sample size, giving a conservative answer when the true proportion is unknown. As N grows large, the second term in the denominator vanishes and the formula converges to the classic n ≈ z² · 0.25 / (e/100)², explaining why a poll of the US population (330 M) needs roughly the same sample size as a poll of a city of 100 K. The formula assumes simple random sampling, independent observations, and a binary or proportion-style outcome; it overstates the required sample for known-low-variability outcomes (if you have a prior belief that p is far from 0.5, you can replace 0.25 with p·(1 − p) and save respondents). Edge cases: e must be > 0; if N is smaller than the unconstrained n you cannot achieve the requested precision even by surveying everyone (the formula will return something close to N); if the population is heavily stratified, this single-stage formula understates the sample needed and you should use stratified-sampling formulas instead.
How to use
Example 1 — Town survey. You want to survey a town of 10,000 residents at 95% confidence with a 5% margin of error. Enter Population = 10000, Confidence = 1.96 (the 95% option), Margin = 5. Compute numerator: 1.96² × 0.25 = 0.9604. Compute denominator: (5/100)² + 0.9604 / 10000 = 0.0025 + 0.000096 = 0.002596. n = 0.9604 / 0.002596 ≈ 370. ✓ Survey approximately 370 people. Compare to the infinite-population approximation: n ≈ 0.9604 / 0.0025 = 384 — the finite correction saved you about 14 respondents. Example 2 — Tightening the margin. Same town (N = 10,000) at 95% confidence, but now you want a 2% margin of error. Enter Population = 10000, Confidence = 1.96, Margin = 2. Numerator: 0.9604. Denominator: (0.02)² + 0.9604 / 10000 = 0.0004 + 0.000096 = 0.000496. n = 0.9604 / 0.000496 ≈ 1936. ✓ Cutting the margin in half raised the sample requirement from 370 to over 1900 — more than a 5× increase — because precision improvement scales with the square root of n.
Frequently asked questions
Why does halving the margin of error roughly quadruple the required sample size?
Because the standard error of a proportion scales with 1/√n, the margin of error you can achieve at any given confidence level also scales with 1/√n. To halve the margin you must quadruple n — that is the unavoidable arithmetic of the inverse square-root relationship. This is one of the most important practical facts in survey design: precision is expensive, and small precision gains at the tight end of the spectrum cost dramatically more than equivalent gains at the loose end. Moving from a ±10% to a ±5% margin requires 4× the sample; moving from ±5% to ±2.5% requires another 4×, and so on. Always start by asking what precision your downstream decision actually requires, then design backwards — over-precise surveys are a common form of overspending.
Why is sample size almost independent of population size for large populations?
The finite-population correction term in the denominator (z²·0.25 / N) becomes negligible when N is much larger than n, so the formula collapses to n ≈ z²·0.25 / (e/100)² — a function only of confidence level and margin, not of N. Intuitively, the precision of an estimate depends on the absolute number of independent observations, not on what fraction of the population they represent. This is why national polls of the US (330 M people) get reliable results from around 1000–2000 respondents, the same order of magnitude that would be needed to poll a city of 100 K. The correction matters only when n approaches a meaningful fraction of N (roughly >5%); for small populations like a single company's employees or a single school's students, the corrected formula saves a noticeable number of respondents.
When should I use a different p value instead of the 0.5 worst case?
Replace 0.25 (= 0.5 × 0.5) with p·(1 − p) for a known or expected proportion p whenever you have prior evidence that the true p is far from 0.5. For example, if you are estimating a defect rate believed to be around 5%, p·(1 − p) = 0.05 × 0.95 = 0.0475 — about a fifth of the worst-case value — and required sample size drops by the same factor. The trade-off is that if your prior estimate is wrong and p turns out to be closer to 0.5, your achieved margin will be wider than planned. The 0.5 worst-case assumption is the conservative, defensive choice and is what this calculator uses. Custom-p formulas are common in industrial sampling (defect rates), medical screening (rare-disease prevalence), and market research where strong prior data exists.
What are the most common mistakes people make in sample-size planning?
The first is conflating margin of error with effect size — sample-size formulas for proportions answer "how precisely can I estimate p?", not "what sample do I need to detect a difference of size Δ?" The latter is a power-analysis question and uses a different formula. The second is forgetting non-response: if you expect 30% non-response, you need to send the survey to 1/(1 − 0.30) ≈ 1.43× as many people as the formula's n. The third is assuming simple random sampling when the actual design uses clusters or stratification; clustered designs typically need 1.5–3× as many respondents to hit the same precision (the design-effect multiplier). The fourth is treating "95% confidence" as some sort of magic threshold — it is a convention, not a law, and other levels are equally valid if your decision context calls for them. Finally, people often forget that this calculator answers a precision question, not a statistical-power question; for hypothesis testing, use a power-analysis tool.
When should I not use this calculator?
Skip it when you are planning a study to detect a specific effect size (a treatment difference, an A/B-test lift, a correlation) — that requires a power-analysis calculator (effect size, α, power), not a margin-of-error formula. Do not use it for surveys with multiple outcome variables of vastly different prevalences; design for the rarest outcome you care about. Avoid it for stratified or clustered sample designs without applying a design effect; the unmodified n understates the requirement and your real margin will be wider than planned. It is the wrong tool for estimating means (not proportions) of continuous variables — use a mean-based SE = σ/√n formula instead. Finally, do not use it for very small populations where you can simply survey everyone (a census); the formula will recommend a sample close to N and you may as well take the census and have zero sampling error.