Quick answer: A sample of 25 with mean 50 and standard deviation 10 gives a 95% interval of 50 ± 2.0639 × 10 ÷ √25 = 50 ± 4.1278, so 45.8722 to 54.1278.
How it's calculated
Mean: x̄ ± critical value × SD ÷ √n. When the standard deviation comes from the sample, the critical value is Student's t with n − 1 degrees of freedom (2.0639 for 95% and n = 25); when the population σ is known, it is z (1.96 for 95%). Some calculators always use z; for small samples that gives an interval that is too narrow, so choose “Known σ (z)” only when σ really is known.
Proportion: p̂ ± z·√(p̂(1 − p̂) ÷ n), the Wald interval. The Wilson score interval is shown alongside; it behaves better when n is small or p̂ is near 0% or 100%.
A 95% confidence level means that intervals built this way contain the true value in 95% of samples. A higher level or a smaller sample gives a wider interval. To plan how many responses you need for a given margin, use the sample size calculator.
Worked examples
- x̄ = 50, s = 10, n = 25, 95%: 50 ± 4.1278 → 45.8722 – 54.1278
- Same with known σ = 10: 50 ± 1.96 × 2 = 50 ± 3.9199
- 520 yes out of 1,000, 95%: 52% ± 3.1% → 48.9% – 55.1%
Critical values (two-sided)
| Confidence | z* | t* (df = 10) | t* (df = 30) |
|---|---|---|---|
| 90% | 1.645 | 1.812 | 1.697 |
| 95% | 1.960 | 2.228 | 2.042 |
| 99% | 2.576 | 3.169 | 2.750 |
Frequently asked questions
Should I use z or t?
Use t when the standard deviation is estimated from your sample, which is almost always. Use z only when the population standard deviation is genuinely known. For large samples the two are nearly the same.
Does a 95% interval mean a 95% chance the true value is inside?
Strictly, the 95% describes the method: 95% of intervals made this way contain the true value. Any one interval either contains it or not.
How can I make the interval narrower?
Collect a larger sample (the margin shrinks with √n) or accept a lower confidence level.
What is the margin of error?
Half the width of the interval. With a mean of 50, an SD of 10 and 25 people at 95%, it's about 4.13, so you'd report 50 ± 4.13.
How many people should I survey?
Use the sample size calculator. Tell it the margin of error and confidence you're after and it gives you the number of responses.
What changes between a 95% and a 99% interval?
The 99% one is wider. You're more confident it holds the true value, but you pay for it in precision.