Build confidence intervals for a mean or proportion at any confidence level.
A confidence interval gives a range of plausible values for an unknown population parameter. A 95 % interval means: if you repeated the study many times, 95 % of the constructed intervals would contain the true parameter. It does NOT mean the parameter has a 95 % chance of being in this specific interval. When σ is known you use a z critical value; when σ is estimated from the sample you use a t critical value (with n−1 degrees of freedom), which produces a wider interval that accounts for the added uncertainty.
Mean (σ known)
x̄ ± z* × σ/√n
Mean (σ unknown)
x̄ ± t* × s/√n, with df = n−1
Proportion
p̂ ± z* × √(p̂(1−p̂)/n)
It means the procedure used to construct the interval would capture the true parameter 95 % of the time across repeated samples. For this particular interval, the parameter is either inside it or it isn't — there is no probability attached to that fact.
Always use t when the population standard deviation σ is unknown and you are estimating it from the sample. The t-distribution has heavier tails than the normal, producing a wider interval that honestly reflects the extra uncertainty. As n grows the t-distribution converges to normal, so the choice matters most for small samples (n < 30).
A higher confidence level requires a larger critical value (z* or t*), which directly multiplies the margin of error. You are asking for more certainty, so you pay with precision.
The z-interval for a proportion relies on the normal approximation to the binomial. This approximation requires np̂ ≥ 5 and n(1−p̂) ≥ 5. When either condition fails — especially for extreme proportions or very small n — the interval is unreliable. Consider an exact Clopper-Pearson interval instead.