Confidence Interval Calculator

Estimate a two-sided Student's t interval for a sample mean or a Wilson score interval for a sample proportion from summary sample data.

How It Works

Formula

xˉ±tsn,df=n1\bar{x} \pm t^* \cdot \frac{s}{\sqrt{n}}, \qquad df = n - 1

p^=xn\hat{p} = \frac{x}{n}

CIWilson=p^+z22n±zp^(1p^)n+z24n21+z2n\mathrm{CI}_{\mathrm{Wilson}} = \frac{\hat{p} + \frac{z^{*2}}{2n} \pm z^*\sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^{*2}}{4n^2}}}{1 + \frac{z^{*2}}{n}}

SExˉ=sn,SEp^=p^(1p^)nSE_{\bar{x}} = \frac{s}{\sqrt{n}}, \qquad SE_{\hat{p}} = \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}

Variables, symbols and units

xˉ\bar{x}

Sample mean

ss

Sample standard deviation

nn

Sample size

dfdf

Degrees of freedom, equal to n - 1 in mean mode

tt^*

Two-sided Student's t critical value for the chosen confidence level

xx

Number of successes in proportion mode

p^\hat{p}

Sample proportion, equal to x / n

zz^*

Two-sided normal critical value used by the Wilson score interval
Calculation method explained

Choose mean interval or proportion interval, enter the sample summary you already have, and the calculator returns the interval, margin of error, standard error, and critical value.

Mean mode uses the two-sided Student's t interval xˉ±ts/n\bar{x} \pm t^* \cdot s/\sqrt{n} with df=n1df = n - 1, so smaller samples carry a wider critical value than a normal-model shortcut. Proportion mode uses the Wilson score interval on purpose instead of the naive Wald form p^±zSE\hat{p} \pm z^* \cdot SE, because Wilson behaves better when nn is modest or the sample proportion sits near 0 or 1.

Frequently Asked Questions

How is this different from the Statistics Calculator?
The Statistics Calculator is descriptive: it summarizes the sample you already have with numbers like mean, median, and standard deviation. This calculator takes that sample summary and turns it into an interval for a population mean or population proportion.
How is this different from Normal Distribution or Binomial Probability?
Normal Distribution answers probability questions under an assumed bell-curve model, and Binomial Probability answers event-count questions for repeated yes/no trials. This calculator uses sample evidence to estimate a plausible range for an unknown mean or proportion.
Why use Wilson for proportions, and does 95% confidence mean 95% certainty about this exact interval?
Wilson is more stable than the naive Wald interval when the sample is not huge or the proportion is near 0 or 1. A 95% confidence level does not mean a 95% chance that this fixed interval contains the true value; it means the method is designed to capture the true value about 95% of the time across repeated samples under the model assumptions.

Related Calculators

All calculators

Ready to Calculate?

Free calculators.