What Is a Confidence Interval?
A confidence interval gives a range of plausible values for an unknown population parameter, together with a statement about how reliable the procedure that produced the range is. It replaces the single point estimate from a sample — a mean, a proportion, a difference — with an interval that reflects sampling uncertainty. Two studies can produce the same point estimate but very different intervals, and the interval carries more information than the point alone.
The General Structure
Most confidence intervals share the same shape:
estimate ± critical value × standard error
The estimate is the point estimate (a mean, a proportion, a difference). The standard error measures how much the estimate would vary from sample to sample. The critical value comes from the sampling distribution of the estimate — a t, z, chi-square, or F quantile, depending on the parameter. The product of the critical value and the standard error is the margin of error; subtracting and adding it to the estimate gives the lower and upper confidence limits.
The exact formula differs from one parameter to another, which is why the calculator asks for the interval type before anything else.
Confidence Level
The confidence level is the long-run coverage rate of the interval-producing procedure under its assumptions. Common choices are 90%, 95%, and 99%. The significance level is the complement: α = 1 − confidence level. For a two-sided interval, α/2 sits in each tail, which is why the two-sided critical value is the (1 − α/2) quantile of the relevant distribution.
Holding the data and the method fixed, higher confidence requires a larger critical value and therefore produces a wider interval. A 99% interval is wider than a 95% interval, which is wider than a 90% interval. The calculator's comparison table shows the same data at all three levels side by side.
The confidence level is not the probability that a fixed population parameter lies inside a particular calculated interval. The parameter is fixed; the interval is random. Correct interpretation is about repeated sampling: if the same procedure were applied to many samples, about C% of the resulting intervals would contain the true parameter.
One Mean: t or z
When the population standard deviation σ is unknown, the one-mean interval uses the t distribution:
x̄ ± t* × s / √n , df = n − 1
This is the default and by far the most common case. When σ is genuinely known — a rare situation, usually from prior data on the same measurement — the z distribution replaces t and the interval is x̄ ± z* × σ/√n. For large samples the two are numerically close, but the calculator still asks explicitly which case applies rather than assuming. The calculator accepts either summary statistics (mean, SD, n) or raw observations; in raw mode it computes mean and SD first.
One Proportion
Two methods are available. The Wilson score interval is the default and the more robust choice: it stays inside [0, 1], performs well for small n, and behaves reasonably when the estimated proportion is near 0 or 1. Its midpoint is a weighted blend of the sample proportion and 0.5, and its half-width uses a variance that does not collapse when p̂ is extreme.
The Wald interval is the classic p̂ ± z* × √[p̂(1−p̂)/n]. It is simple but unreliable for small samples or extreme proportions — the formula can produce limits below 0 or above 1, and its coverage is often poor. The calculator offers Wald as an alternative but defaults to Wilson.
Two Independent Means
Two methods are available for the difference μ₁ − μ₂. The Welch interval is the default and does not assume equal population variances:
(x̄₁ − x̄₂) ± t* × √(s₁²/n₁ + s₂²/n₂)
The degrees of freedom come from the Welch–Satterthwaite approximation, so they can be fractional. The pooled interval assumes equal variances and uses a single pooled standard deviation with df = n₁ + n₂ − 2. The pooled option should only be used when the equal-variance assumption is genuinely justified — the calculator labels it clearly because the two methods can give noticeably different answers when the group variances differ.
Paired Difference
A paired interval operates on within-pair differences. Compute dᵢ = afterᵢ − beforeᵢ for each pair, then form a one-sample t interval on those differences:
d̄ ± t* × s_d / √n , df = n − 1
Pairing must be preserved: pairs are matched by position, and both columns must have the same length. Running a two-sample interval on paired data ignores the within-pair correlation and produces an incorrect standard error.
Two Proportions
For the difference p₁ − p₂, the calculator uses the Agresti–Caffo interval. Each sample is adjusted by adding one success and one failure, giving an effective sample of n + 2 with p̃ = (x + 1) / (n + 2). The interval is
(p̃₁ − p̃₂) ± z* × √[p̃₁(1−p̃₁)/(n₁+2) + p̃₂(1−p̃₂)/(n₂+2)]
This is a small-sample-robust alternative to the Wald difference-in-proportions interval. It estimates the risk difference. It is not a confidence interval for the risk ratio or the odds ratio — those are different parameters and require log-scale methods the calculator does not implement.
Variance and Standard Deviation
For a single population variance σ², the interval comes from the chi-square distribution:
((n − 1)s² / χ²_high , (n − 1)s² / χ²_low)
where χ²_low and χ²_high are the α/2 and 1−α/2 quantiles of the chi-square distribution with n − 1 degrees of freedom. The interval for the population SD is the square root of the endpoints. This classical interval assumes the population is approximately normal. When that assumption fails, the actual coverage can be quite different from the nominal level, so it should be interpreted with care.
Variance Ratio
For the ratio σ₁² / σ₂², the interval comes from the F distribution:
(s₁²/s₂²) / F_high to (s₁²/s₂²) / F_low
with numerator df = n₁ − 1 and denominator df = n₂ − 1. An interval that excludes 1 is consistent with unequal variances. This interval also assumes approximate normality in each group.
Margin of Error and Confidence Limits
Margin of error is the half-width of a symmetric interval: ME = critical value × standard error. The lower confidence limit is the estimate minus the ME and the upper confidence limit is the estimate plus the ME. For chi-square and F intervals the interval is not symmetric around the estimate, so the ME concept does not apply — the calculator reports the endpoints directly for those modes.
Interpreting a Confidence Interval
A 95% interval of, say, 65 to 85 for a mean says that any population mean in that range is compatible with the sample at the 95% coverage level. Narrower intervals indicate more precise estimates — usually the result of larger samples or smaller variability. Wider intervals reflect more uncertainty. For a difference or a paired interval, an interval that contains 0 is consistent with no difference at the chosen confidence level; an interval entirely above or below 0 indicates that direction. Containing 0 is not proof that the effect is absent — it can simply reflect low precision.
Common Mistakes
- Interpreting the confidence level as the probability that the fixed parameter lies inside the calculated interval. It is a long-run coverage rate of the procedure, not a probability about this interval.
- Using z when σ is unknown. When σ is estimated from the sample, use the t interval.
- Reporting a 95% interval when a 90% or 99% level was prespecified.
- Using the pooled two-means interval when variances clearly differ. Welch is the safer default.
- Treating a two-proportions interval for the risk difference as an interval for the risk ratio or odds ratio. They are different parameters.
- Computing a chi-square variance interval without checking the normality assumption.
- Assuming a wider interval is an error. Higher confidence levels legitimately produce wider intervals.