Sample Size Calculator
Type the margin of error you can accept and your confidence level to get how many…
Type the margin of error you can accept and your confidence level to get how many people to survey, adjusted for a small population if you have one.
More optionsLarge population
ExampleSample size needed
1,068
1,068 responses give a margin of error of ±3% at 95% confidence. Halving the margin takes about four times as many.
Type your own numbers, or drag the chart.
Drag along the curve: bigger samples, smaller margins, with fast-falling returns.
- Before rounding up
- 1,067.07
- z for the confidence level
- 1.96
- For half the margin
- 4,269
How this works: 8 sources,
How this works
Method
Start from the margin of error you can accept and solve its formula for n. For a percentage, E = z√(p(1 − p)/n), so n = z²·p(1 − p)/E². For ±3 points at 95% confidence (z = 1.96) and an expected result of 50%: n = 1.96² × 0.25 ÷ 0.03² ≈ 1,067.1, rounded up to 1,068. Full method
Sources
- Wikipedia, Sample size determination
- NIST/SEMATECH e-Handbook of Statistical Methods
- Abramowitz and Stegun, Handbook of Mathematical Functions, chapters 6, 7 and 26 (1964)
- SciPy 1.18 scipy.stats (reference values for the tests)
- statsmodels 0.15 (reference values for the A/B test and regression intervals)
- Welch, The generalization of Student’s problem when several different population variances are involved (Biometrika) (1947)
- Fleiss, Levin and Paik, Statistical Methods for Rates and Proportions, 3rd edition (sample size for two proportions) (2003)
- Hyndman and Fan, Sample quantiles in statistical packages (The American Statistician) (1996)
How it’s tested
2 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.
Privacy
On your device. Nothing you enter or open leaves this browser. About privacy labels
Changes
- First published: live curves with draggable cut-offs, and tests on pasted data (t-tests, ANOVA, chi-square, Fisher’s exact, correlation, regression, A/B), checked against SciPy.
How to work out a sample size
Start from the margin of error you can accept and solve its formula for n. For a percentage, E = z√(p(1 − p)/n), so n = z²·p(1 − p)/E². For ±3 points at 95% confidence (z = 1.96) and an expected result of 50%: n = 1.96² × 0.25 ÷ 0.03² ≈ 1,067.1, rounded up to 1,068.
Use 50% when you don’t know what to expect: p(1 − p) is largest there, so the answer is safe for any result. If you expect around 10% or 90%, fewer are needed. For a small population, Cochran’s correction n = n₀ ÷ (1 + (n₀ − 1)/N) brings it down: ±5 points at 95% needs 385 from a large population but 323 from a population of 2,000.
The margin falls only with the square root of n, so halving it takes four times the responses: ±1.5 points needs about 4,269. This counts completed responses; if only one in five people answers, invite five times as many. And no sample size fixes a biased sample.
n = z² · p(1 − p) ÷ E² · finite N: n = n₀ ÷ (1 + (n₀ − 1)/N)
- For estimating a proportion, the sample size n = z²p(1 − p)/E² is largest at p = 0.5, which gives a conservative size when the proportion is unknown. Source: Wikipedia, Sample size determination.
- Cochran’s finite population correction reduces the required sample when it is a sizeable share of the whole population. Source: Wikipedia, Sample size determination.
Responses needed for a margin of error
Sample sizes for a percentage at 50%, by margin of error and confidence level, for a large population.
| Margin of error | 90% | 95% | 99% |
|---|---|---|---|
| ±1% | 6,764 | 9,604 | 16,588 |
| ±2% | 1,691 | 2,401 | 4,147 |
| ±2.5% | 1,083 | 1,537 | 2,654 |
| ±3% | 752 | 1,068 | 1,844 |
| ±4% | 423 | 601 | 1,037 |
| ±5% | 271 | 385 | 664 |
| ±6% | 188 | 267 | 461 |
| ±7% | 139 | 196 | 339 |
| ±8% | 106 | 151 | 260 |
| ±10% | 68 | 97 | 166 |
Show all 11 rowsShow fewer
| ±15% | 31 | 43 | 74 |
Common questions
Why do national polls use about 1,000 people?
Because 1,000 gives a margin of about ±3 points at 95% confidence whatever the country’s size, and going to ±2 would cost more than twice as many interviews. The population size barely matters once it is large.
What if my population is small?
Type it under More options. The correction lowers the number when the sample would be a big share of the population; surveying 385 of 400 employees is nearly a census.
How do I find the sample size for a mean?
Switch to Mean and type a guess of the standard deviation and the margin you want: n = (zσ/E)². To know an average within ±2 when σ is about 10, at 95% you need (1.96 × 10/2)² = 96.04, so 97 after rounding up.