How to use it
- Choose Estimate: a mean with σ known (z) or with the sample SD (t), or a proportion by the Wald or Wilson method.
- Type the Confidence level, for example 95%.
- For a mean, type the Sample mean x̄, the Sample size n and either the Population standard deviation σ or the Sample standard deviation s. For a proportion, type the Successes x and the Trials n.
- Read Confidence interval, then How it is worked out. The table compares other levels, or both proportion methods.
Intervals for a mean
A confidence interval for a mean is the sample mean plus or minus a critical value times the standard error. When the population standard deviation σ is known, the standard error is σ ÷ √n and the critical value is z, the point of the standard normal distribution with (1 + C) ÷ 2 below it. When only the sample standard deviation s is known, the standard error is s ÷ √n and the critical value is t with n − 1 degrees of freedom. The t distribution has heavier tails, so its interval is a little wider, which matters most for small samples.
Use the t interval whenever σ is not known. From about 30 observations on, the t and z values are close, so the two intervals almost agree.
z interval: x̄ ± z × σ ÷ √n
t interval: x̄ ± t × s ÷ √n, with n − 1 degrees of freedom
z = Φ⁻¹((1 + C) ÷ 2)
Intervals for a proportion
The Wald interval is p̂ ± z √(p̂ (1 − p̂) ÷ n), where p̂ = x ÷ n. It is simple but works poorly for small samples and for proportions near 0% or 100%: its limits can fall below 0% or above 100%, and when all or none of the trials succeed it has zero width.
The Wilson score interval, published by Edwin B. Wilson in 1927, centres the estimate on a weighted value and always stays between 0% and 100%. Brown, Cai and DasGupta (2001) compared the two and recommend the Wilson interval over the Wald interval for most sample sizes.
Wald: p̂ ± z √(p̂ (1 − p̂) ÷ n)
Wilson: [p̂ + z² ÷ (2n) ± z √(p̂ (1 − p̂) ÷ n + z² ÷ (4n²))] ÷ (1 + z² ÷ n)
What the calculator does not cover
- Samples that were not drawn at random, and complex surveys with weights, clusters or a design effect.
- A finite population correction for a sample that is a large share of its population.
- Comparisons of two means or two proportions, which need a different interval. To plan the number of observations, use the sample size calculator.
Worked examples: a mean and a proportion at 95%
A sample of 25 with mean 50 and standard deviation 10 gives t = 2.063899 and SE = 10 ÷ √25 = 2.0000, so the margin is 4.1278 and the interval is 45.8722 to 54.1278.
For 56 successes in 100 trials, the Wald interval is 46.27% to 65.73% and the Wilson interval is 46.23% to 65.33%.
| Method | Lower limit | Upper limit |
|---|---|---|
| Wald | 46.27% | 65.73% |
| Wilson | 46.23% | 65.33% |
Frequently asked questions
What does a 95% confidence interval mean?
It is a range built by a method that contains the true value in about 95 of every 100 samples drawn the same way. It does not mean that one particular interval has a 95% chance of containing the true value.
When should I use the z interval and when the t interval?
Use z only when the population standard deviation σ is known, which is rare. In practice the sample standard deviation is used, and the t interval is the right choice for any sample of at least 2 observations.
Why is the Wilson interval better than the Wald interval?
The Wald interval estimates its own spread from the sample proportion, which fails for small samples and for proportions near 0 or 1. The Wilson interval stays within 0% and 100%, and its actual coverage is much closer to the stated level.
Which confidence level should I choose?
95% is the most common choice. A higher level such as 99% gives a wider interval and a lower one such as 90% a narrower one. The level is a decision about how sure you want to be, not a property of the data.
How many observations do I need for a given margin of error?
Use the sample size calculator. For a proportion, the required sample depends on the margin of error, the confidence level and the expected proportion.
Does the calculator send my numbers anywhere?
No. The calculation runs in your browser, and nothing you type is sent to our servers.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.2: Confidence limits for the mean
- Wikipedia: Binomial proportion confidence interval (Wald and Wilson intervals)
- Brown, Cai and DasGupta (2001), Interval Estimation for a Binomial Proportion, Statistical Science 16(2)
- Wilson (1927), Probable Inference, the Law of Succession, and Statistical Inference, Journal of the American Statistical Association 22(158)
Figures and text last checked on Tuesday, November 10, 2026.