
Sample Size Calculator
Sample size calculator: find how many survey responses you need for a confidence level and margin of error, with optional population size, or the margin.
Written by
Sophie Clipton
Updated
There was an error with your calculation.
Sample Size
385
Margin of Error
9.8%
Sample size calculator at a glance#
What sample size do I need for a survey?#
For a large population, 385 responses provide a margin of error of plus or minus 5 percentage points at a confidence level of 95%. This figure assumes a population proportion of 50%, which is the setting that gives the largest sample. You can enter your own desired confidence level, margin of error, and population size, and the calculator will return the number of responses you need to collect.
How do you calculate sample size?#
Start with n = z2 × p × (1 − p) ÷ e2, where z is derived from the confidence level, p represents the expected proportion, and e is the margin of error expressed as a decimal. At a confidence level of 95%, z equals 1.96, so n = 1.962 × 0.5 × 0.5 ÷ 0.052 = 384.16. Round up to 385. If you enter a population size, the calculator will then scale that number down for a smaller population.
How does population size change the sample size?#
The change is less than most people expect. A company with 2,000 employees requires 323 responses for the same confidence level of 95% and a margin of 5%, while a city with a population of 100,000 needs 383 responses. Once you reach a few thousand, the result barely shifts, and for an unlimited population, it requires 385 responses.
The four inputs#
- Confidence level: This determines how often this method captures the true value. At 95%, about 95 out of 100 samples drawn in the same manner would yield an interval containing the true value.
- Margin of error: This indicates how far the survey result might be from the true value, in percentage points. A result of 60% with a 5% margin gives a 95% confidence interval of 55% to 65%.
- Population proportion: This is your best estimate of the percentage you're measuring. If no estimate is available, use 50%, which gives the largest and safest sample.
- Population size: This refers to the number of people or items the sample is drawn from. Leave this blank when dealing with a very large or unknown population.
The formula the calculator uses#
The calculator follows three steps. OpenStax Introductory Statistics gives the first step for a proportion, uses 0.5 for p when you have no prior estimate and advises rounding the result upward.
- Identify the starting sample size, which is n0 = z2 × p × (1 − p) ÷ e2.
- If a population size N is provided, apply a correction: n = n0 × N ÷ (N + n0).
- Round up to the next whole number, since you cannot survey part of a person.
Consider a company with 2,000 employees eager to determine what percentage would take up a new benefit, aiming for accuracy within 5 percentage points at a 95% confidence level. With no prior estimate, p remains at 0.5.
- The initial sample size is n0 = 1.962 × 0.5 × 0.5 ÷ 0.052 = 384.16.
- After applying the population correction, the figure becomes n = 384.16 × 2,000 ÷ (2,000 + 384.16) = 322.26.
- After rounding up, it's 323 employees.
Without considering the population size, the answer would be 385. The steps below show the same figures.

The z values in the calculator are rounded to two decimal places, like 1.96 for 95% and 2.58 for 99%. This rounding can raise the result slightly: at 99% and 5% the calculator gives 666 where z = 2.5758 gives 664.
If you anticipate some non-responses, it's wise to invite more than just the sample size. With a 40% response rate, 323 responses require approximately 323 ÷ 0.4 = 807.5 invitations, leading to 808. These figures assume a random sample. Inviting more people raises the count, not how representative the replies are.
Why the population size matters so little#
The correction only makes a real difference when the sample is a large share of the population. For a group of 100, the calculator asks for 80 responses at 95% confidence and a 5% margin. For 1,000, it asks for 278. For 10,000, it asks for 370, and from about 1,000,000 up, it settles at 385. The chart below shows this climb.

