What Is a Confidence Interval (CI)?

A Confidence Interval (CI) gives you an informative range around a sample estimate (such as a sample mean x̄ or poll percentage p̂) instead of pretending a single sample point matches the unknown population parameter exactly. Built from two intuitive parts, a Point Estimate ± Margin of Error, a 95% Confidence Interval tells researchers how tightly repeated random sampling pins down the true population parameter μ or p.

Our Confidence Interval Calculator supports all four statistical workflows side by side: exact Student's t-intervals when population standard deviation σ is unknown (solving exact regularized incomplete Beta quantiles for any df = n − 1), Normal Z-intervals when σ is known, Binomial Proportion intervals reporting both classic Wald and modern edge-safe Wilson Score limits, and a Reverse Bounds Solver extracting point estimate, Margin of Error, and implied Standard Deviation from published [Lower, Upper] endpoints.

Confidence Interval Formulas: Student's t, Normal Z, Wald & Wilson Score

Select the equation matching your measurement type and variance assumptions:

Mean CI (Unknown σ, Student t): x̄ ± t*_(α/2, n−1) × ( s ÷ √n )
Mean CI (Known σ, Normal Z): x̄ ± Z*_(α/2) × ( σ ÷ √n )
Proportion CI (Standard Wald): p̂ ± Z* × √[ p̂(1 − p̂) ÷ n ]
Proportion CI (Wilson Score): (p̂ + Z²/2n ± Z·√[p̂(1−p̂)/n + Z²/4n²]) ÷ (1 + Z²/n)
Reverse From Published [L, U]: Point Est = (L + U) ÷ 2 | MOE = (U − L) ÷ 2
Infographic illustrating 90%, 95%, and 99% Student t Confidence Intervals for Sample Mean=78.5, s=12.4, n=25 comparing t*=2.0639 ([73.38, 83.62]) versus Z*=1.960 ([73.64, 83.36])
Diagram 1: Confidence Interval anatomy for n = 25 showing how Student's t* (df = 24) produces slightly wider safety tails than Normal Z*, and how raising confidence from 90% to 99% widens interval bounds.

Student's t vs. Normal Z: When Do You Use Each?

Students frequently ask why statistics requires two different critical multipliers (t* vs. Z*). In real research, you almost never know the true population standard deviation σ ahead of time; you only know the sample standard deviation s computed from your n observations. Substituting random sample s introduces extra tail uncertainty, which William Sealy Gosset modeled exactly with the heavier-tailed Student's t-distribution at degrees of freedom df = n − 1.

Sample Size / Degrees of Freedom 95% Critical t* (df = n − 1) 95% Normal Z* Extra Tail Width From t*
n = 5 (df = 4) 2.7764 1.9600 +41.7% wider
n = 15 (df = 14) 2.1448 1.9600 +9.4% wider
n = 25 (df = 24) 2.0639 1.9600 +5.3% wider
n = 100 (df = 99) 1.9842 1.9600 +1.2% wider

Notice that using Z* = 1.96 blindly when n = 15 understates uncertainty by nearly 10%! Because our calculator solves exact t* quantiles via regularized incomplete Beta inversion for every df ≥ 1, Mode 1 stays accurate across both tiny pilot samples (n = 4) and large datasets.

What "95% Confidence" Truly Means (And What It Does NOT Mean)

One of the most famous misconceptions in probability involves interpreting a single computed interval such as [73.38, 83.62]. In frequentist statistics, the true population mean μ is a fixed, non-random constant. Once your sample has been drawn and the numbers 73.38 and 83.62 are calculated, the true mean μ is either inside that interval or outside it; it does not bounce randomly!

What 95% confidence describes is the long-run reliability of the sampling procedure: if 100 independent research teams each collect random samples of size n and compute their own x̄ ± t*·SE intervals, approximately 95 of those 100 random intervals will successfully trap the fixed population parameter μ, while roughly 5 intervals will miss by random sampling chance.

Simulation plot showing 20 repeated 95% confidence intervals around a vertical fixed population mean mu line, where 19 green bars capture mu and 1 red bar misses
Diagram 2: Across 20 independent random samples, 19 green intervals trap the fixed population mean mu while 1 red interval misses (long-run 95% capture rate).

