Sample size calculator

How many respondents you need for a given accuracy.

Inputs

Sample size calculator

4 fields

Results are reference estimates. Verify the inputs before making important decisions.

Fill in the fields and the result will appear here automatically.

Plans the number of completed responses for estimating one proportion under simple random sampling. It reverses the normal confidence-interval approximation: confidence, a margin in percentage points and an anticipated proportion determine the sample size. With other settings fixed, p = 50% maximizes p·(1−p), making it conservative within this model. A known finite population N enables the correction for sampling without replacement. The calculation does not remove selection bias, nonresponse or measurement error, and is not a guarantee for every survey.

FAQ
4 questions
Freshness
formula-based

How it works

Formula and logic

n₀ = z²·p·(1−p)/e², where formula p and e are fractions, while fields use percentages and percentage points. For N > 0, n = N·n₀/(N−1+n₀); the final count is rounded upward. N is an integer from 0 to 9007199254740991: 0 means unknown or very large population, not its measured size. At N = 0 the sampling fraction is unavailable and shown as a dash. At p = 0 or 1 the formula formally gives zero: a degenerate model, not advice to obtain no responses. The normal approximation needs separate assessment near endpoint proportions.

Example

At 95% confidence, a 5-percentage-point margin and anticipated proportion 50%, the uncorrected n₀ ≈ 384.1459 rounds upward to 385 responses. For a known N = 500, the correction gives approximately 217.4872, hence 218 responses.

Fields and units

  • Confidence level — list option
  • Margin of error, % — unitless
  • Expected proportion, % — unitless
  • Population size (0 — infinite) — unitless

How to use

  • — Margin of error is half the interval width: "±3 %" means 3.
  • — If the expected proportion is unknown, 50% gives the largest size within this normal-approximation model for one proportion under simple random sampling. It does not guarantee adequacy for every study or remove selection bias.
  • — Set population to zero when it is large or unknown — the correction then stays off.
  • — The model assumes simple random sampling. Cluster, quota and other designs require a separate assessment of sampling, design effects and bias; there is no universal rule here that they need more people.

Method and limitations

Calculation method
Formula and logic
Limitation
Plans the number of completed responses for estimating one proportion under simple random sampling. The calculation does not remove selection bias, nonresponse or measurement error, and is not a guarantee for every survey.

FAQ

Why is the sample largest at 50 %?

p·(1−p) reaches its maximum 0.25 at p = 0.5. At p = 0.1 or 0.9 it is 0.09: without the finite correction, the unrounded sample size is 36% of the former size, not exactly one third. At 95% and a five-point margin, for example, 139 responses replace 385. This is conservatism within the model, not protection from survey bias.

Why does the sample barely depend on city size?

N is absent from the uncorrected formula. When a sample is appreciable relative to a known N and sampling is without replacement, the correction reduces the count: the N = 500 example gives 218 rather than 385. There is no universal exact threshold where city size suddenly starts to matter.

What does moving from 95 % to 99 % cost?

Without the finite correction and with p and e fixed, size scales with z²: moving from 95% to 99% multiplies the unrounded size by about 1.727. Halving the margin multiplies it by 4, a larger increase. With a 50% proportion and five-point margin, the rounded counts are 385 and 664.

Does this cover A/B tests?

No: this plans precision for one proportion. Comparing two variants requires an effect size relevant to the question, a significance level, statistical power and allocation between groups. Simply doubling this result is not an A/B power calculation.