Confidence interval calculator
A 95% interval is a method that catches the truth 95% of the time. Run 100 samples and count how many intervals miss.
- Estimate: x̄ = 72.4
- Standard error = s/√n = 8.5 / √36 = 1.4167
- Critical value t* (df = 35) = 2.0301
- Margin = 2.0301 × 1.4167 = 2.876, so the interval is 72.4 ± 2.876
What does "95% confident" mean? Run 100 samples
The true population mean is 50 (SD 10). Each line is a 95% t interval from a new random sample of size 15. Orange lines missed the truth.
Confidence is about the method
A 95% confidence interval comes from a recipe that, used over and over on new samples, captures the true value 95% of the time. Once you have computed one particular interval, the truth is either in it or not; the 95% describes how reliable the recipe is. The simulation above makes this concrete: every press draws 100 fresh samples and a handful of intervals miss.
Mean: x̄ ± t* · s/√n Proportion: p̂ ± z* · √(p̂(1 − p̂)/n)
What makes an interval wider or narrower
- Higher confidence means a bigger critical value and a wider interval. 99% intervals are about 30% wider than 95% ones.
- More data shrinks the standard error by √n. Slide the simulation's sample size from 5 to 80 and watch the lines shorten.
- More variable data (larger s) widens the interval.
Worked example: a poll
540 of 1,000 voters back a proposal: p̂ = 0.54, SE = √(0.54 × 0.46 / 1000) = 0.0158, margin = 1.96 × 0.0158 = 0.031. The 95% interval is 0.509 to 0.571, which pollsters report as "54%, ±3 points". Plan a study's size with the sample size calculator.
Still not clicking? Ask the tutor
An AI tutor that sees the numbers you entered above and explains them. It can make mistakes, so check anything important against the worked steps.
Questions students ask
How do you calculate a confidence interval for a mean?
x̄ ± t* × s/√n, where t* is the critical value for your confidence level with n − 1 degrees of freedom. If the population σ is known, use z* × σ/√n.
How do you calculate a confidence interval for a proportion?
p̂ ± z* × √(p̂(1 − p̂)/n). This Wald interval works well when both np̂ and n(1 − p̂) are at least 10; this page also shows the Wilson interval, which behaves better for small samples.
What does 95% confidence mean?
If you repeated the sampling many times, about 95% of the intervals built this way would contain the true value. For a single interval, the true value is either inside or not.
How can I make the interval narrower?
Increase the sample size (the width shrinks with √n, so four times the data halves the width) or accept a lower confidence level.