How to use
- Choose Mean or Proportion.
- For a mean, enter mean, SD and n or paste raw data; for a proportion, enter successes and sample size.
- Choose the confidence level and read the interval.
Options explained
- Mean
- Mean ± t × SD ÷ √n; with a known population σ, z is used instead of t.
- Proportion
- The Wilson interval is far more accurate than Wald (p ± z√(p(1−p)/n)) for small samples or proportions near 0 or 100%, and is recommended.
Worked example
A sample of n = 25 has mean 50 and SD 10. The standard error is 10 ÷ √25 = 2, and the t value with 24 degrees of freedom is 2.0639 at 95%:
margin = 2.0639 × 2 = 4.128
95% CI = 50 ± 4.128 = 45.87 to 54.13
99% CI: t = 2.7969, margin 5.594, so 44.41 to 55.59
A higher confidence level gives a wider interval.
Why Wilson for proportions
For 8 successes out of 20 (p = 0.40), the Wald interval is 18.5% to 61.5% and the Wilson interval is 21.9% to 61.3%. The difference is larger at the extremes: 0 out of 20 gives a Wald interval of exactly 0% to 0%, which says there is no uncertainty at all, while Wilson gives 0% to 16.1%.
Wilson centre = (p + z²/(2n)) ÷ (1 + z²/n)
half-width = z × √(p(1−p)/n + z²/(4n²)) ÷ (1 + z²/n)
Frequently asked questions
What does a 95% confidence interval mean?
If you repeated the sampling many times, about 95% of such intervals would contain the true value. It does not mean a 95% chance for this particular interval.
When should I use z instead of t?
Use t unless you truly know the population standard deviation.
Is my data uploaded?
No. Calculations run in your browser.
Privacy
This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.