Confidence Interval Visualizer
12 Real-World Examples — click to load:
Enter successes and sample size. Uses the Wilson score method (more accurate than the normal approximation for small n or extreme p).
Proportion examples:
See how margin of error shrinks as sample size grows. The √n relationship means diminishing returns — quadrupling n only halves ME.
The simulator draws 30 independent samples, computes a CI for each, and shows which contain the true μ — demonstrating what “95% confidence” really means.
What Is a Confidence Interval?
A confidence interval (CI) is a range of plausible values for a population parameter, computed from sample data. A 95% CI means: using this procedure across many independent samples, 95% of the resulting intervals would contain the true parameter. The interval either does or doesn’t contain the true value — the “95%” refers to the method’s long-run success rate, not to any single interval.
t-Interval vs z-Interval
Critical Values at Common Confidence Levels
| Confidence | z* | t* (df=10) | t* (df=20) | t* (df=30) | t* (df=60) |
|---|---|---|---|---|---|
| 90% | 1.645 | 1.812 | 1.725 | 1.697 | 1.671 |
| 95% | 1.960 | 2.228 | 2.086 | 2.042 | 2.000 |
| 99% | 2.576 | 3.169 | 2.845 | 2.750 | 2.660 |
| 99.9% | 3.291 | 4.587 | 3.850 | 3.646 | 3.460 |
Sample Size and Margin of Error
ME = t* · s/√n. To halve the ME, quadruple n. To reduce ME by 90%, you need 100× the original sample. This is why survey researchers carefully calculate required sample sizes in advance — use the Sample Size tab above to explore this for your data.
CI and Hypothesis Testing — Two Sides of the Same Coin
A two-tailed t-test at α level rejects H₀: μ = μ₀ if and only if μ₀ falls outside the (1−α) CI. Computing a CI gives strictly more information than the test: it shows all plausible values for μ, not just a binary decision.
Related Topics
Sources:
- Neyman, J. (1937). Outline of a Theory of Statistical Estimation. Phil. Trans. Royal Society A, 236, 333–380.
- NIST Engineering Statistics Handbook — Confidence Intervals
- Wilson, E.B. (1927). Probable inference, the law of succession, and statistical inference. JASA, 22, 209–212.
Frequently Asked Questions
If you repeated your sampling procedure many times and computed a CI each time, 95% of those intervals would contain the true population mean. It does NOT mean there is a 95% probability the true mean is in this specific interval — the true mean is fixed. The probability describes the long-run behavior of the procedure, not a single interval.
ME = t* · s/√n, so width = 2·ME. Doubling n reduces width by √2 ≈ 1.41; quadrupling n halves width. Use the Sample Size tab to see this effect visually for your standard deviation. The diminishing-returns pattern means there’s a point where extra data has negligible benefit.
The t-interval accounts for uncertainty in estimating σ from s. When n is small, this uncertainty inflates the critical value: t*(df=10, 95%) = 2.228 vs z* = 1.960. As n increases, the t-distribution converges to N(0,1) and t* → z*. For df ≥ 100, the difference is negligible (<1%).
No. “Fail to reject H₀” does not mean H₀ is true. It means the data is consistent with H₀ — but many other hypotheses are also consistent with the data (all values inside the CI). The CI captures all null values you would fail to reject. Absence of evidence is not evidence of absence.
The simulation draws 30 independent random samples from N(μ, σ²), computes a CI for each, and shows which contain the true μ (green) vs miss (red). For a 95% CI, expect about 28–29 of 30 to hit. This demonstrates that “95% confidence” is a long-run frequency, not a probability for any single interval.