Sample Size Calculator for a Mean (Margin of Error and Confidence)
How many observations you need to estimate a mean within a chosen margin of error at 90%, 95% or 99% confidence.
Inputs
- Working
- (1.96 × 15 ÷ 2)² = 216.09, rounded up to 217
- Z critical
- 1.96
- Margin (E)
- ±2
- σ assumed
- 15
- For half the margin
- 865 (four times as many)
Use this calculator on your own site
Free embed
- Two lines of HTML, unlimited views
- Shows a small CalculateEveryday bar, with a credit link under the calculator
What each Sample Size for a Mean input means
- Margin of error
- The margin of error you can accept, in the units of the measurement: ±2 points, ±0.5 kg, ±5 minutes.
- Expected std dev
- Your best estimate of the standard deviation, from a pilot study, an earlier survey or the range ÷ 4.
- Confidence
- The confidence level: 90%, 95% or 99%, with z = 1.645, 1.96 or 2.576. 95% is what nearly every report means.
Sample Size for a Mean formula
n = (z × σ ÷ E)², rounded up · E = margin of error you will accept · z = 1.645 (90%), 1.96 (95%), 2.576 (99%)
The error bound of a confidence interval is z × σ ÷ √n; turn that round to ask how big n must be for a bound you can accept, and it is n = (zσ ÷ E)². Three things go in: the margin you can live with, the confidence level, and a guess at the standard deviation — from a pilot study, an earlier survey or a range rule of thumb (range ÷ 4). The answer is always rounded up, because a fraction of an observation cannot be collected and rounding down would miss the target. The square is the expensive part: halving the margin multiplies the sample by four, and moving from 95% to 99% confidence multiplies it by (2.576 ÷ 1.96)² = 1.73.
Sample Size for a Mean worked example
To estimate a mean within ±2 with a standard deviation of about 15 at 95% confidence: (1.96 × 15 ÷ 2)² = (14.7)² = 216.09, rounded up to 217 observations. Accepting ±4 instead needs only (7.35)² = 54.02 → 55; wanting ±1 needs 865. At 99% confidence the ±2 answer rises to (2.576 × 15 ÷ 2)² = 373.3 → 374.
More Sample Size for a Mean examples
To estimate a mean within ±5 when the standard deviation is about 20, at 95%: (1.96 × 20 ÷ 5)² = 61.47, so a sample of 62. Halving the margin to ±2.5 needs 246.
A machine's average fill to within ±0.5 g, standard deviation 3 g, at 90%: (1.645 × 3 ÷ 0.5)² = 97.42, so weigh 98 packs.
Where the Sample Size for a Mean calculator can give the wrong answer
- The standard deviation is a guess before the data exist, and the sample size scales with its square. If the pilot estimate is 20% low, the sample is 31% too small; err on the high side.
- This is the formula for estimating a mean. Estimating a proportion (a poll percentage) uses n = z² p(1 − p) ÷ E², which at p = 0.5 and 95% gives 1,067.1 for ±3% — 1,068 once rounded up.
- Non-response, dropouts and unusable records mean the collected sample has to be larger than the calculated one. Divide by the expected response rate: 217 needed at a 60% response means 362 approached.
- For very small populations a finite-population correction reduces the required n; the page assumes the population is large compared with the sample.
- The rounding is always up. 216.09 becomes 217, not 216, because 216 would leave the margin slightly above the target.
Spotted a mistake? Tell us
Sample Size for a Mean reference table
| Margin of error | 90% | 95% | 99% |
|---|---|---|---|
| ±1 | 609 | 865 | 1,494 |
| ±2 | 153 | 217 | 374 |
| ±3 | 68 | 97 | 166 |
| ±5 | 25 | 35 | 60 |
| ±10 | 7 | 9 | 15 |
Sample Size for a Mean FAQ
- n = (z × σ ÷ E)². For a margin of ±5, a standard deviation of 20 and 95% confidence: (1.96 × 20 ÷ 5)² = (7.84)² = 61.5, so 62 observations. Enter your margin, standard deviation and confidence level and the page does the arithmetic and the rounding.
- Because the margin shrinks with the square root of n. To cut it in half, √n has to double, so n has to quadruple. The page shows the sample for half your margin next to the main answer.
- A pilot study is best. Failing that, use the standard deviation from a published study of the same measure, or the range rule: (largest plausible value − smallest) ÷ 4. Whatever you use, the sample size is only as good as that guess, so round up generously.
- Thirty is the rule of thumb for when the sample mean's distribution is close enough to normal for z methods to work; it says nothing about precision. Whether 30 is enough depends on the margin you need: with σ = 15 it gives a 95% margin of ±5.4.
- Use n = z² × p(1 − p) ÷ E² rather than this page's formula. At 95% confidence, ±3 points and the worst case p = 0.5: 1.96² × 0.25 ÷ 0.03² = 1,067.1, so 1,068 people.