This explains why national polls can rely on a sample of about a thousand people. The precision mainly depends on how many people respond, not the size of the country.
Working the other way: margin of error#
The Margin of Error tab addresses the opposite question. You enter the number of responses you have, the confidence level, and the proportion. It then returns the margin of error. 100 responses at 95% confidence and 50% give 9.8%. The company survey with 323 responses out of 2,000 comes out at 4.994419%, just inside the 5% target.
Precision gets costly. Halving the margin requires four times the sample size. With an unlimited population, 385 responses provide 4.994542%, while 1,540 responses deliver 2.497271%.
Choosing a confidence level#
Higher confidence demands a larger sample. The calculator offers 12 confidence levels and uses the z value shown for each. Each z leaves that share of a normal curve in the middle, and the z-score calculator returns 1.96 for a middle area of 0.95. The last column represents the sample size needed at a 5% margin, a 50% proportion, and an unlimited population.
| Confidence Level | Z Value Used | Sample Size At 5% Margin |
|---|---|---|
| 70% | 1.04 | 109 |
| 75% | 1.15 | 133 |
| 80% | 1.28 | 164 |
| 85% | 1.44 | 208 |
| 92% | 1.75 | 307 |
| 95% | 1.96 | 385 |
| 96% | 2.05 | 421 |
| 98% | 2.33 | 543 |
| 99% | 2.58 | 666 |
| 99.9% | 3.29 | 1,083 |
| 99.99% | 3.89 | 1,514 |
| 99.999% | 4.42 | 1,954 |
Where sample size calculations are used#
- Customer and employee surveys, for instance, to determine the share of staff who would use a new benefit.
- Opinion polls, where the result is a percentage with a margin of error.
- Quality checks, to estimate the share of faulty items in a batch.
- Research planning, to decide how many people to recruit before a study begins.
- Reporting the result: divide the yes answers by all responses, which the percentage calculator does, and quote it with the margin of error.
Sample sizes by population and margin of error#
All values below are calculated using 95% confidence and a 50% proportion, exactly the way the calculator does it.
| Population | ±10% | ±5% | ±3% | ±1% |
|---|---|---|---|---|
| 100 | 49 | 80 | 92 | 99 |
| 500 | 81 | 218 | 341 | 476 |
| 1,000 | 88 | 278 | 517 | 906 |
| 2,000 | 92 | 323 | 696 | 1,656 |
| 5,000 | 95 | 357 | 880 | 3,289 |
| 10,000 | 96 | 370 | 965 | 4,900 |
| 100,000 | 96 | 383 | 1,056 | 8,763 |
| 1,000,000 | 97 | 385 | 1,066 | 9,513 |
| Unlimited | 97 | 385 | 1,068 | 9,604 |
Sources#
Frequently asked questions#
Why use 50% for the population proportion?#
The product p × (1 − p) reaches its maximum at 0.5. So 50% gives the largest sample size and covers any true value. If a prior survey revealed 20%, entering 20 decreases the 95% and 5% sample size from 385 to 246.
How many responses do I need for a 3% margin of error?#
When you're aiming for 95% confidence and 50%, an unlimited population will require 1,068 responses. However, if you're dealing with a population of 2,000, the calculator indicates that you need 696 responses.
Why is there no 90% option?#
You'll notice that the confidence menu jumps from 85% to 92%. If you need 90% confidence, you should use z = 1.645, following the guidance from OpenStax, and calculate the formula manually: 1.6452 × 0.25 ÷ 0.052 = 270.6. That gives 271 responses for a large population.
What if I get fewer responses than planned?#
If you receive fewer responses than expected, input the actual number in the Margin of Error tab to determine the margin your survey supports. If you planned for 323 responses out of 2,000, the margin will be approximately 5%, and collecting fewer answers will increase it.
Can it size an A/B test or a power analysis?#
The calculator isn't designed for sizing A/B tests or conducting a power analysis. It calculates a sample size to estimate a single percentage. Comparing two groups or identifying a difference with a specific statistical power requires a different formula. Estimating an average, such as weekly hours worked, also needs a different input: the standard deviation, which the standard deviation calculator finds from pilot data.
Should I enter 0 for an unlimited population?#
Either works. Enter 0 or leave the population size box empty, and the calculator applies no population correction. Any other population size must be a whole number of 1 or more.