Confidence Interval Calculator
Confidence interval calculator. Enter a sample mean and its spread, or successes out of a sample, plus the sample size and confidence level. The interval and margin of error update as you type.
How to use
- Choose a mean or a proportion, and pick 90%, 95%, 99%, or a custom level from 50 to 99.9.
- For a mean, enter the sample mean, the standard deviation, and the sample size.
- Say whether that standard deviation is from the sample (t) or the population (z).
- For a proportion, enter the successes and the sample size, then read the interval, critical value, and margin of error.
Formula
For a mean, the interval is the sample mean ± critical value × (standard deviation / √n). Use a t critical value with n − 1 degrees of freedom when the standard deviation is from the sample, and a z critical value when the population standard deviation is known. For a proportion, the Wald interval is p ± z × √(p(1 − p) / n), where p is successes divided by n. The critical value is the two-sided point for the confidence level you choose.
Example. A mean of 50, a sample standard deviation of 10, and n = 25 gives a 95% t interval with 24 degrees of freedom. The critical value is 2.0639, the standard error is 2, and the margin of error is 4.1278. The interval runs from 45.8722 to 54.1278.
Example. A mean of 100, a population standard deviation of 15, and n = 36 gives a 95% z interval. The critical value is 1.9600, the margin of error is 4.8999, and the interval runs from 95.1001 to 104.8999.
Example. 86 successes out of 200 is a sample proportion of 0.43. The 95% Wald interval has a standard error of 0.0350 and a margin of error of 0.0686, so it runs from 0.3614 to 0.4986 (36.14% to 49.86%).
A range, not a p-value
The interval estimates the mean or the proportion. It does not return a p-value, and a Wald proportion interval can fall outside 0 and 1. The math stays in your browser.
Frequently asked questions
How do you calculate a confidence interval for a mean?
The interval is the mean plus or minus the critical value times the standard deviation divided by the square root of n. For a mean of 50, a sample standard deviation of 10, and n = 25, the 95% t critical value with 24 degrees of freedom is 2.0639. The standard error is 2 and the margin of error is 4.1278, so the interval runs from 45.8722 to 54.1278.
When do you use t instead of z?
Use t when the standard deviation comes from the sample. Use z when the population standard deviation is known. A mean of 100, a population standard deviation of 15, and n = 36 has a 95% z critical value of 1.9600, a margin of error of 4.8999, and an interval from 95.1001 to 104.8999.
How do you calculate a confidence interval for a proportion?
The Wald interval is the sample proportion plus or minus z times the square root of p(1 − p) / n. With 86 successes out of 200, the sample proportion is 0.43. At 95%, the critical value is 1.9600, the standard error is 0.0350, and the margin of error is 0.0686. The interval runs from 0.3614 to 0.4986, or 36.14% to 49.86%.
What confidence level should I use?
90%, 95%, and 99% are the usual choices. A higher level uses a larger critical value and a wider interval. This page accepts any level from 50 to 99.9 percent.
Does a confidence interval test a hypothesis?
No. The interval is a range for the mean or the proportion. It does not return a p-value. For a p-value from a test statistic, use the p-value calculator. The math stays in your browser.
Related tools
- SchoolStandard Deviation CalculatorGet sample and population standard deviation, variance, and mean from a list of numbers.
- SchoolMean Median Mode CalculatorPaste numbers to get mean, median, mode, and range with the sorted data shown.
- SchoolP Value CalculatorTurn a z, t, chi-square, or F test statistic into a p-value and a significance verdict.
- SchoolPythagorean Theorem CalculatorFind a missing side of a right triangle, plus area, perimeter, and angles.
- SchoolGCF CalculatorFind the greatest common factor of two or more numbers, with prime factors and Euclid's steps.
- SchoolLCM CalculatorFind the least common multiple of 2 or more whole numbers, with step-by-step work.