Confidence interval calculator
mean, σ unknown: x̄ ± t(1−α/2, n−1) · s/√n
Three situations treated separately because they share neither their distribution nor their domain: a mean with unknown population standard deviation (Student’s t, the real case almost always). A mean with known σ (normal, rare), and a proportion. For proportions the tool serves the wilson interval rather than Wald: Wald produces bounds outside [0; 1] and collapses to a point when no success is observed, the tool computes both and flags the case where Wald lies.
[93.808; 106.19]
- Calculation
- CI = x̄ ± c × standard error = 100 ± 2.0639 × 3
- Margin of error
- ± 6.1917
The true mean is estimated to lie in [93.808; 106.19], a margin of ± 6.1917.
What 95% means: if sampling were repeated many times, 95% of the intervals built this way would contain the true value. It is not “there is a 95% chance the true value lies in this interval”, the true value is fixed; it is the interval that varies from sample to sample.
Scientific dossier
What the tool computes, what it assumes, where it stops being valid, and where its data comes from.
Method & formulasmean, σ unknown: x̄ ± t(1−α/2, n−1) · s/√n
mean, σ unknown: x̄ ± t(1−α/2, n−1) · s/√n
mean, σ known: x̄ ± z(1−α/2) · σ/√n
proportion (Wilson): (p̂ + z²/2n)/(1 + z²/n) ± z·√(p̂(1−p̂)/n + z²/4n²)/(1 + z²/n)
proportion (Wald, for comparison): p̂ ± z·√(p̂(1−p̂)/n)
A confidence interval always has the same structure: the estimate, plus or minus a critical value times a standard error. What changes between cases is the distribution providing the critical value. When the population standard deviation is unknown (the real situation nearly everywhere) estimating it from the sample adds uncertainty, which Student’s t accounts for: at n = 5 its critical value is 2.78 against 1.96 for the normal, a 42% wider interval. For a proportion, the Wilson formula is not centred on p̂: its centre is shifted slightly toward 1/2, and that is exactly what keeps it inside [0; 1].
- Confidence level
- · the proportion of intervals that would contain the true value if sampling were repeated many times. It is a property of the method, not of the particular interval in front of you.
- Margin of error
- · half the width of the interval. It shrinks as 1/√n: quadrupling the sample halves the margin, the price of precision.
- Wilson interval
- · the recommended method for a proportion (Wilson, 1927): its actual coverage stays close to the stated level even for p near 0 or 1, where Wald’s collapses.
Validity domainThe interval on a mean assumes random sampling and, for small samples.
The interval on a mean assumes random sampling and, for small samples. An approximately normal population. On a large sample the central limit theorem makes the assumption mild, but a biased sample stays biased whatever its size. No finite-population correction is applied (it matters when the sample exceeds ~5% of the population). The tool does not check your data for normality: it computes under the assumption, it does not test it.
Common pitfall: “a 95% chance the true value is in there”This is the most widespread reading, and it is wrong in the frequentist framework.
This is the most widespread reading, and it is wrong in the frequentist framework. The true value is fixed: it is either in the interval or it is not, no probability attaches to that. What is probabilistic is the procedure: over many samples, 95% of intervals built this way would contain the true value. The statement “a 95% chance that θ lies in [a; b]” belongs to the Bayesian approach, with a credible interval. Which is not what this tool computes.