Sample Size Calculator
Work out how large a survey sample needs to be for a target margin of error, or find the margin of error a given sample size already produces — with a finite-population correction.
How to use this calculator
- 1Choose whether you want to find the sample size needed, or the margin of error a sample size you already have would produce.
- 2Decide the margin of error and confidence level you need (or enter your known sample size, if solving for margin of error instead).
- 3If you have a rough idea of the expected split, enter it — otherwise leave it at the conservative 50%.
- 4Set a population size only if you are surveying a small, fixed group; leave it at 0 otherwise.
How the calculation works
n₀ = z²p(1−p) / e² n = n₀ / (1 + (n₀−1)/N)- z
- Critical value for the chosen confidence level
- p
- Expected proportion — 50% is the most conservative choice
- e
- Target margin of error, as a decimal
- N
- Population size — the finite-population correction, applied only when N is set
p(1−p) is maximised at p = 0.5, which is why using 50% as the expected split gives the largest, most conservative sample size estimate when the true split is unknown.
The finite-population correction matters only when your sample would otherwise be a substantial fraction of the whole population — surveying 400 people out of a population of 50,000 needs no adjustment, but 400 out of 1,000 does.
Because e appears squared in the denominator, halving your target margin of error roughly quadruples the required sample size.
Worked example
±5% margin, 95% confidence, unknown split, unlimited population
- 1.n₀ = 1.96² × 0.5 × 0.5 ÷ 0.05² = 3.8416 × 0.25 ÷ 0.0025 = 384.16.
- 2.With no population limit set, no finite-population correction applies.
- 3.Rounding up: 385 respondents needed.
Result: 385 respondents
Margin of error for 385 respondents, 95% confidence, unknown split
- 1.With no population limit set, n₀ is just the sample size itself: 385.
- 2.e = 1.96 × √(0.5 × 0.5 ÷ 385) = 1.96 × 0.02548 = 0.04995.
- 3.That is a margin of error of about ±4.99% — matching the sample-size example above almost exactly, since 385 was derived from a ±5% target.
Result: ± 4.99%
The question behind every sample size calculation
Before running a survey or an experiment, there is a practical question to settle first: how many responses are actually needed? Too few, and the result is too imprecise to be useful, since a small sample can easily overstate or understate the true figure by a wide margin. Too many, and time and budget get spent buying precision nobody needed.
The calculation balances three things chosen up front: how tight a margin of error is acceptable, how confident the result needs to be, and — for cases where responses might split unevenly — a rough guess at how the answers will actually divide.
Why bigger samples have diminishing returns
Precision does not scale in a straight line with sample size — it scales with the square root of it. Doubling a sample does not halve the margin of error; it shrinks it by only about 30%. Cutting the margin of error in half requires roughly four times as many respondents, which is why very tight margins get expensive fast, and why professional pollsters rarely chase precision much beyond about ±2–3%.
The finite-population correction only matters when the sample would make up a meaningful share of the whole population — surveying 400 out of 50,000 people needs no adjustment, but 400 out of 1,000 does, because a large fraction of a small population carries more information than the same fraction of a huge one.
What sample size cannot fix
This calculation covers only sampling error — the imprecision that comes purely from asking a subset instead of everyone. It says nothing about bias introduced by how participants were recruited, wording that nudges answers in a particular direction, or a low response rate that leaves the people who did respond unrepresentative of the people who did not. A perfectly calculated sample size cannot rescue a poorly designed survey.
It also assumes simple random sampling. Real surveys often use more complex designs, like stratified or clustered sampling, which change the effective sample size needed to hit the same margin of error.
Where this calculation gets used
The same trade-off between precision and sample size applies wherever a subset stands in for a larger group.
- Political and opinion polling — deciding how many people to survey to hit a stated margin of error.
- Market research — sizing a customer survey before it goes out.
- Clinical trial design — though medical trials typically layer a statistical power calculation on top of this.
- Quality assurance — deciding how many units from a production run to inspect.
What this assumes, and where it stops
Assumptions
- Simple random sampling from the population.
- Responses are independent of one another.
Limitations
- Assumes a single yes/no or binary-style question. Multi-category questions and more complex survey designs need different formulas.
- Does not account for expected non-response — if you expect a 50% response rate, you generally need to reach roughly twice this many people.
- Stratified, clustered or otherwise complex sampling designs need adjusted formulas beyond simple random sampling.
Common questions
Why does the calculator default to a 50% expected split?
Because p(1−p) — the quantity that drives the required sample size — is at its largest when p is 50%. Using that figure produces the most conservative, largest sample size estimate, which is the safe choice whenever you do not already have a good estimate of how responses will actually split.
Do I need to account for people who won’t respond?
Yes, separately from this calculation. This gives you the number of completed responses you need. If you expect a 40% response rate, you need to invite roughly 2.5 times as many people as this figure to end up with enough completed responses.
I already collected 200 responses — what margin of error does that give me?
Switch "Find" to "The margin of error for a given sample size" and enter 200. This runs the same formula in reverse: instead of solving for the sample size that hits a target margin of error, it tells you the margin of error your actual sample size already achieves.
Formula and content last reviewed on .
Results are estimates for information only, not professional advice.
Related calculators
Tools people commonly use alongside the sample size calculator.