Confidence Interval Calculator
A confidence interval gives a range of plausible values for what is really true in the population, not just a single point estimate. Pick a flavor (mean, proportion, difference, correlation, regression coefficient, Poisson rate, variance), drop in your stats, and get the interval, half-width, and reproducible R for every method.
New to confidence intervals? Read the 4-min primer ▾
What it is. You measure something on a small sample (50 customers, 30 patients, a handful of widgets) and you want to know what's true for the whole population. A confidence interval gives you a range of plausible values for that truth - not a single guess.
How to read it. A 95% CI of (67.9, 76.1) means: if we collected fresh samples like this 100 times and computed a CI each time, about 95 of those intervals would contain the truth. It does not mean "the truth is in this interval with 95% probability" - that's a Bayesian credible interval, a different framework.
The recipe. Most CIs are estimate ± multiplier × SE. Estimate comes from your sample; multiplier comes from a probability table (≈ 1.96 for 95% under normal); SE shrinks as your sample grows. A few flavors (Wilson, Clopper-Pearson, exact Poisson) use exact methods that always behave well at the boundaries.
Picking the flavor. Numeric values from a sample → use a CI for the mean. Yes/no rates → CI for a proportion. Two groups compared → CI for a difference. Pick the matching flavor in the sentence below.
Try a real-world example to load.
A class of 30 students took a test; mean = 72, SD = 11. We want a 95% CI for the true class-level mean.
Read more Anatomy of a confidence interval
Anatomy of a confidence interval
p̂ is near 0 or 1, and matches what prop.test(..., correct = FALSE) reports. Wald is the textbook formula and is misleading at extremes - we still show it, but boxed for comparison.confint() in R does exactly this for an lm fit.Caveats When this is the wrong tool
- If you have…
- Use instead
- Bootstrap CIs from raw data
- R:
boot::boot.ci()with type = "bca" - coming as a separate tool in Batch 8. - Bayesian credible interval
- Different paradigm; we don't include here. Try a
brmstutorial. - CI for ratio of means / variances
- Fieller's theorem (means) or F-based (variances) - coming in Batch 6.
- Survival times - Kaplan-Meier confidence band
- Survival analysis tool - out of scope here.
- Median CI
- Order-statistic-based; needs raw data. Add as a v2 paste-mode option.
- Confidence intervals - what they are and aren't - frequentist vs. Bayesian, common misreadings.
- Why Wilson beats Wald for proportions - coverage simulations.
- Choosing a sample size from a target CI width - turn the formula around.
Numerical accuracy: distribution functions accurate to ~10⁻⁷ (Hart's algorithm for normal, Cornish-Fisher for t).