Confidence Interval Calculator
Find a confidence interval for a population mean or proportion.
How to use the Confidence Interval Calculator
- Pick what you want to work out using the tabs: Mean or Proportion.
- Enter Sample mean (x̄).
- Enter Standard deviation.
- Choose The SD is the (Sample SD uses the t-distribution; a known population SD uses z).
- Enter Sample size (n).
- Choose Confidence level.
- Read your answer in the results panel. It updates as you type, and the breakdown, step-by-step working and any charts or tables appear below it.
- Use Share link to save or send the exact calculation, or Copy to paste the results elsewhere.
What a confidence interval tells you
A sample mean or percentage is only an estimate. A confidence interval puts a range around it that reflects sampling uncertainty. A 95% interval is produced by a method that captures the true population value in 95% of repeated samples. It is not quite the same as saying there is a 95% chance this particular interval contains the truth, though in everyday use that is a reasonable reading.
Interval for a mean
x̄ ± critical value × (SD ÷ √n)
Which critical value? If the standard deviation was calculated from the same sample (the usual case), there is extra uncertainty, so the calculator uses Student’s t distribution with n − 1 degrees of freedom. If the population SD σ is genuinely known in advance, it uses z.
Example: a sample of 30 has mean 50 and SD 10. The standard error is 10 ÷ √30 ≈ 1.8257. With 29 degrees of freedom the 95% t value is 2.0452, so the margin of error is 2.0452 × 1.8257 ≈ 3.734 and the interval is 46.27 to 53.73. Using z (1.96) instead would give a slightly narrower interval, which understates the uncertainty for small samples.
Interval for a proportion
For x successes out of n, the sample proportion is p̂ = x ÷ n and the simple (Wald) interval is:
p̂ ± z × √(p̂(1 − p̂) ÷ n)
With 45 out of 100, p̂ = 0.45, the standard error is 0.0497 and the 95% interval is 35.25% to 54.75%. The calculator also gives the Wilson score interval, which behaves much better when the proportion is near 0% or 100% or the sample is small. If you have fewer than about 10 successes or failures, report the Wilson interval.
What makes an interval narrower
- A larger sample: the width shrinks with √n, so quadrupling n halves the width.
- Lower confidence: 90% intervals are narrower than 99% ones, but miss the truth more often.
- Less variable data: a smaller SD gives a tighter interval for a mean.
Assumptions
The formulas assume a random sample of independent observations. The t interval also assumes the data are roughly normal, though it holds up well for moderate samples (about 30 or more) unless the data are very skewed. No interval can fix a biased sample.
Frequently asked questions
When should I use t instead of z?
Use t whenever the standard deviation is estimated from your sample, which is almost always. Use z only when the population standard deviation is known in advance, or for proportions.
Does a 95% confidence interval mean a 95% probability?
Strictly, it means the method captures the true value in 95% of repeated samples. Any single interval either contains the true value or it does not.
Why is my interval so wide?
Usually because the sample is small or the data vary a lot. Increasing the sample size is the most reliable way to narrow it.
What is the Wilson interval?
An interval for proportions that stays accurate even with small samples or proportions near 0 or 1, where the simple Wald interval can go wrong.