Confidence interval calculator
SCQUALITYGUILD.COM/TOOLS/CONFIDENCE-INTERVAL-CALCULATOR.HTML
Enter summary statistics or raw data to get confidence intervals for a mean, a standard deviation and a proportion, the sample size needed for a target margin of error, and tolerance and prediction intervals for individual values.
ON THE EXAM · CSSGB III.B.2, IV.B.1, CQE VI.D.1, CSSBB VI.B.4 · FREE · NOTHING YOU TYPE LEAVES YOUR BROWSER
Q-BotClick for an explanation of this tool.For educational use. This page is a study aid. The method behind it has far more depth and detail than one page and one tool can cover, and what you see here is not everything the method offers or everything this site offers. For full understanding and application, use the governing standards and texts, and seek further education, training or qualified advice. Results depend on the data you enter, so check them before relying on them.
What a confidence interval says
A point estimate such as x̄ or p̂ is almost never exactly equal to the population value. A confidence interval adds a margin around it: estimate ± critical value × standard error. A 95% confidence level describes the method, not one interval: if you repeated the sampling many times, about 95% of the intervals built this way would contain the true value. It does not mean there is a 95% probability that this particular interval contains it.
Which formula
- Mean, σ known: x̄ ± z·σ/√n. Rare in practice; σ must come from long, stable history.
- Mean, σ unknown: x̄ ± t·s/√n with n − 1 degrees of freedom. This is the usual case. t is wider than z for small samples and approaches it as n grows.
- Variance: from (n − 1)s²/χ² using the upper and lower chi-square values with n − 1 df. Take square roots for σ. The interval is not symmetric around s and relies heavily on normal data.
- Proportion: the normal approximation (Wald) is p̂ ± z√(p̂(1 − p̂)/n). The Wilson score interval instead finds every p for which p̂ would not be surprising; it pulls the center toward 0.5 and never runs below 0 or above 1. The exact (Clopper–Pearson) interval comes straight from the binomial distribution and is conservative.
Why Wilson and Wald differ
The Wald interval uses p̂ to estimate its own standard error and assumes a symmetric normal shape. Near 0 or 1, or with few items counted, the true sampling distribution is skewed, so Wald intervals are too narrow and can include impossible negative values. A common rule says the normal approximation needs np̂ and n(1 − p̂) of at least 5, or 10 in stricter texts. The Wilson interval keeps close to its stated coverage even when those counts are small.
Sample size for a margin
For a mean, n = (zσ/E)²; for a proportion, n = z²p(1 − p)/E², with p = 0.5 when nothing is known. Always round up. Halving the margin quadruples n.
Three intervals that are easy to confuse
- Confidence interval for the mean, x̄ ± t·s/√n: where the process average is. It shrinks toward zero width as n grows.
- Prediction interval, x̄ ± t·s·√(1 + 1/n): where the next single value will fall. It never gets narrower than about ±t·s.
- Tolerance interval, x̄ ± k·s: where at least a stated share P of all individual values fall, with confidence γ. It has two percentages (for example 95% confidence that 99% of values are covered) and is the one to compare with specification limits.
The tolerance factor k depends on n, P and γ. The tool computes it exactly under the normal model: the one-sided k from the noncentral t distribution, k = t′γ; n−1, zP√n/√n, and the two-sided k by numerical integration of Odeh's exact equation. It also shows the hand approximations most texts teach, Howe's two-sided k ≈ z(1+P)/2·√((n − 1)(1 + 1/n)/χ²1−γ; n−1) and the Natrella one-sided formula, so you can see how close they are. Published tables of exact factors give the same values. Tolerance and prediction intervals depend on the individual values being normal far more than a confidence interval for the mean does; check a normal probability plot first.
On the exam
CSSGB: expect to compute an interval by hand from n, x̄ and s with a t table, choose between z and t, compute a proportion interval with the normal approximation, and find the sample size for a stated margin. Interpreting the interval correctly is tested as often as the arithmetic. CQE VI.D.1 adds standard error and tolerance intervals, and CSSBB VI.B.4 asks you to distinguish confidence and prediction intervals and to calculate tolerance and confidence intervals: expect to compute x̄ ± k·s with k from a table and to say which interval answers a given question.
Common questions
How do I calculate a confidence interval for a mean?
Take the sample mean plus or minus t × s ÷ √n, where t comes from the t distribution at n − 1 degrees of freedom for your confidence level. Enter the summary statistics or paste the raw data and the calculator does the rest.
What sample size do I need for a confidence interval?
For a mean, n = (z × σ ÷ E)², where E is the margin of error you want. For a proportion, n = z² p(1 − p) ÷ E². This calculator returns both; for more options use the sample size calculator.
What is the difference between a confidence interval and a tolerance interval?
A confidence interval brackets a parameter such as the mean. A tolerance interval brackets a stated proportion of the individual values, for example 99% of parts with 95% confidence, which is what a specification comparison usually needs.