Confidence Interval Calculator
Compute z or t confidence intervals for a mean, with margin of error breakdown.
A confidence interval gives a range of plausible values for an unknown population parameter. '95% CI' means: if we repeated the sampling many times, 95% of the intervals we built this way would contain the true value. Use t-intervals for means with unknown population SD (most cases), z for very large samples, and the Wald formula for proportions.
How the interval is built
estimate ± critical value × standard error.
Estimate — your sample mean or proportion.
Standard error — the SD of the estimate. For a sample mean, SE = s/√n; for a proportion, SE = √(p̂(1−p̂)/n).
Critical value — how many SEs out you need to reach to capture the target confidence. Comes from the t (small n, unknown σ) or normal (large n or known σ) tables. For 95% it's about 1.96 for z, slightly larger for t.
When to use t vs z for a mean
If you know σ exactly, use z. This almost never happens in practice.
If you're estimating σ from the sample (using s), use t with df = n − 1. The t critical values are bigger than z critical values, which correctly widens the interval to account for uncertainty in s.
As n grows, t converges to z. By n = 60 the two are essentially identical; the choice mostly matters for n < 30.
Worked example — average commute
Survey of 30 commuters: mean = 32 minutes, s = 8 minutes. 95% CI for the population mean?
SE = 8 / √30 ≈ 1.461.
t(0.975, df = 29) ≈ 2.045. Margin of error = 2.045 · 1.461 ≈ 2.99 minutes.
95% CI: 32 ± 2.99 → (29.0, 35.0).
Interpretation: if we repeated this survey many times, about 95% of such intervals would cover the true average commute time. We do NOT say there is a 95% probability the true mean lies in this specific interval (that's a Bayesian credible interval).
Confidence interval for a proportion
Wald formula: p̂ ± z · √(p̂(1−p̂)/n). Works well when np̂ ≥ 10 and n(1−p̂) ≥ 10.
Edge cases (p̂ near 0 or 1, small n) are better handled by Wilson or Agresti-Coull intervals. The Wald interval can dip below 0 or above 1, which is impossible.
Example: 240 of 400 customers say yes (p̂ = 0.60). 95% Wald CI = 0.60 ± 1.96 · √(0.60·0.40/400) = 0.60 ± 0.048 = (0.552, 0.648).
Common pitfalls
Saying 'there's a 95% chance the parameter is in this interval'. The parameter is fixed; the interval is random. The 95% refers to the long-run capture rate.
Using a small-sample interval when the data is heavily skewed. CIs assume the sampling distribution of the mean is roughly normal — true for any shape when n is large, but failing for small skewed samples.
Confusing CI width with effect size. Wider intervals just mean more uncertainty; they don't change the point estimate.
Treating overlapping intervals as 'no difference'. Two CIs can overlap and the difference still be statistically significant — use a CI on the difference instead.
Frequently asked questions
Why is the 95% critical value 1.96?
Because Φ⁻¹(0.975) = 1.96 — 95% of a standard normal sits between −1.96 and +1.96.
How do I shrink the interval?
Larger n (interval shrinks like 1/√n), lower confidence level (95→90 narrows it), or reduced variability.
What if my data isn't normal?
CIs on means are robust for n ≥ 30 by the CLT. For small skewed samples, use bootstrap or transform the data.
Is this the same as a hypothesis test?
Closely related. A 95% CI that excludes a hypothesised value is equivalent to rejecting H₀ at α = 0.05 in a two-sided test.
More in Statistics & Probability
From z-scores and confidence intervals to t-tests, chi-square, correlation, regression, and the binomial/Poisson distributions — textbook-grade tools with worked examples.
- Z-Score Calculator
Convert a value to a z-score, percentile, and tail probabilities using the standard normal distribution.
- Normal Distribution Calculator
Find P(X<x), P(X>x), and between-range probabilities for any normal distribution with mean μ and SD σ.
- Binomial Distribution Calculator
Compute P(X=k), cumulative probabilities, mean, and variance for n trials with success probability p.
- Poisson Distribution Calculator
Model rare events with rate λ — get P(X=k), cumulative probability, mean, and variance.
- Permutations & Combinations Calculator
Compute nPr (order matters) and nCr (order doesn't) with full counting-principle explanation.
- Bayes' Theorem Calculator
Update prior beliefs with new evidence using Bayes' rule — posterior probability with tree diagram.
Related calculators
Browse all Education →Sample Size Calculator
Required sample size to estimate a proportion or mean at a chosen confidence level and margin of error.
Standard Deviation Calculator
Mean, median, mode, range, sample/population standard deviation, variance, quartiles, IQR, and SEM for any list of numbers.
Average Calculator
Mean, median, mode, sum, count, min, max, and range for any list of numbers.
T-Test Calculator
One-sample and two-sample t-tests with t-statistic, p-value, and rejection regions.
Z-Score Calculator
Convert a value to a z-score, percentile, and tail probabilities using the standard normal distribution.
Binomial Distribution Calculator
Compute P(X=k), cumulative probabilities, mean, and variance for n trials with success probability p.
Poisson Distribution Calculator
Model rare events with rate λ — get P(X=k), cumulative probability, mean, and variance.
Fraction Calculator
Add, subtract, multiply, and divide fractions and mixed numbers — results returned simplified, as a mixed number, and as a decimal.