Confidence Interval Calculator
Calculate a confidence interval for a sample mean or proportion, with margin of error and the z or t critical value shown.
How to Use This Calculator
- Pick what you’re estimating — a sample mean (like an average test score or measurement) or a sample proportion (like a survey percentage)
- Enter your sample statistics — mean/standard deviation and sample size, or proportion and sample size
- Choose a confidence level — 90%, 95%, and 99% are the most common
- Click Calculate to see the margin of error, the confidence interval, and the critical value used
What Are You Estimating?
Sample Statistics
Confidence Level
📐 What Is a Confidence Interval?
- A confidence interval is a range of values that likely contains the true population mean or proportion, built around your sample statistic.
- A "95% confidence interval" means that if you repeated the sampling process many times, about 95% of the intervals calculated that way would contain the true population value — it does not mean there's a 95% chance this specific interval contains it.
- A wider interval means more uncertainty; a narrower interval (from a bigger sample or lower confidence level) means a more precise estimate.
🧮 Formula Reference
x̄ ± t × (s ÷ √n)
p̂ ± z × √(p̂(1 − p̂) ÷ n)
The mean interval uses the t critical value (based on n − 1 degrees of freedom) since the population standard deviation is unknown and estimated from the sample. The proportion interval uses the z critical value from the standard normal distribution.
📊 Common Critical Values (z, large samples)
- 80% confidence → z = 1.282
- 90% confidence → z = 1.645
- 95% confidence → z = 1.960
- 98% confidence → z = 2.326
- 99% confidence → z = 2.576
For small samples (mean mode), this calculator uses the exact t critical value for your degrees of freedom instead of the z-value above, since the t-distribution is wider to account for the extra uncertainty of estimating the standard deviation from a small sample.
Frequently Asked Questions
What does a 95% confidence interval actually mean?
It means that if you repeated your sampling process many times and built a confidence interval each time, about 95% of those intervals would contain the true population mean or proportion. It does NOT mean there's a 95% chance the true value falls in this one specific interval — that's a common misconception.
Should I use a z-score or a t-score for my confidence interval?
Use the t-distribution when you only know your sample standard deviation (the usual case for a mean) — it's wider to account for the extra uncertainty of estimating from a sample. Use the z-distribution when you know the true population standard deviation, or for proportions, where the standard error formula doesn't depend on an estimated standard deviation the same way.
How does confidence level affect the width of the interval?
Higher confidence levels produce wider intervals. Moving from 95% to 99% confidence increases the critical value (e.g. z goes from 1.960 to 2.576), which widens the margin of error by about 31% for the same data — you trade precision for certainty.
How do I make my confidence interval narrower?
Increase your sample size (the margin of error shrinks with the square root of n), reduce variability in your data collection, or accept a lower confidence level (e.g. 90% instead of 99%). Of these, increasing sample size is usually the most reliable lever.
What sample size do I need for a reliable proportion confidence interval?
As a rule of thumb, both n × p̂ and n × (1 − p̂) should be at least 5 (some sources say 10) for the normal approximation used here to be reliable. For very small samples or proportions near 0% or 100%, the interval can be misleading.
What's the difference between confidence interval and margin of error?
The margin of error is the ± amount added to and subtracted from your sample statistic. The confidence interval is the resulting range itself — sample statistic minus the margin of error to sample statistic plus the margin of error.