Sample size to estimate a mean
Uses a standard deviation from a pilot study or past data and the margin of error you can accept.
- z-score1.96
- z × σ ÷ E9.8
- Before rounding96.04
- Sample size, rounded up97
Sample size formula for a mean
The standard deviation has to come from somewhere before the study starts: a pilot sample, last year's data, or a published study. If you have a list of pilot values, get σ from the standard deviation calculator first, using the sample version.
Halving the margin of error quadruples the sample, because E is squared in the denominator. A margin of 1.5 instead of 3 needs 385 people instead of 97.
Sample size for a proportion
Surveys and polls estimate a share, such as the percent of voters who favor a measure. p × (1 − p) peaks at p = 0.5, so 50% is the safe choice when no estimate exists. An expected 30% with a 4% margin needs 505 responses at 95% confidence.
Choosing the confidence level and z-score
| Confidence | z-score | Mean: σ 15, E 3 | Proportion: p 50%, E 5% |
|---|---|---|---|
| 90% | 1.645 | 68 | 271 |
| 95% | 1.96 | 97 | 385 |
| 99% | 2.576 | 166 | 664 |
95% is the usual default in research and market surveys. 99% costs about 70% more respondents than 95% for the same margin.
Small populations: the finite correction
When the sample is a large share of the whole group, fewer responses are needed. A survey of a company with 1,000 employees at 95% confidence and a 5% margin needs 278 answers instead of 385. For populations in the hundreds of thousands, the correction barely moves the result.
Worked examples
- Average delivery time, σ = 15 minutes, margin 3 minutes, 95%: n = 97 orders.
- Same study at 99% confidence: (2.576 × 5)² = 165.89, so 166 orders.
- Customer satisfaction share, no prior estimate, margin 5%, 95%: 385 responses.
- Same survey among 1,000 customers only: 278 responses.
Back to the calculator
Main calculatorStandard deviation calculatorSample and population standard deviation, variance, and meanRelated calculators
- Average calculator: Mean, median, mode, range, and weighted, geometric, harmonic averages
- Percentage calculator: X% of Y, percent change, discounts, and markups
- Scientific calculator online: Sin, cos, log, roots, powers, and percent, in degrees or radians
Frequently asked questions
How do you calculate sample size with standard deviation?
Multiply the z-score by the standard deviation, divide by the margin of error, square the result and round up. With σ = 15, E = 3 and 95% confidence, n = 97.
What sample size do I need for 95% confidence and a 5% margin?
385 for a proportion when no prior estimate exists, using p = 0.5.
What z-score goes with 95% confidence?
1.96. For 90% use 1.645 and for 99% use 2.576.
Why round the sample size up?
Rounding down would give a margin of error slightly larger than the target, so 96.04 becomes 97.
Do I need a bigger sample for a bigger population?
Only up to a point. Past a few tens of thousands, the population size barely changes n; the finite correction matters when the sample is a large share of the group.
Sources and method
- NIST/SEMATECH e-Handbook of Statistical Methods
- William G. Cochran, Sampling Techniques
Every calculation on this page was checked against hand-worked examples. See the Calterix methodology.