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
- Choose whether you are estimating a mean or a proportion.
- Enter your sample stats: mean, standard deviation, and size, or successes and size.
- 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
Standard Deviation Calculator
Calculate standard deviation and variance online. Paste a list of numbers to get the mean, count, and both sample and population results instantly.
Average Calculator
Find the mean, median, mode, range, sum, count, min and max of a list of numbers. Paste values separated by commas, spaces or new lines.
Linear Regression Calculator
Fit a least squares line to your x and y data. Get the slope, intercept, equation, r-squared, and correlation, plus a scatter plot, in your browser.
Area Calculator
Find the area of a circle, square, rectangle, triangle, trapezoid, parallelogram, ellipse, sector or rhombus. Free and runs in your browser.
Arithmetic Sequence Calculator
Find the nth term, the sum of n terms and the full term list for any arithmetic or geometric sequence. Enter the first term, step or ratio, and n.
Big Number Calculator
Add, subtract, multiply, divide, power, modulo, factorial, GCD and LCM on integers of any length. Exact results with no rounding, computed in your browser.