Confidence Interval Calculator
A confidence interval for a mean or a proportion, using Student’s t automatically when the population standard deviation is unknown.
Result
Confidence interval: 45.872203 to 54.127797
Exact arithmetic; the interval rests on the conditions stated below it.
- Lower limit
- 45.872203
- Upper limit
- 54.127797
- Margin of error
- 4.127797
- Standard error
- 2
- Critical value
- 2.063899
- Distribution used
- Student’s t, because the population standard deviation is estimated from the sample
- Degrees of freedom
- 24
https://calcgallery.com/statistics/confidence-interval-calculator/
Results follow the mathematical operation and values shown. Check that you selected the intended operation, convention and dataset type before relying on the result. Read the full disclaimer
How to use the Confidence Interval Calculator
- Choose an interval for a mean or for a proportion, and the confidence level.
- For a mean, enter the sample mean, the sample standard deviation and the sample size. For a proportion, enter the share of the sample and the sample size.
- Read the interval, with the margin of error, the standard error, the critical value and which distribution was used.
The formulas
mean, σ estimated x̄ ± t* × s ÷ √n with n − 1 degrees of freedommean, σ known x̄ ± z* × σ ÷ √nproportion p̂ ± z* × √(p̂(1 − p̂) ÷ n)
The term after the critical value is the standard error, which the page also shows on its own: s ÷ √n, σ ÷ √n, or √(p̂(1 − p̂) ÷ n). OpenStax calls σ ÷ √n “the standard error of the mean”. The margin of error is always the critical value times the standard error, so a reader who has one of the two can check the other.
The critical value, t* or z*, is chosen so that the stated share of the distribution lies between −t* and +t*. The diagram shades that central region.
Critical values are calculated, not looked up
Printed tables list t* for a handful of confidence levels and a limited set of degrees of freedom. This page calculates it exactly for whatever you enter, so a 97% interval or a sample of 37 needs no rounding to the nearest row. As the sample grows, t* approaches z*: at 95% it is 2.064 for 25 values, 1.984 for 101 and within 0.001 of 1.960 beyond about 10,000.
Reading the result
The interval is the sample estimate plus or minus the margin of error. For a proportion, it is shown as percentages. The margin depends on the spread of the data, the sample size and the confidence level, but not on the size of the population, unless the sample is a large share of it. The margin of error calculator handles that case.
With your numbers
- Critical value = 2.063899 (t, 24 degrees of freedom)
- Standard error = s ÷ √n = 2
- Margin = 2.063899 × 2 = 4.127797
- Interval = 50 ± 4.127797 = 45.872203 to 54.127797
Quick reference
Exact arithmetic; the interval rests on the conditions stated below it.
| Example | Confidence interval |
|---|---|
| Mean 50, s 10, n 25, 95% | 45.872203 to 54.127797 |
| Mean 50, σ 10 known, n 25, 95% | 46.080072 to 53.919928 |
| Mean 50, s 10, n 2, 95% | -39.846435 to 139.846435 |
| Mean 98.2, s 0.7, n 130, 99% | 98.039487 to 98.360513 |
| 52% of 1,000, 95% | 48.9035% to 55.0965% |
| 1% of 50, 95% (rough) | -1.7579% to 3.7579% |
| Mean 50, s 10, n 25, 97% | 45.386173 to 54.613827 |
Common questions about the Confidence Interval Calculator
- When should I use t instead of z?
- Whenever the standard deviation comes from your own sample, which is almost always. The t distribution has heavier tails than the normal to allow for that estimate being uncertain, so it gives a wider, more honest interval for small samples. With 25 values at 95% the critical value is 2.064 rather than 1.960. The page uses t automatically unless you enter a known population standard deviation.
- What does 95% confidence mean?
- That the method captures the true value 95% of the time. If you repeated the sampling many times and built an interval each time, about 95 in every 100 intervals would contain the true mean. It does not mean there is a 95% chance the true mean lies inside this particular interval: the true mean is fixed, and this interval either contains it or does not.
- Why is my interval so wide?
- A small sample, a large standard deviation or a high confidence level all widen it. The width shrinks with the square root of the sample size, so halving it needs four times as many observations. With only two values the 95% critical value is 12.7, and the interval is very wide, as it should be.
- What is the difference between the standard error and the margin of error?
- The standard error is how much the sample mean or proportion would typically vary from one sample to the next: s ÷ √n for a mean, √(p̂(1 − p̂) ÷ n) for a proportion. The margin of error is that standard error multiplied by the critical value for your confidence level, so it grows as you ask for more confidence while the standard error does not.
- Why does the page warn about my proportion?
- The proportion interval treats the count of successes as approximately normal, which needs at least about 5 successes and 5 failures in the sample. With 1% of 50, that is half a success, and the interval can even run below 0%. The page still gives the figures but marks them as rough. An exact or Wilson interval would be the better tool there.