About the confidence interval calculator
A confidence interval is a point estimate plus or minus a margin of error, and 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 Student's t with n − 1 degrees of freedom, or from the normal distribution when σ is known. For a proportion the Wilson score interval is the default, with the Wald formula p̂ ± z√(p̂(1 − p̂)/n) offered for comparison.
Survey results, lab measurements and A/B tests are reported this way. The default sample of 36 with mean 72.4 and standard deviation 8.1 gives SE = 1.35, t = 2.030 on 35 df and a 95% interval of 69.66 to 75.14, or 72.4 ± 2.74.
The 95% describes the procedure: across many samples, about 95% of intervals built this way contain the true value. Any single interval either contains it or does not.
Questions
What does a 95% confidence interval mean?
The method captures the true value in 95% of repeated samples. For the default data the interval is 69.66 to 75.14, but there is not a 95% probability that the true mean lies in that particular range: the true mean is fixed, and this interval either contains it or not. Nor does the interval hold 95% of individual values, which spread far wider (SD 8.1); that needs a prediction or tolerance interval.
How do you calculate the margin of error?
Multiply the critical value by the standard error. For a mean, E = t × s/√n: with s = 8.1 and n = 36, E = 2.030 × 1.35 = 2.74. For a proportion, E ≈ z√(p̂(1 − p̂)/n): 54% of 1,000 respondents gives 1.96 × 0.0158 ≈ 0.031, or ±3.1 percentage points. Because n sits under a square root, quadrupling the sample size halves the margin.
When should I use a z interval instead of a t interval?
Only when the population standard deviation σ is known, which is rare outside textbook problems and long-running process data. With σ estimated from the sample, use t. Its 95% critical value is larger for small samples, 2.262 for n = 10 against 1.960 for z, and approaches z as n grows: 2.030 at n = 36 and 1.984 at n = 101.
Why use the Wilson interval for a proportion?
The Wald interval p̂ ± z·SE covers the true proportion less often than stated when n is small or p̂ is near 0 or 1; Brown, Cai and DasGupta (2001) found its coverage can fall far below 95% even with hundreds of observations. Wilson stays close to the stated level and never leaves the range 0 to 1. With 0 successes in 20 trials Wald gives the zero-width interval [0, 0], while Wilson gives 0 to 0.161.
If a confidence interval for a difference excludes 0, is the result significant?
Yes, for the matching test: a 95% interval for a difference in means excludes 0 exactly when a two-sided test at α = 0.05 using the same method (Welch or pooled) rejects no difference. The default two-group summaries give 3.5 ± 4.0, from −0.5 to 7.5, which includes 0, so the difference is not significant at 5%. The interval also shows how large the effect could plausibly be, which a p-value does not.
How accurate is the confidence interval calculator?
Accuracy depends on your inputs and the method's assumptions. Decimal arithmetic uses 50 significant digits, but estimates, numerical methods and source data can be less precise; the displayed rounding does not remove those limits. It is checked against 7 worked examples whose answers come from independent sources; for example, “Mean with sample SD, n = 36 (defaults)” is checked against t₀.₉₇₅,₃₅ = 2.030 (t table); Python bisection on the A&S 26.7.3 closed form gives 2.0301079283; margin = t·8.1/6.
Where does the method come from?
NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.2.1 Confidence limits for the mean; NIST/SEMATECH e-Handbook, §7.2.4.1 Confidence intervals for a proportion (Wilson and normal approximation); Brown, Cai & DasGupta (2001). Interval estimation for a binomial proportion. Statistical Science 16(2), 101–133.