Sample Size Calculator
Find Out The Sample Size
Press Calculate to see the results.
Find Out the Margin of Error
Already collected your data? Enter the sample size and the observed proportion to see how precise the estimate is.
Press Calculate to see the results.
Use this sample size calculator to find how many people you need to survey for a chosen confidence level and margin of error, with an optional finite population correction. The second calculator works backward from a sample size to its margin of error.
Surveys and experiments rarely measure everyone they are interested in. Instead they measure a sample and use it to estimate the whole population. The sample size determines how precise that estimate is: larger samples give narrower margins of error, but they cost more time and money. This calculator finds the smallest sample that delivers the precision you want, or tells you how precise a sample you already have is.
The default inputs, 95% confidence, a 5% margin of error and an expected proportion of 50%, call for 385 responses. That number barely changes once the population is more than a few tens of thousands, which is why national polls of about 1,000 people can describe an entire country.
Statistics of a Random Sample
The formulas here assume a simple random sample, in which every member of the population has the same chance of being chosen and each choice is independent of the others. Under that assumption, the proportion measured in the sample, written p̂, is an unbiased estimate of the true population proportion p. It will rarely match exactly, but its errors follow a predictable pattern.
If you could repeat the survey many times, the sample proportions would form a distribution centered on the true value, with a standard error of √(p(1 − p) ÷ n). By the central limit theorem, that distribution is close to normal once the sample is reasonably large, roughly when both np and n(1 − p) are at least 10. The normal shape is what lets a z-score translate a confidence level into a margin of error.
Random sampling is easier to describe than to achieve. People who decline to respond, sampling frames that miss part of the population, and questions that nudge answers in one direction all introduce bias, and no sample size can correct for bias. The margin of error measures only the random variation from sampling, so a well-designed small sample is more trustworthy than a large sample of volunteers.
Confidence Level
The confidence level describes how often the method would capture the true value if the survey were repeated many times. At 95% confidence, about 95 out of 100 intervals built this way would contain the real population proportion. Higher confidence requires a larger z-score, so for the same margin of error it requires a larger sample. The table lists the two-sided z-scores used by the calculator.
| Confidence level | z-score |
|---|---|
| 70% | 1.036 |
| 75% | 1.150 |
| 80% | 1.282 |
| 85% | 1.440 |
| 90% | 1.645 |
| 95% | 1.960 |
| 98% | 2.326 |
| 99% | 2.576 |
| 99.9% | 3.291 |
| 99.99% | 3.891 |
| 99.999% | 4.417 |
Confidence Interval
A confidence interval is the range p̂ ± ε, the sample estimate plus or minus the margin of error. For a proportion, the margin of error is ε = z × √(p̂(1 − p̂) ÷ n). Suppose 60 of 100 randomly chosen customers say they prefer a new design. At 95% confidence, ε = 1.96 × √(0.6 × 0.4 ÷ 100) ≈ 0.096, so the true share is likely between about 50.4% and 69.6%.
Three things control the width. The confidence level sets z. The sample size sits under a square root, so quadrupling the sample only halves the margin of error, and going from 1,000 to 4,000 responses narrows a 3.1% margin to about 1.5%. The proportion itself matters too: p(1 − p) is largest at 0.5, which is why 50% is the safe choice when you have no prior estimate. A proportion near 0 or 1 gives a narrower interval.
When the sample is a meaningful share of a finite population, say more than about 5%, the finite population correction √((N − n) ÷ (N − 1)) shrinks the margin of error, because there is less of the population left unmeasured. Surveying all 500 employees of a company leaves no sampling error at all.
A confidence interval is easy to misread. It does not mean there is a 95% probability that the true value lies inside the specific interval you calculated; the true value either is or is not inside it. The 95% describes the long-run success rate of the procedure. It also says nothing about errors from bias, poor question wording or people who did not respond.
| Sample size | Margin of error (95%, p = 50%) |
|---|---|
| 100 | ±9.8% |
| 400 | ±4.9% |
| 1,000 | ±3.1% |
| 2,500 | ±2.0% |
| 10,000 | ±1.0% |
Sample Size Calculation
Solving the margin-of-error equation for n gives the sample size formula for an unlimited population. With 95% confidence, a 5% margin and p̂ = 0.5, n₀ = 1.96² × 0.25 ÷ 0.05² ≈ 384.15, which rounds up to 385.
For a finite population of size N, the correction reduces the requirement. With N = 2,000, n = 384.15 ÷ (1 + 383.15 ÷ 2,000) ≈ 322.4, so 323 responses are enough. With N = 200, only 132 are needed. As N grows past about 100,000, the corrected value is essentially the same as n₀.
The result is the number of completed responses you need, not the number of invitations to send. If you expect only 20% of people to answer, divide by 0.2 and invite about five times as many. Plan for subgroups as well: if you want a ±5% margin for each of four regions, each region needs its own sample of about 385.
| Margin of error | 90% confidence | 95% confidence | 99% confidence |
|---|---|---|---|
| ±10% | 68 | 97 | 166 |
| ±5% | 271 | 385 | 664 |
| ±3% | 752 | 1,068 | 1,844 |
| ±2% | 1,691 | 2,401 | 4,147 |
| ±1% | 6,764 | 9,604 | 16,588 |
n₀ = z² × p̂(1 − p̂) ÷ ε², n = n₀ ÷ (1 + (n₀ − 1) ÷ N)
- z
- the z-score for the confidence level (1.96 for 95%)
- p̂
- the expected proportion, as a decimal
- ε
- the margin of error, as a decimal
- N
- the population size, when it is finite
Always round the sample size up to the next whole number.
Frequently asked questions
What sample size do I need for a survey?
For 95% confidence and a ±5% margin of error with an unknown proportion, you need 385 completed responses from a large population. Smaller populations need fewer.
Why use 50% for the population proportion?
The product p(1 − p) is largest at 50%, so it gives the most conservative, largest sample size. Use a different value only if you have a reliable prior estimate.
Does population size matter?
Only when the sample is a noticeable fraction of the population. For populations over about 100,000, the required sample barely changes.
How do I reduce the margin of error by half?
Quadruple the sample size, because the margin of error shrinks with the square root of n.
What is the margin of error for 1,000 respondents?
About ±3.1% at 95% confidence when the proportion is near 50%.
What is Cochran's formula for sample size?
Cochran's formula is n₀ = z² × p(1 − p) ÷ e², the formula this calculator uses before any population correction. At 95% confidence (z = 1.96), p = 0.5 and e = 0.05, it gives 3.8416 × 0.25 ÷ 0.0025 ≈ 384.16, which rounds up to 385. For a finite population N, the calculator then applies n = n₀ ÷ (1 + (n₀ − 1) ÷ N).
What is the Yamane formula?
Yamane's shortcut is n = N ÷ (1 + N × e²), which builds in 95% confidence and p = 0.5. For a population of 2,000 and a 5% margin of error it gives 2,000 ÷ 6 ≈ 333.3, so 334 responses. This calculator gives about 323 for the same inputs, because Yamane effectively rounds z up to 2 instead of 1.96.
Updated by Calculator.hair. How we build and check our calculators