Sample size calculator for surveys
How many responses you need to estimate a percentage or a mean, with finite population, design effect and response rate.
Calculator inputs
Results
Enter your values and press “Calculate” to see the result.
| Confidence | Sample needed |
|---|---|
| 90 % | 271 |
| 95 % | 385 |
| 99 % | 664 |
| Margin of error (% points) | Sample needed |
|---|---|
| 1 | 9,604 |
| 1.5 | 4,269 |
| 2 | 2,401 |
| 2.5 | 1,537 |
| 3 | 1,068 |
| 4 | 601 |
| 5 | 385 |
| 6 | 267 |
| 7 | 196 |
| 8 | 151 |
| 10 | 97 |
See the working step by step
- z = 1.9600; infinite population: 385
In short
- What it calculates
- How many responses you need to estimate a percentage or a mean, with finite population, design effect and response rate.
- Formula used
Percentage: n₀ = z² · p · (1 − p) / e²- Example
- Example 1. An opinion poll.
Sample size calculator
It is the first figure any thesis committee, ethics board or research client asks for: how many responses do you need for the results to be worth anything? The answer depends on three choices of yours: how much confidence you want, how much error you accept and, if you are estimating a mean, how much the data vary.
Choose whether you want to estimate a percentage or a mean, enter the margin of error and you get the valid responses you need, how many people to invite given the response rate, and how the sample changes if you change the margin or the confidence. Everything runs in your browser.
How it works
First it works out the size for an infinite population; then it corrects for a finite population (which lowers it when the universe is small) and multiplies by the design effect if sampling is not simple random. The result is rounded up.
The response rate does not change the responses you need, but it does change how many people you must invite: responses ÷ rate. With an expected percentage of 50% the sample is the largest possible, which is why it is the cautious choice when you have no prior estimate.
Formula
Percentage: n₀ = z² · p · (1 − p) / e²
Mean: n₀ = ( z · σ / E )²
Finite population: n = n₀ / (1 + (n₀ − 1) / N)
Design effect: final n = n · deff (rounded up)
Invitations = final n / response rate
z = 1.960 at 95%; 1.645 at 90%; 2.576 at 99%
Worked example
Example 1. An opinion poll.
Very large population, 95% confidence, ±5-point margin and a 50% proportion (the cautious choice): n = 1.96² × 0.25 / 0.05² = 384.1, so you need 385 responses. With ±3 points it is 1,068; with ±1 point, 9,604.
Example 2. A school of 2,000 pupils.
Same criteria but a population of 2,000: n₀ = 384.1 and n = 384.1 / (1 + 383.1/2,000) = 322.3, that is, 323 pupils (16.2% of the school) instead of 385.
Example 3. Estimating a mean.
You want the average score on a test whose standard deviation is about 15 points, with ±2 points of error and 95% confidence: n = (1.96 × 15 / 2)² = 216.1, so 217 people. If the group is 500, it drops to 152.
Example 4. Cluster sampling and low response.
The same survey as example 1, but by clusters (design effect of 1.5) and a 30% response rate: 385 × 1.5 = 577 valid responses, and to get them you have to invite 577 / 0.30 = 1,924 people.
Explanation
What sample size you need and why
A sample does not have to be a fixed percentage of the population: what matters is the absolute sample size, the margin of error you accept and the confidence you demand. That is why 385 responses work equally well for a city of 100,000 and a country of 40 million.
The three decisions
- **Margin of error**: how much you accept being wrong. It weighs the most: the sample grows with the square of the precision.
- **Confidence level**: 95% is usual. 99% needs a good deal more sample.
- **Variability**: for a percentage, the most demanding case is 50%; for a mean, the standard deviation.
Finite population
When the population is small, each response carries more information and the sample you need drops. The correction only matters if the sample exceeds 5% of the population; with large populations it changes nothing.
Design effect and response rate
- If you sample by **clusters** (schools, neighbourhoods, households), multiply by the design effect (between 1.2 and 2 in most surveys).
- If not everyone answers, the effective sample is the **valid responses**: invite more people, according to the response rate you expect.
Common mistakes
- Thinking you need a fixed percentage of the population (say 10%).
- Forgetting the response rate and falling short.
- Computing the sample for the total and then analysing subgroups: each subgroup needs its own size.
- Using a convenience sample (people who answer of their own accord) and quoting the margin of error as if it were random: the margin only holds for probability samples.
- Using this calculator to compare two groups: for that you need statistical power.
Limits of this calculator
- It assumes simple random sampling, apart from the design effect you enter.
- For a mean it uses the normal distribution (z) and a known or estimated standard deviation; with very small samples (under 30) Student’s t and a pilot study would be better.
- It does not compute group comparisons, correlations or regressions: for those, use the power calculator.
- It accepts populations from 2 and margins up to ±50 points.
Notice
This is an estimate. For research, justify the calculation in your protocol and consult a statistician if the design is complex.
Frequently asked questions
Which margin of error should I choose?
5% is the standard in social and market research. Critical decisions drop to 3% or 1%, at the cost of a much larger sample.
Why use a 50% proportion?
Because p(1−p) peaks at 0.5: it gives the largest and therefore safest sample when you do not know what to expect.
Does it work for very large populations?
Yes. Enter 0 for the population (or leave it empty) and the infinite population formula is applied. Beyond about 20,000 people, population size barely changes the result.
What is the response rate?
The percentage of invited people who answer. If you expect 30%, you must invite more than three times the responses you need.
What is the design effect?
The factor that increases the sample when you do not sample at random from everyone but by groups (schools, neighbourhoods). With simple random sampling it is 1.
What if I do not know the standard deviation?
Estimate it with a pilot study, similar research or the range divided by 4. If in doubt, use a somewhat larger value, which is the cautious choice.
Does it work to compare two groups?
No. To compare groups (A/B, treatment and control) you must compute statistical power; use the power and sample size calculator.
Is my data sent to a server?
No. The calculation runs in your browser.
Sources and references
The formula behind this calculator is not ours. These are the sources it comes from, in APA 7 format, in case you want to go to the original or cite them in your own work.
- Cochran, W. G. (1977). Sampling techniques (3.ª ed.). John Wiley & Sons. The sample size formula and the finite population correction.
- Kish, L. (1965). Survey sampling. John Wiley & Sons. The design effect in cluster sampling.
- Lohr, S. L. (2019). Sampling: Design and analysis (2.ª ed.). Chapman and Hall/CRC. A modern reference on survey design and analysis.
Need to calculate something else?
These tools are often used alongside this calculator.
Power & sample size
How many participants do you need? Work out sample size for a t test, correlation, ANOVA, proportions or…
Margin of error
How precise your survey is, given the sample you actually collected.
Confidence interval
The range the true mean is likely to fall in at your chosen confidence level.
Standard deviation
Sample and population deviation, variance and coefficient of variation.
Z score
How many standard deviations a value sits from the mean and which percentile it occupies.
Chi-square
Chi-square test for contingency tables and goodness of fit, with Cramér’s V, residuals, Yates’ correction…