Confidence interval calculator
Find a confidence interval for a population mean from summary statistics or raw data.
What a confidence interval says
A confidence interval gives a range of plausible values for a population mean based on your sample. A 95% interval means that if you repeated the sampling many times, about 95% of the intervals built this way would contain the true mean. It does not mean there is a 95% chance the mean is in this one interval.
t or z?
When you only know the standard deviation of your sample (the usual case), use the t distribution with n − 1 degrees of freedom. It has heavier tails than the normal curve, which makes the interval a little wider for small samples. If the population standard deviation σ is known, use z instead.
How the interval is built
The margin of error is the critical value times the standard error, where the standard error is the standard deviation divided by √n. The interval is the sample mean plus or minus the margin of error.
Making it narrower
A larger sample or a lower confidence level gives a narrower interval. Quadrupling the sample size cuts the margin of error roughly in half.
Worked example
A sample of n = 25 students has a mean score of 72.5 with a standard deviation of s = 8.2. The standard error is s ÷ √n = 8.2 ÷ 5 = 1.64. For 95% confidence with 24 degrees of freedom, t* = 2.064, so the margin of error is 2.064 × 1.64 = 3.39.
The 95% confidence interval is 72.5 ± 3.39, or (69.1, 75.9).
Frequently asked questions
What does “95% confident” mean?
If you repeated the sampling many times and built an interval each time, about 95% of those intervals would contain the true population mean. It doesn’t mean there is a 95% chance this particular interval contains it.
When do I use t instead of z?
Use t when you estimate the standard deviation from the sample, which is almost always. Use z only when the population standard deviation is known. For large samples, t and z are nearly the same.
How can I make the interval narrower?
Collect a larger sample (the width shrinks with √n) or accept a lower confidence level. Quadrupling n cuts the margin of error in half.
What are degrees of freedom?
For a one-sample mean, df = n − 1. Smaller df gives a larger t*, which widens the interval to account for the extra uncertainty in small samples.