Quick Answer
A confidence interval is estimate ± critical value × standard error. With a sample mean of 72, a standard deviation of 10 and 25 people, the 95% t interval is 67.87 to 76.13, or 72 ± 4.13. The critical value t* for 24 degrees of freedom is 2.064.
Embed this calculator
Adjust the size if needed, then copy the code below into your page or blog. The calculator will load in an iframe and stay updated automatically.
Table of Contents
- Confidence Interval Calculator
- Quick Answer
- Related Calculators
- How This Confidence Interval Calculator Works
- How to Use the Confidence Interval Calculator
- Core Formulas
- Key Terms
- Worked Example
- Real-Life Examples
- Confidence Interval vs Margin of Error
- Critical Values by Confidence Level
- What Changes the Width
- Common Mistakes to Avoid
- Frequently Asked Questions
- References & Sources
How This Confidence Interval Calculator Works
Choose whether you want an interval for a mean or for a proportion. For a mean, enter the sample mean, standard deviation and sample size. For a proportion, enter the number of successes and the sample size. Pick a confidence level, and the calculator finds the critical value, the margin of error and the interval.
Quick explanation: the interval gives a range of likely values for the true population value.
- t interval: the usual choice when you only know the sample standard deviation.
- z interval: when the population standard deviation σ is known.
- Proportion: for percentages, such as survey results.
How to Use the Confidence Interval Calculator
- Choose an interval for a mean (t or z) or for a proportion.
- Enter the sample mean and standard deviation, or the number of successes.
- Enter the sample size.
- Choose the confidence level, such as 95%.
- Press Calculate and read the interval, the margin of error and the steps.
Core Formulas
- Mean, σ unknown: x̄ ± t* × s ÷ √n, with n − 1 degrees of freedom
- Mean, σ known: x̄ ± z* × σ ÷ √n
- Proportion: p̂ ± z* × √(p̂(1 − p̂) ÷ n)
- Margin of error: critical value × standard error
Key Terms
- Confidence level: how often the method captures the true value over many samples, such as 95%.
- Margin of error: half the width of the interval.
- Standard error: the standard deviation of an estimate, such as s ÷ √n for a mean.
- Critical value: the z* or t* number that sets how many standard errors to go out.
- Degrees of freedom: n − 1 for a one-sample mean. It sets the shape of the t curve.
Worked Example
A poll of 500 voters finds 310 support a plan, so p̂ = 0.62. Find the 95% interval.
- Standard error = √(0.62 × 0.38 ÷ 500) = 0.02171
- Margin of error = 1.960 × 0.02171 = 0.0425, or 4.25 percentage points
- Interval = 57.75% to 66.25%
Real-Life Examples
- Product weights: 40 bags have a mean of 500.4 g and s = 2.1 g. The 95% interval is 499.73 g to 501.07 g.
- A customer survey: 180 of 400 customers say they would buy again. The 95% interval is 40.1% to 49.9%.
- Test scores: a class of 25 has a mean of 72 and s = 10. The 99% interval is 66.41 to 77.59, wider than at 95%.
- Known spread: a machine with σ = 0.5 mm makes 36 parts with a mean of 20.1 mm. The 95% z interval is 19.937 to 20.263 mm.
Confidence Interval vs Margin of Error
- Margin of error: the amount added and subtracted, such as ±3 points.
- Confidence interval: the full range, from estimate − margin to estimate + margin.
- Polls: “52% ± 3%” means a confidence interval of 49% to 55%.
- Planning: to choose a sample size for a target margin, use our Sample Size Calculator.
Critical Values by Confidence Level
As the degrees of freedom grow, t* gets closer to z*.
| Confidence | z* | t*, df = 10 | t*, df = 30 |
|---|---|---|---|
| 80% | 1.282 | 1.372 | 1.310 |
| 90% | 1.645 | 1.812 | 1.697 |
| 95% | 1.960 | 2.228 | 2.042 |
| 98% | 2.326 | 2.764 | 2.457 |
| 99% | 2.576 | 3.169 | 2.750 |
| 99.9% | 3.291 | 4.587 | 3.646 |
What Changes the Width
- Sample size: four times the sample halves the margin of error.
- Confidence level: 99% gives a wider interval than 95%.
- Spread: a larger standard deviation gives a wider interval.
- Proportion near 50%: gives the widest interval for a given sample size.
Common Mistakes to Avoid
- Saying there is a 95% chance the true value is in this interval. The 95% describes the method: about 95% of such intervals contain the true value.
- Using z when σ is unknown. Use the t interval with the sample standard deviation.
- Entering a percentage as the standard deviation. For proportions, enter the counts instead.
- Using a biased sample. No formula fixes a sample that does not represent the population.
- Ignoring small counts. The proportion interval is unreliable with fewer than 10 successes or failures.
Frequently Asked Questions
Take the estimate and add and subtract 1.96 standard errors for a z interval, or t* standard errors for a t interval. This calculator does it for you.
If you repeated the study many times, about 95% of the intervals made this way would contain the true value.
Use t when you estimate the standard deviation from your sample, which is almost always. Use z only when σ is truly known.
About 1.960. For 90% it is about 1.645, and for 99% about 2.576.
To be more confident of capturing the true value, the range has to be wider.
Larger samples give narrower intervals, because the standard error falls as √n grows.
Yes, for a mean. For a proportion, a result below 0% or above 100% is a sign the sample is too small for this method.
Standard deviation is the spread of the data. Standard error is the spread of the estimate, which is smaller.
Use p̂ ± z* × √(p̂(1 − p̂) ÷ n). Choose Proportion above and enter the successes and sample size.
For a difference or an effect, an interval that includes zero means the result is not significant at that confidence level.
No. A prediction interval is for one future value and is much wider.
A 95% interval that does not include the null value matches a two-tailed p-value below 0.05.
References & Sources
| Source | Used For | Link |
|---|---|---|
| NIST/SEMATECH e-Handbook, Confidence limits for the mean | The t interval for a mean. | https://www.itl.nist.gov/div898/handbook/eda/section3/eda352.htm |
| Wikipedia, Confidence interval | Meaning and common mistakes. | https://en.wikipedia.org/wiki/Confidence_interval |
| Wikipedia, Binomial proportion confidence interval | Intervals for proportions. | https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval |