Confidence Interval Calculator
Computes the range of values likely to contain a true population mean at your chosen confidence level. Use it when reporting survey results, clinical trial outcomes, or any estimate derived from a sample.
About this calculator
A confidence interval (CI) estimates the range within which a population parameter falls, given sample data and a chosen confidence level (e.g., 95%). The formula is CI = x̄ ± z* × (s / √n), where x̄ is the sample mean, s is the sample standard deviation, n is the sample size, and z* is the critical value from the standard normal (z) or Student's t distribution. For large samples (n ≥ 30) the z critical values are 1.645 (90%), 1.96 (95%), and 2.576 (99%). For small samples the t-distribution is used instead, with degrees of freedom n − 1 yielding slightly wider intervals. The margin of error is z* × (s / √n); the interval is [x̄ − margin, x̄ + margin]. A 95% CI means that if the study were repeated many times, 95% of the constructed intervals would contain the true mean.
How to use
Say a sample of n = 36 students has a mean test score of x̄ = 74 and standard deviation s = 12, and you want a 95% CI using the z-distribution. Step 1 — identify z* = 1.96 for 95%. Step 2 — compute the standard error: SE = 12 / √36 = 12 / 6 = 2.0. Step 3 — margin of error = 1.96 × 2.0 = 3.92. Step 4 — CI = [74 − 3.92, 74 + 3.92] = [70.08, 77.92]. You can be 95% confident the true mean score lies between 70.08 and 77.92.
Frequently asked questions
What does a 95% confidence interval actually mean?
A 95% confidence interval means that if you drew many independent samples and computed a CI from each, approximately 95% of those intervals would contain the true population parameter. It does not mean there is a 95% probability the true value lies in this specific interval — the true value is fixed; the interval is what varies. This distinction matters in rigorous statistical reporting and peer review.
When should I use a t-distribution instead of a z-distribution for a confidence interval?
Use the t-distribution when the population standard deviation is unknown and the sample size is small (typically n < 30). The t-distribution has heavier tails than the normal, producing wider intervals to account for extra uncertainty from estimating the standard deviation. As n increases the t-distribution converges to the standard normal, so for n ≥ 30 the practical difference is negligible. Always use t when you have a small sample, regardless of whether you believe the population is normally distributed.
How does increasing sample size affect the width of a confidence interval?
Increasing sample size narrows the confidence interval because the standard error SE = s / √n decreases as n grows. Doubling the sample size reduces the margin of error by a factor of √2 (about 29%). This is why large studies produce more precise estimates. If you need a specific margin of error, you can rearrange the formula to solve for the required n before collecting data.