Confidence Interval Calculator
This confidence interval calculator works for a mean or a proportion. With a sample mean of 50, a standard deviation of 10 and n = 30, the 95% confidence interval runs from 46.27 to 53.73.
Example: What do you want to estimate: Mean · Sample mean 50 · Standard deviation 10 · Sample size n 30 · The standard deviation is: estimated from the sample (t distribution) · Confidence level: 95 % → Confidence interval: 95% confidence interval for the mean: 46.266 to 53.734. Source: NIST/SEMATECH e-Handbook of Statistical Methods – 1.3.5.2 Confidence Limits for the Mean. Updated: .
How it is calculated
How to calculate a confidence interval
A confidence interval gives a range in which the true population value lies with the chosen level of confidence. For a mean it is mean ± critical value × s ÷ √n. With 30 values, a mean of 50 and s = 10, the standard error is 1.83, the t value (29 degrees of freedom, 95%) is 2.045, so the margin of error is 3.73.
t or z?
If you do not know the population standard deviation, you estimate it from the sample and use the t distribution. Its critical value is larger for small n, so the interval is wider. Only for large samples does t approach the z value of 1.96.
Proportions: Wilson instead of the rule of thumb
For a proportion, say 45 of 100 respondents, the calculator uses the Wilson score interval. It stays valid for few successes or proportions near 0 and 100%, and its coverage is better than the simple Wald interval.
What the level means
95% means: if you repeated the sampling many times, about 95% of the intervals calculated this way would contain the true value. It does not mean the true value lies in this particular interval with 95% probability. To halve the width you need four times as much data.
Limits
The interval reflects random error only, not bias from a poor sample or badly worded questions. It assumes independent observations.
Frequently asked questions
How do you calculate a confidence interval for a mean?
Take the mean plus and minus the t critical value times the standard error. The standard error is s divided by the square root of n.
What does a 95% confidence interval mean?
If the survey were repeated many times, about 95% of the intervals would contain the true value. It is not a statement about this one interval.
When should I use t and when z?
Use t when the standard deviation was estimated from the sample. z fits only when the population standard deviation is known.
How large must the sample be for a narrower interval?
The width shrinks with the square root of n. For an interval half as wide you need four times as many observations.
How do I get a confidence interval for a proportion?
Choose “Proportion”, enter the successes and the sample size. The calculator uses the Wilson formula and shows the Wald interval for comparison.
Sources and legal basis
- NIST/SEMATECH e-Handbook of Statistical Methods – 1.3.5.2 Confidence Limits for the Mean
- Wikipedia – Binomial proportion confidence interval (Wilson score interval)
- Wilson, E. B. (1927): Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association 22
As of: · Editorial policy
Related tools
- Average CalculatorAverage calculator: mean, median, mode and weighted average of your numbers with working and frequency table – plus the value needed for a target average.
- Standard deviation calculatorStandard deviation calculator for a list or frequency table: switch between sample (s) and population (σ), see every step in a table, plus a box plot.
- Sample size calculatorSample size calculator for surveys: required number of respondents from confidence level, margin of error and proportion – with finite population correction.
- A/B test calculatorA/B test calculator: compare conversion rates of two variants and get the uplift, p-value, confidence interval and the sample size your test really needs.
- P-Value CalculatorP-value calculator from a z-score, t-score or chi-square, or straight from a t-test with means, SDs and n – plus critical value and confidence interval.
- Probability calculatorProbability calculator: favourable over possible outcomes, two events, repeated trials (binomial) and drawing without replacement, like a lottery.
- Online CalculatorCalculator online, free and instant: type or tap and see the answer as you go – order of operations, brackets, percent, square root, steps and a history list.
- Pi digitsPi digits up to 10,000 decimal places: show any number of digits, look up the digit at a position or search a sequence such as your birthday in π.
- Block and tackle calculator: pulling force and rope lengthBlock and tackle calculator: load, number of supporting rope segments and efficiency give the pulling force in N and kg and the length of rope you have to pull.