2 Worked Examples

Example 1: Student's t Confidence Interval for Exam Scores (x̄ = 78.5, s = 12.4, n = 25)

A professor grades 25 randomly selected midterm papers and finds Sample Mean 78.5 points with Sample Standard Deviation 12.4 points. Construct a 95% Student's t Confidence Interval for the true class average:

  1. Compute Standard Error (SE): Divide Sample SD by √n: SE = 12.4 ÷ √25 = 12.4 ÷ 5 = 2.48 points.
  2. Find critical t* for df = n − 1 = 24: From Student's t quantile tables at 95% two-tailed confidence, t*(24) = 2.0639.
  3. Calculate Margin of Error (MOE): MOE = 2.0639 × 2.48 = ±5.1185 points.
  4. Form final bounds: Subtract and add MOE to Sample Mean: Lower = 78.5 − 5.1185 = 73.3815 and Upper = 78.5 + 5.1185 = 83.6185, giving [73.38, 83.62]. For comparison, if population σ = 12.4 were known beforehand (Mode 2), Z* = 1.9600 shrinks MOE slightly to ±4.8607 ([73.64, 83.36]).

Example 2: Survey Proportion CI & Small-Sample Wilson Score Edge Case

Switch to Mode 3 (Proportion CI: Wald / Wilson) to compare large-poll vs. rare-event proportions:

  • Case A (Large Poll: 248 Yes out of 400 voters, 95%): Observed rate is p̂ = 248 ÷ 400 = 62.0%. Standard Error equals √(0.62 × 0.38 ÷ 400) = 2.4269%, giving Wald 95% CI = [57.24%, 66.76%] (±4.76%). Meanwhile, the Wilson Score 95% CI = [57.15%, 66.62%] agrees tightly because np = 248 ≥ 10 and n(1 − p) = 152 ≥ 10.
  • Case B (Small / Rare Defect Sample: 2 defects out of 20 units, 95%): Here p̂ = 10.0% and SE = 6.71%. Naive Wald subtracts 1.96 × 6.71% = 13.15% from 10%, producing an absurd negative lower bound of [−3.15%, +23.15%]! Using the quadratic Wilson Score Interval eliminates overshoot completely and delivers valid positive bounds of [+2.79%, +30.10%]!
Comparison showing Standard Wald and Wilson Score intervals match closely at 248/400 (57.2% to 66.7%), whereas at small sample 2/20 Wald spills negative (-3.15%) while Wilson stays strictly valid ([2.79%, 30.10%])
Diagram 3: Why statisticians recommend the Wilson Score interval whenever np < 10 or observed proportions sit close to 0% or 100%.

Confidence Interval vs. Prediction Interval vs. Hypothesis Test

Researchers can tell whether a difference is statistically significant at α = 0.05 directly from a 95% Confidence Interval: if a null-hypothesis value (such as μ₀ = 70 or difference 0) falls strictly outside the 95% CI [73.38, 83.62], then a two-tailed hypothesis test rejects that null value at p < 0.05! Conversely, never confuse a Confidence Interval for the Mean (which narrows toward zero width as n -> ∞ because SE = s / √n) with a Tolerance / Prediction Interval (which stays wide around individual future observations using √(1 + 1/n) × s).

How Sample Size, Confidence Level, and Finite Populations Affect Interval Width

Every Confidence Interval trades off precision (interval narrowness) against certainty (Confidence Level CL%). Raising Confidence Level from 90% (Z* = 1.6449) to 95% (Z* = 1.9600) widens the interval by 19.2%, and moving from 95% to 99% (Z* = 2.5758) expands width by another 31.4% for the same sample data. Because Margin of Error shrinks only with the inverse square root of sample size (1 / √n), cutting a Margin of Error in half requires collecting four times as many observations, assuming variance remains stable.

