Sample Size Calculator
For a survey with 95% confidence, a margin of error of ±5% and an expected proportion of 50% (the safe choice when you do not know it), you need a sample of 385 people: n = z² × p × (1 − p) ÷ E² = 1.96² × 0.25 ÷ 0.05² = 384.16, rounded up to 385. Add a population size and the finite population correction shrinks that for small groups (278 for a population of 1,000). Switch modes to find the margin of error from the number of responses you have (385 responses give about ±4.99%), or to find the sample size for estimating a mean from the standard deviation σ. The working is shown step by step.
Updated Runs in your browser: nothing you enter is uploadedHow this tool works
n₀ = z² × p × (1 − p) ÷ E² = 1.96² × 0.25 ÷ 0.05²
n = 385
A random sample of 385 gives 95% confidence that the true proportion is within ±5 percentage points of the sample proportion (384.16 before rounding up).
- Sample size (n)
- 385
- Before rounding up
- 384.16
- z-score (z*)
- 1.96
- Confidence level
- 95%
- Margin of error
- ±5%
- Expected proportion
- 50%
- Population size
- Not given (large or unknown)
Working
- z for 95% confidence = 1.96 (the point that leaves 2.5% of the normal curve in each tail).
- Expected proportion p = 50% = 0.5, so p × (1 − p) = 0.5 × 0.5 = 0.25. Margin of error E = 5% = 0.05.
- n₀ = z² × p × (1 − p) ÷ E² = 1.96² × 0.25 ÷ 0.05² = 384.16.
- Round up to the next whole person: n = 385.
Sample size by confidence level and margin of error
| Margin of error | 80% confidence | 90% confidence | 95% confidence | 99% confidence |
|---|---|---|---|---|
| ±1% | 4,109 | 6,766 | 9,604 | 16,590 |
| ±2% | 1,028 | 1,692 | 2,401 | 4,148 |
| ±3% | 457 | 752 | 1,068 | 1,844 |
| ±4% | 257 | 423 | 601 | 1,037 |
| ±5% | 165 | 271 | 385 | 664 |
| ±7.5% | 74 | 121 | 171 | 295 |
| ±10% | 42 | 68 | 97 | 166 |
Sample size by population size
| Population size | ±5% margin | ±3% margin | ±1% margin |
|---|---|---|---|
| 100 | 80 | 92 | 99 |
| 500 | 218 | 341 | 476 |
| 1,000 | 278 | 517 | 906 |
| 5,000 | 357 | 880 | 3,289 |
| 10,000 | 370 | 965 | 4,900 |
| 100,000 | 383 | 1,056 | 8,763 |
| 1,000,000 | 385 | 1,066 | 9,513 |
Margin of error by sample size
| Sample size | 90% confidence | 95% confidence | 99% confidence |
|---|---|---|---|
| 50 | ±11.63% | ±13.86% | ±18.22% |
| 100 | ±8.22% | ±9.8% | ±12.88% |
| 200 | ±5.82% | ±6.93% | ±9.11% |
| 400 | ±4.11% | ±4.9% | ±6.44% |
| 500 | ±3.68% | ±4.38% | ±5.76% |
| 1,000 | ±2.6% | ±3.1% | ±4.07% |
| 2,000 | ±1.84% | ±2.19% | ±2.88% |
| 5,000 | ±1.16% | ±1.39% | ±1.82% |
| 10,000 | ±0.82% | ±0.98% | ±1.29% |
The z-scores used
| Confidence level | z* |
|---|---|
| 80% | 1.282 |
| 85% | 1.44 |
| 90% | 1.645 |
| 95% | 1.96 |
| 98% | 2.326 |
| 99% | 2.576 |
How to calculate a sample size for a survey
- Choose the confidence level and margin of error. Pick how sure you want to be (95% is the usual choice, with z = 1.96) and how close you need the answer to be (a margin of error of ±5 percentage points here).
- Estimate the proportion. Use the share you expect to see. If you have no idea, use 50%: it gives the largest sample and so is always safe. A proportion of 10% would need only 139 people for the same precision.
- Apply the formula. n₀ = z² × p × (1 − p) ÷ E² = 1.96² × 0.25 ÷ 0.05² = 384.16.
- Correct for a small population (optional). If you know the population size N, divide: n = n₀ ÷ (1 + (n₀ − 1) ÷ N). For N = 1,000 that turns 384.16 into 277.74.
- Round up. Always round up to the next whole person, never down: 384.16 becomes 385. Then allow for people who will not respond by inviting more than that.
Frequently asked questions
- What is the formula for sample size?
- For a proportion, n₀ = z² × p × (1 − p) ÷ E², where z is the critical value for the confidence level, p the expected proportion and E the margin of error, both as fractions. For 95% confidence (z = 1.96), p = 0.5 and E = 0.05, n₀ = 384.16, which rounds up to 385. For a mean, n₀ = (z × σ ÷ E)², where σ is the standard deviation and E is in the same units as σ.
- Why is 385 the usual sample size?
- Because 95% confidence, a ±5% margin of error and a 50% expected proportion give n₀ = 384.16, and you always round a sample size up, so 385. It does not depend on the population size unless the population is small, which is why polls of a whole country and of a large city use similar sample sizes.
- Why use 50% as the expected proportion?
- p × (1 − p) is largest at p = 0.5, so 50% gives the biggest sample size and guarantees at least the margin of error you asked for whatever the true answer turns out to be. If earlier research tells you the proportion is near 10% or 90%, you can use that: the same ±5% at 95% confidence then needs only 139 people.
- What is the finite population correction?
- When you sample a large share of a small population you learn more than the plain formula assumes. The correction n = n₀ ÷ (1 + (n₀ − 1) ÷ N) reduces the sample size to allow for that. For a population of 1,000 it takes 384.16 down to 277.74, which rounds up to 278. It makes almost no difference when the sample is under about 5% of the population, and a sample of the whole population gives a margin of error of 0.
- How do I find the margin of error from a sample size?
- Use E = z × √(p × (1 − p) ÷ n), times the finite population correction √((N − n) ÷ (N − 1)) if the population is small. With 385 responses at 95% confidence and p = 50%, the margin of error is about ±4.99%. Because of the square root, quadrupling the sample only halves the margin: 1,000 responses give ±3.1% and 4,000 give ±1.55%.
- How do I calculate the sample size for a mean?
- Use n₀ = (z × σ ÷ E)² with an estimate of the standard deviation σ from a pilot study or earlier research. With σ = 15, E = 2 and 95% confidence, n₀ = 216.09, so you need 217 measurements. The same population correction applies if you know the population size.
- What do confidence level and margin of error mean?
- The margin of error is how far the sample result is likely to be from the true value, in either direction. The confidence level is how often intervals built this way would contain the true value if you repeated the survey. 95% confidence with ±5% means: if the survey were repeated many times, about 95 in 100 of the resulting intervals (result ± 5 points) would contain the true figure.
- Does a bigger population need a bigger sample?
- Only up to a point. For ±5% at 95% confidence the sample needed is 80 for a population of 100, 278 for 1,000, 370 for 10,000 and 385 for a million, so beyond a few tens of thousands the population size hardly matters.
- Is the answer the number of people I should ask, or the number who must respond?
- It is the number of completed responses you need. Not everyone you contact will answer, so divide by your expected response rate: if only 40% respond, invite 2.5 times as many. The formula also assumes a simple random sample, with no bias in who responds; self-selected or clustered samples need a larger one.
- Why does the calculator use a rounded z-score of 1.96?
- Textbooks and survey guides round the critical value to three decimals (1.960 for 95%, 1.645 for 90%, 2.576 for 99%), which is what gives the familiar 384.16 for 95% and ±5%. The calculator takes the exact value from the inverse normal CDF used by the z-score calculator and rounds it the same way; using the unrounded 1.959964 would give 384.15, which still rounds up to 385.
- What if I need to compare groups or test a hypothesis?
- This calculator sizes a single estimate of a proportion or a mean. Comparing two groups, detecting a difference of a given size or reaching a given statistical power needs a power analysis, which also takes the effect size and the power (often 80%) into account and gives a larger number.
How it works
Sample size for a proportion: n₀ = z² × p × (1 − p) ÷ E², with E and p as fractions. Sample size for a mean: n₀ = (z × σ ÷ E)². Margin of error from a sample size: E = z × √(p × (1 − p) ÷ n). With a population size N, the finite population correction n = n₀ ÷ (1 + (n₀ − 1) ÷ N) is applied to the sample size and √((N − n) ÷ (N − 1)) to the margin of error. Results are rounded up to a whole person, and never exceed N. The critical value z is the two-sided point of the standard normal distribution, found with the inverse normal CDF in the z-score calculator’s code (Peter Acklam’s approximation refined by a Halley step) and rounded to 3 decimals, as in a printed z-table: 1.960 at 95%, which is why the classic figure is 384.16 rather than 384.15. The formulas assume a simple random sample from the population, a large enough sample for the normal approximation to hold (np and n(1 − p) both at least 10 or so) and, for a mean, a known or well-estimated standard deviation; a small sample of a mean is usually analysed with the t distribution, which needs slightly more. Non-response, clustering, weighting and stratification change the sample you need and are not modelled here. Everything runs in your browser and nothing you type is sent anywhere.
Sources
- Sample size determination, Wikipedia
- Margin of error, Wikipedia
- Standard score (z-score), Wikipedia
- W. G. Cochran, Sampling Techniques (3rd ed., 1977), chapter 4: the determination of sample size, including the finite population correction
- Peter J. Acklam, An algorithm for computing the inverse normal cumulative distribution function
More free tools
- Z-Score CalculatorFind a z-score from a value, mean and SD or a list of numbers, with percentile, left-tail, right-tail and two-tailed probability and a normal curve.
- Probability CalculatorFind P(A and B), P(A or B), P(not A) and P(A|B) for two events, binomial probabilities for repeated trials, and odds to probability, as exact fractions.
- Confidence Interval CalculatorConfidence interval for a mean (z or t, from summary stats or a list) or a proportion (Wald, Wilson), with margin of error, standard error and the working.
- Chi-Square CalculatorChi-square test of independence or goodness of fit from your counts: statistic, p-value, expected counts, Cramér’s V and critical values at your alpha.
- P-Value CalculatorP-value from a z or t statistic for left, right and two-tailed tests, with the reject or fail to reject verdict at your alpha and critical values.
- Binomial Distribution CalculatorBinomial probability P(X = k), P(X ≤ k) and P(X ≥ k) for up to 1,000 trials, with mean, standard deviation, mode, exact fractions and a bar chart.
More: Statistics, probability and gradesAll math & numbersAll toolsHome & DIY calculators