Confidence Interval Calculator
Type your sample’s mean, standard deviation and size, or a count out of a total…
Type your sample’s mean, standard deviation and size, or a count out of a total, to get the confidence interval and see it on the curve.
More optionsSample SD (t)
Example95% confidence interval
68.3722 to 76.6278
72.5 ± 4.1278, using t with 24 degrees of freedom (2.0639).
Type your own numbers, or drag the chart.
Drag the edge of the interval to change the confidence level.
- Margin of error
- ±4.1278
- Standard error
- 2
- t multiplier (24 df)
- 2.0639
How this works: 9 sources,
How this works
Method
A confidence interval is a range of plausible values for something you have estimated from a sample: the estimate plus or minus a margin. For a mean the margin is a multiplier times the standard error: x̄ ± t* × s/√n. A sample of 25 with a mean of 72.5 and an SD of 10 has a standard error of 2; with t* = 2.064 for 95% and 24 degrees of freedom, the interval is 72.5 ± 4.13, or 68.37 to 76.63. Full method
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.2 Confidence Limits for the Mean
- Wikipedia, Binomial proportion confidence interval
- NIST/SEMATECH e-Handbook of Statistical Methods
- Abramowitz and Stegun, Handbook of Mathematical Functions, chapters 6, 7 and 26 (1964)
- SciPy 1.18 scipy.stats (reference values for the tests)
- statsmodels 0.15 (reference values for the A/B test and regression intervals)
- Welch, The generalization of Student’s problem when several different population variances are involved (Biometrika) (1947)
- Fleiss, Levin and Paik, Statistical Methods for Rates and Proportions, 3rd edition (sample size for two proportions) (2003)
- Hyndman and Fan, Sample quantiles in statistical packages (The American Statistician) (1996)
How it’s tested
2 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.
Privacy
On your device. Nothing you enter or open leaves this browser. About privacy labels
Changes
- First published: live curves with draggable cut-offs, and tests on pasted data (t-tests, ANOVA, chi-square, Fisher’s exact, correlation, regression, A/B), checked against SciPy.
How to calculate a confidence interval
A confidence interval is a range of plausible values for something you have estimated from a sample: the estimate plus or minus a margin. For a mean the margin is a multiplier times the standard error: x̄ ± t* × s/√n. A sample of 25 with a mean of 72.5 and an SD of 10 has a standard error of 2; with t* = 2.064 for 95% and 24 degrees of freedom, the interval is 72.5 ± 4.13, or 68.37 to 76.63.
Use t when the standard deviation comes from your sample, which is almost always; use z when the population SD is truly known. For a proportion, the usual interval is p̂ ± z × √(p̂(1 − p̂)/n): 56 of 100 gives 0.56 ± 0.097. The Wilson interval, shown alongside, behaves better for small samples or rates near 0% or 100%.
“95% confident” describes the method, not this one interval: if you repeated the study many times, about 95% of the intervals made this way would contain the true value. A wider interval comes with higher confidence or more spread, and a narrower one with a larger sample.
mean: x̄ ± t* · s/√n · proportion: p̂ ± z* · √(p̂(1 − p̂)/n)
- Confidence limits for a mean are Ȳ ± t(1 − α/2, N − 1) · s/√N when the standard deviation is estimated from the sample. Source: NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.2 Confidence Limits for the Mean.
- The Wilson score interval (1927) keeps close to its stated coverage for small samples and extreme proportions, where the simple Wald interval does not. Source: Wikipedia, Binomial proportion confidence interval.
Multipliers for common confidence levels
The z* multiplier and the t* multiplier for 10 and 30 degrees of freedom at each confidence level.
| Confidence | z* | t* (10 df) | t* (30 df) |
|---|---|---|---|
| 80% | 1.282 | 1.372 | 1.31 |
| 85% | 1.44 | 1.559 | 1.477 |
| 90% | 1.645 | 1.812 | 1.697 |
| 95% | 1.96 | 2.228 | 2.042 |
| 98% | 2.326 | 2.764 | 2.457 |
| 99% | 2.576 | 3.169 | 2.75 |
| 99.5% | 2.807 | 3.581 | 3.03 |
| 99.9% | 3.291 | 4.587 | 3.646 |
Common questions
Does a 95% interval have a 95% chance of containing the true mean?
Strictly, no: the true mean is fixed and the interval either contains it or doesn’t. The 95% is the long-run success rate of the method. In practice people read it as a range of plausible values, which is fair.
Why is my interval so wide?
A small sample, a large standard deviation or a high confidence level. The width shrinks with √n, so quartering it takes 16 times the data.
Should I use the sample SD or the population SD?
The sample SD (and t) unless the population SD is known from outside your data, which is rare. The standard deviation calculator gives the sample SD of a list.