Confidence Interval Calculator
Reviewed by CalcMulti Editorial Team·Last updated: ·← Statistics Hub
A confidence interval gives a range of plausible values for an unknown population parameter, based on sample data. A 95% CI means: if we repeated the sampling process many times, 95% of the intervals constructed this way would contain the true parameter.
This calculator computes CIs for a sample mean (t-distribution, unknown σ) and for a sample proportion (z-distribution). Enter your sample statistics to get the interval bounds, margin of error, and an interpretation at your chosen confidence level.
Formula
CI for mean: x̄ ± t* × (s / √n) CI for proportion: p̂ ± z* × √(p̂(1−p̂) / n)
- x̄
- sample mean
- t*
- critical t-value for chosen confidence level and df = n−1
- s
- sample standard deviation
- p̂
- sample proportion (observed successes / n)
- z*
- critical z-value: 1.645 (90%), 1.960 (95%), 2.576 (99%)
Choosing Your CI Method — z vs t vs Wilson Score
| Situation | Method | Formula | When it fails |
|---|---|---|---|
| Mean, σ unknown (usual) | t-interval | x̄ ± t* × s/√n | n < 30 and non-normal data |
| Mean, σ known (rare) | z-interval | x̄ ± z* × σ/√n | σ almost never known in practice |
| Proportion, large n | Normal approx (z) | p̂ ± z* × √(p̂(1-p̂)/n) | np̂ < 5 or n(1−p̂) < 5 |
| Proportion, small n or p near 0/1 | Wilson score | Complex — see R prop.test() | Simple formula breaks near 0 or 1 |
| Large n (n > 200) | z or t (same result) | Either — t → z for large df | No failure — results identical |
| Difference of two means | Two-sample t or Welch | Welch t preferred (unequal σ) | Equal-variance t wrong when σ differ |
Case Study: Political Poll Margin of Error
A polling firm surveyed 847 registered voters on support for a ballot measure. 512 supported it — p̂ = 512/847 = 60.5%. The firm needed to report a 95% confidence interval for the press release.
SE = √(0.605 × 0.395 / 847) = √(0.000282) = 0.01680. MOE = 1.96 × 0.01680 = ±3.3%. CI: [57.2%, 63.8%].
The headline: "60.5% support the measure, ±3.3% at 95% confidence." Since the entire CI [57.2%, 63.8%] was above 50%, the measure was predicted to pass with statistical confidence. The firm also noted: if they wanted ±2% MOE, they would need n = 1.96² × 0.605 × 0.395 / 0.02² ≈ 2,286 respondents — nearly 3× the current sample.
Related Calculators
Find critical t for any df and α
Sample Size Calculatorn needed for target margin of error
Standard Error CalculatorSE of the mean — CI building block
Z-Score CalculatorCritical z-values for CI
P-Value CalculatorCI–hypothesis test duality
T-Test CalculatorHypothesis test equivalent to CI
Statistics HubAll statistics calculators & guides
Disclaimer
This calculator is for educational purposes only and does not constitute professional advice. Results are based on standard mathematical formulas. Always verify critical calculations with a qualified professional before making important decisions.