About the Confidence Interval Calculator
This confidence interval calculator gives the range that is likely to contain the true population value, based on a sample. Choose a mean — for averages such as test scores, weights or delivery times — or a proportion, for survey results, conversion rates and polling percentages, then pick a confidence level such as 95%.
For a mean with a sample standard deviation it uses the Student t distribution with n − 1 degrees of freedom, which is the correct choice for real-world samples. If the population standard deviation is genuinely known, switch to the z method. For a proportion it uses the normal (Wald) approximation, with bounds shown as percentages.
Students, analysts, researchers and marketers can use it to report results properly (“52% ± 3.1%”) and to see how the interval narrows with larger samples. The table compares several confidence levels at once. The method assumes a random sample and, for small samples, roughly normal data; the proportion method works best when there are at least 10 successes and 10 failures.
How to use the confidence interval calculator
- 1Choose whether you are estimating a mean or a proportion.
- 2Pick the confidence level — 95% is the usual default.
- 3For a mean, enter the sample mean, standard deviation and sample size.
- 4For a proportion, enter the sample size and number of successes.
- 5Report the interval and margin of error, and check the table for other levels.
Formula and method
A confidence interval is the point estimate plus or minus a margin of error. The margin is a critical value times the standard error. For a mean, the standard error is s ÷ √n and the critical value comes from the t distribution with n − 1 degrees of freedom (or the normal z distribution when σ is known).
For a proportion, p̂ = x ÷ n and the standard error is √(p̂(1 − p̂) ÷ n), with a z critical value (1.96 for 95%). The interval is clipped to 0–100%. A 95% level means that if you repeated the sampling many times, about 95% of the intervals built this way would contain the true value.
- x̄
- Sample mean
- s
- Sample standard deviation (or σ if known)
- n
- Sample size
- p̂
- Sample proportion = successes ÷ n
- t*, z*
- Critical value for the chosen confidence level
Worked examples
95% interval for a mean (t method)
With x̄ = 50, s = 8 and n = 36, the standard error is 8 ÷ 6 = 1.333. The t critical value with 35 degrees of freedom is 2.030, so the margin is 2.707 and the interval runs from 47.29 to 52.71.
Known σ (z method)
If σ = 8 is known, the critical value is z* = 1.960 and the margin is 1.96 × 1.333 = 2.613, giving a slightly narrower interval of 47.39 to 52.61.
Poll: 520 of 1,000 say yes
p̂ = 52%. The standard error is √(0.52 × 0.48 ÷ 1000) = 1.58 percentage points, and 1.96 × 1.58 = 3.10, so the 95% interval is 48.9% to 55.1%.
99% interval for 45 of 150
p̂ = 30%. At 99% confidence z* = 2.576, and the margin is 2.576 × √(0.3 × 0.7 ÷ 150) = 9.64 points, so the interval is about 20.4% to 39.6%.
Frequently asked questions
What does a 95% confidence interval mean?+
It means the method captures the true population value 95% of the time over repeated samples. It does not mean there is a 95% probability the true value is in this particular interval — the true value is fixed; the interval varies.
Should I use t or z for a confidence interval?+
Use t whenever you estimate the standard deviation from your sample, which is almost always. Use z only when the population standard deviation is truly known. For large samples (n above about 100) the two give nearly the same result.
What is the z value for a 95% confidence interval?+
The critical value is 1.960 for 95%. Other common values are 1.645 for 90%, 2.326 for 98% and 2.576 for 99% confidence.
How do I make a confidence interval narrower?+
Increase the sample size or accept a lower confidence level. Because the standard error shrinks with √n, you need about four times as many observations to halve the margin of error.
How is the margin of error related to the confidence interval?+
The margin of error is half the width of the interval. A poll reported as 52% ± 3.1% has a confidence interval of 48.9% to 55.1%.