Before launching a survey, an experiment or a quality check, you need to know how many observations are enough. Too few and the margin of error is so wide the result is useless; too many and you waste time and money. This calculator answers the question in three common situations:
- Estimating a proportion — the share of customers who are satisfied, of voters who back a candidate, of parts that are defective. It uses Cochran’s formula and, if you enter the population size, the finite population correction.
- Estimating a mean — the average spend per basket, the average blood pressure in a group, the mean filling weight of a bottle — from the standard deviation you expect.
- Comparing two proportions — an A/B test or a two-arm study, where you want enough statistical power to detect a given difference.
You also get the critical value for your confidence level, the unrounded figures, and, if you expect only part of the people you contact to answer, the number of invitations to send.
Sample size is always rounded up: 384.15 respondents means 385, because 384 would not quite reach the target precision.
How to use this calculator
- Choose what you want to estimate: a proportion, a mean, or the difference between two proportions.
- Set the confidence level (95 % by default).
- For a proportion, enter the margin of error (±5 % is common) and the expected proportion (keep 50 % if unsure).
- For a mean, enter the expected standard deviation and the margin of error in the same unit.
- Optionally enter the population size when it is small (a school, a company), and the response rate you expect.
- For two proportions, enter both expected rates and the power (80 % is standard).
The table under a proportion result shows how the required sample shrinks as you accept a wider margin of error.
The formula
Proportion (Cochran). With critical value , expected proportion and margin of error :
Mean. With expected standard deviation :
Finite population correction for a population of size :
Two proportions and , two-sided test at level with power , , per group:
The product is largest at , which is why 50 % is the conservative default.
Worked example
National survey. At 95 % confidence (), with a ±5 % margin and :
so you need 385 respondents. Many textbooks round to 1.96 and write 384.16; the answer is the same once rounded up. If only 30 % of the people you contact reply, send about 1284 invitations.
Company of 1,000 employees. The correction gives , hence 278 employees.
Mean. To estimate an average test score within ±3 points when : , so 97 students.
A/B test. To detect a jump from 40 % to 60 % with 95 % confidence and 80 % power: , so 97 per group, 194 in total.
How the inputs change the sample size
| Change | 95 %, ±5 %, p = 50 % → 385 becomes |
|---|---|
| 99 % confidence | 664 |
| ±3 % margin | 1,068 |
| p = 20 % instead of 50 % | 246 |
Halving the margin of error multiplies the sample by four, because is squared. Raising the confidence from 95 % to 99 % adds about 73 %. Population size matters far less than people expect: once the population is above a few tens of thousands, the correction barely changes anything — a national poll of 60 million needs the same ~385 people as a city of 200,000.
Getting the inputs right
For , use a previous survey or a pilot; without information, 50 % guarantees the margin you asked for. For , use a pilot study or published data on a similar population; a rough rule is range ÷ 4. These formulas assume simple random sampling: a cluster or quota sample usually needs more people (a design effect of 1.5 to 2 is common). Afterwards, analyse your results with the confidence interval calculator and the point estimate calculator.
Frequently asked questions
Why is 385 the magic number for surveys?
It is the result of Cochran’s formula for 95 % confidence, a ±5 % margin of error and the worst-case proportion of 50 %, for a large population. Any survey with at least 385 random respondents meets that precision for every yes/no question.
Does a bigger population need a bigger sample?
Only slightly, and only for small populations. The precision of a random sample depends mainly on its size, not on the share of the population surveyed. The finite population correction reduces the sample when the population is small (1,000 → 278 instead of 385).
What margin of error should I choose?
±5 % is standard for opinion and satisfaction surveys, ±3 % for published polls, ±1–2 % when small differences matter. Smaller margins quickly become expensive: ±3 % needs 1,068 respondents, ±1 % more than 9,600.
What is statistical power?
Power is the probability that your study detects a difference that really exists. With 80 % power, a real difference of the size you entered is found 4 times out of 5; the rest of the time the test misses it (a type II error).
What if my response rate is low?
Divide the required sample by the expected response rate to know how many people to contact. Be aware that non-response can bias the results if those who answer differ from those who do not — a larger sample does not fix that.
Sources
- W. G. Cochran, Sampling Techniques, 3rd ed., Wiley (1977), §4.4 and §4.6
- NIST/SEMATECH e-Handbook, §7.2.2.2 Sample sizes required (means)
- NIST/SEMATECH e-Handbook, §7.2.4.2 Sample sizes required (proportions)
- OpenStax, Introductory Statistics 2e, §8.3 A Population Proportion
- J. L. Fleiss, B. Levin, M. C. Paik, Statistical Methods for Rates and Proportions, 3rd ed., Wiley (2003), ch. 4
Last updated: