Boneyard Tools

Confidence Interval Calculator

Build a confidence interval for a population mean or proportion. Enter your sample statistics, pick a confidence level, and the calculator returns the interval, the margin of error, and the critical value used. Switch to Student's t for small samples.

How to calculate a confidence interval

  1. Choose whether you are estimating a mean or a proportion.
  2. Enter your sample stats: mean, standard deviation, and size, or successes and size.
  3. Pick a confidence level to read the interval, margin of error, and critical value.

Examples

95% interval for a mean

mean = 100, sd = 15, n = 100, confidence = 95%
Margin of error 2.94, interval 97.06 to 102.94

95% interval for a proportion

successes = 50, n = 100, confidence = 95%
p-hat 0.5, margin of error 0.098, interval 0.402 to 0.598

Frequently asked questions

What is a confidence interval?

A confidence interval is a range of plausible values for an unknown population value, such as a mean or a proportion, built from a sample. A 95% confidence level means that if you repeated the sampling many times, about 95% of the intervals you built this way would contain the true value.

How is the margin of error calculated?

The margin of error is the critical value times the standard error. For a mean the standard error is the standard deviation divided by the square root of the sample size. For a proportion it is the square root of p-hat times one minus p-hat, divided by the sample size. The interval is the estimate plus and minus that margin.

When should I use the t distribution instead of z?

Use Student's t for a mean when the population standard deviation is unknown and you estimate it from a small sample. The t critical value is larger than the matching z value, which widens the interval to account for the extra uncertainty. As the sample grows, t converges to z, so the choice matters most for small samples.

What critical values does this use?

For z intervals it uses the standard values: 1.645 for 90%, 1.96 for 95%, and 2.576 for 99%, with an inverse-normal approximation for other levels. For t intervals it uses a table of common degrees of freedom and falls back to z for very large samples.

Why is a 99% interval wider than a 95% interval?

Higher confidence requires a larger critical value, so the margin of error grows and the interval gets wider. There is a trade-off: a wider interval is more likely to contain the true value but is less precise.

Is my data sent anywhere?

No. The calculation runs entirely in your browser, so your numbers never leave your device.

Related tools