Sample Size Calculator
How many to survey for a margin of error and confidence level, for a proportion or a mean, with finite-population correction and an existing sample’s margin.
A whole-number sample size for your margin and confidence, the same figure at 90, 95 and 99 %, and the formula with its z-value so the number can be checked by hand.
Example: For ±5 points at 95 % confidence with p = 50 %, n₀ = 1.96² × 0.25 / 0.05² = 384.15 → 385; with a population of 10,000 the finite-population correction brings it to 370.
How many
is enough.
The formula, what each input does to it, and the assumptions it carries.
The formula
For a proportion, n₀ = z² p(1 − p) / E²: z is the normal quantile for the confidence level (1.96 at 95 %), p the proportion you expect and E the half-width you can accept. For a mean the variance p(1 − p) is replaced by σ². The result is rounded up. If the population is finite, Cochran's correction n = n₀ / (1 + (n₀ − 1)/N) reduces it — noticeably only when n₀ is a sizeable fraction of N. The table repeats the calculation at 90, 95 and 99 % so the cost of extra confidence is visible.
The choices you make
p = 50 % maximises p(1 − p) and so gives the largest, safest n; a smaller or larger expectation shrinks n but widens the real margin if it turns out wrong, which is why the page flags it. σ for a mean cannot be calculated here — it comes from a pilot, an earlier study or the literature. The confidence level is a convention, not a law; 95 % is common, nothing more. Enter a sample size you already have and the page reports the margin it achieves, with the finite-population factor when N is given.
What it does not cover
This is the simple random sampling formula. Stratified or cluster designs, non-response, design effects and power for detecting a difference between two groups are not modelled — for the last, the A/B Test page computes sample size for two proportions. Nothing leaves the browser; the same four anonymous usage counts as the rest of the site apply.
SOURCES
- Cochran, W. G., Sampling Techniques, 3rd ed. (Wiley, 1977) — sample size for a proportion and the finite-population correction
- NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.2.2 — sample sizes required
Last reviewed 19 September 2026. How results are checked: How we verify.