Two practical extensions frequently arise in applied studies: finite population correction (FPC) and two-sample comparisons. When sampling more than 5% of a known finite population of size N without replacement, multiplying the standard error by √((N − n) / (N − 1)) shrinks the interval appropriately because remaining unseen units become scarce. For A/B experiments comparing two independent group means (x̄₁ − x̄₂), Welch's unpooled standard error replaces single-sample SE with √(s₁² / n₁ + s₂² / n₂); when you reverse-engineer published papers that report only endpoints [L, U], Mode 4 immediately recovers the underlying point estimate and MOE for rapid meta-analysis checks.

Confidence Interval Formulas in Excel, Google Sheets & Python

Compute exact Student's t and Normal Z Margins of Error inside Excel, Google Sheets, or Python SciPy:

Excel (Student t MOE for Mean): =CONFIDENCE.T(1 - Conf, Sample_SD, n)
Excel (Normal Z MOE for Mean): =CONFIDENCE.NORM(1 - Conf, Pop_SD, n)
Python (SciPy t-Interval): scipy.stats.t.interval(0.95, df=n-1, loc=mean, scale=sd/np.sqrt(n))
Python (Statsmodels Wilson Prop): proportion_confint(x, n, alpha=0.05, method="wilson")

5 Common Confidence Interval Mistakes to Avoid

  1. Confusing Standard Deviation (s) With Standard Error (s / √n): Writing x̄ ± 1.96 × s gives an individual 95% data range rather than a Confidence Interval for the Mean! Always divide SD by √n first.
  2. Using Normal Z = 1.96 for Small-Sample Unknown-σ Means: When σ is estimated from sample s, always use Mode 1 (Student's t-interval) so df = n − 1 tail width is properly accounted for.
  3. Trusting Wald Proportion Intervals When Counts Are Small or Zero: Whenever x < 10 or n − x < 10, rely on the Wilson Score CI output in Mode 3 rather than naive Wald bounds.
  4. Assuming Overlapping 95% CIs Always Mean "Not Significantly Different": Two independent 95% CIs can overlap slightly (up to ~25% of one arm) and still yield a statistically significant difference when tested properly (p < 0.05), though non-overlapping 95% CIs always guarantee p < 0.05!
  5. Trying to Narrow a CI Without Collecting More Data: The only honest way to shrink interval width without reducing Confidence Level (say from 95% down to 80%) is collecting more observations (4× sample size cuts width in half; plan targets with our Sample Size Calculator!).

Related Inference & Normal-Distribution Calculators

Pair Confidence Intervals with sample planning and normal standardization tools in our Math & Statistics hub:

Review how Staticnexa tests numerical Student's t and incomplete Beta functions in our Editorial & Mathematical Accuracy Policy.

Frequently Asked Questions

What is the formula for a Confidence Interval of a Mean?

When population SD is unknown (the common case), use CI = Sample_Mean +/- t*(df) * (s / sqrt(n)) where df = n - 1. When population sigma is known, replace t* with Normal Z* (1.960 for 95%).

What does a 95% Confidence Interval mean?

A 95% confidence level means that if you repeated your random sampling procedure many times and built an interval from each sample, about 95% of those intervals would contain the fixed true population parameter.

Why is the Wilson Score interval better than Wald for proportions?

The standard Wald formula (p_hat +/- Z*SE) relies on a normal approximation that breaks near 0% or 100% or on small samples, sometimes producing negative or >100% limits. Wilson Score keeps bounds strictly within [0%, 100%] with accurate coverage even at small counts.

How do I make a Confidence Interval narrower?

Increase sample size n (quadrupling n cuts Margin of Error in half via 1/sqrt(n)), or accept a lower confidence level (e.g. switching from 99% to 90%).

Can you find the Sample Mean and Margin of Error from [Lower, Upper] CI bounds?

Yes! For symmetric t or Z confidence intervals, Sample Mean sits at the exact midpoint (Lower + Upper) / 2 and Margin of Error equals half the total width (Upper - Lower) / 2. Mode 4 automates this reverse calculation.

When does Student t converge to Normal Z?

As degrees of freedom (df = n - 1) increase past 30 to 100, Student t tail heaviness fades and critical values approach Standard Normal Z* (e.g. at df = 99, 95% t* = 1.984 versus Z* = 1.960).

Mathematical References & Standards