BY: Statistics Fundamentals Team  |  Reviewed By: Minsa A (Senior Statistics Editor)

Confidence Interval Visualizer

Calculate and visualize confidence intervals for population means and proportions. Draws 90%, 95%, and 99% CIs side-by-side on a number line. Features 12 real-world datasets, a sample-size sensitivity explorer, a Monte Carlo simulation showing how often CIs capture the true mean, and a Wilson score proportions CI tab.

Confidence Interval Visualizer

t-intervalx̄ ± t*(df,α/2) · s/√n z-intervalx̄ ± z*(α/2) · σ/√n

12 Real-World Examples — click to load:

From datax̄ = Σxᵢ/n   s = √[Σ(xᵢ−x̄)²/(n−1)]
Wilson CIp̃ ± z·√(p̃(1−p̃)/ñ)   ñ=n+z²

Enter successes and sample size. Uses the Wilson score method (more accurate than the normal approximation for small n or extreme p).

Proportion examples:

ME formulaME = t* · s/√n  →  halve ME: need 4× n

See how margin of error shrinks as sample size grows. The √n relationship means diminishing returns — quadrupling n only halves ME.

Repeated sampling95% of 95% CIs should contain the true μ

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

t-interval (σ unknown — the typical real-world case): x̄ ± t*(α/2, df=n−1) · s/√n. Critical value t* is larger than z*, giving a wider, more conservative interval.
z-interval (σ known, or very large n): x̄ ± z*(α/2) · σ/√n. As n → ∞, t* → z* and the two intervals converge.

Critical Values at Common Confidence Levels

Confidencez*t* (df=10)t* (df=20)t* (df=30)t* (df=60)
90%1.6451.8121.7251.6971.671
95%1.9602.2282.0862.0422.000
99%2.5763.1692.8452.7502.660
99.9%3.2914.5873.8503.6463.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.