Confidence Interval Calculator
Math Calculators
Calculate confidence intervals for a population mean using z or exact-degree-of-freedom Student-t critical values at 90%, 95%, and 99% confidence.
Paste your raw observations into the Statistics Calculator, then copy its Mean result into this field. Keep the observations in the same units used here.
Paste the sample observations into the Statistics Calculator, select Sample under Standard deviation type, and copy the Std Dev result.
Paste the sample observations into the Statistics Calculator and copy its Count result. Check any invalid-token warning before using the count.
Confidence Interval
[46.2659, 53.7341]
Margin of Error
+-3.7341
Critical Value · Student-t
t* = 2.0452
df = n − 1 = 29
Std Error
1.8257
How to use this tool
- Enter sample mean, standard deviation, and sample size.
- Choose confidence level and distribution (z or t).
- Read the confidence interval and margin of error.
What is a confidence interval?
A confidence interval (CI) estimates a population mean from a sample. A 95% CI procedure means that if the same sampling process were repeated many times, about 95% of the intervals made this way would contain the true mean.
Known population σ (Normal/z method):
CI = x̄ ± z* × (σ / √n)
Sample standard deviation s (Student-t method, default):
CI = x̄ ± t* × (s / √n), df = n − 1
This calculator defaults to Student-t and uses the entered sample standard deviation to
compute the standard error s / √n. Its Normal/z option applies the z critical
value to the entered spread for cases where the population standard deviation is known or a
normal approximation is appropriate. With Student-t selected, it finds the two-tailed critical
value for the exact n − 1 degrees of freedom by numerically inverting the t distribution;
it does not round degrees of freedom to a nearby table row.
Common z-scores
| Confidence level | z-score |
|---|---|
| 90% | 1.645 |
| 95% | 1.960 |
| 99% | 2.576 |
Wider vs. narrower intervals
Larger sample sizes and lower confidence levels produce narrower (more precise) intervals. Smaller samples or higher confidence levels (e.g., 99%) produce wider intervals. There is always a tradeoff between precision and confidence.
When to use Student's t-distribution instead of z
The z-distribution assumes you know the population standard deviation and/or have a large sample (n ≥ 30). When the sample size is small (n < 30) and the population standard deviation is unknown, use the Student's t-distribution with n−1 degrees of freedom. The t-distribution has heavier tails than the normal distribution, producing wider intervals that account for the additional uncertainty of a small sample. As n increases, the t-distribution converges to the z-distribution.
For example, a sample size of 12 has 11 degrees of freedom. At 95% confidence its t critical value is about 2.201, rather than the 2.131 value for 15 degrees of freedom. Using the exact value produces the appropriately wider interval. The z option remains available when the population standard deviation is known or a normal approximation is justified.
Common misinterpretation
A 95% confidence interval does not mean "there is a 95% probability that the true population parameter lies in this interval." The parameter is fixed (not random); it either is or isn't in the interval. The correct frequentist interpretation: if you repeated this study an infinite number of times and computed a 95% CI each time, approximately 95% of those intervals would contain the true parameter. This is a subtle but important distinction. The Bayesian equivalent - a 95% credible interval - does support the probabilistic interpretation.
Beyond this tool: sample-size planning for proportions
The formula below plans a sample size for estimating a population proportion, such as the share of poll respondents supporting a candidate. This calculator works with sample means; it does not compute proportion confidence intervals or solve for the sample size in this formula. The example is included as background only.
n = (zα/2)² × p(1−p) / E²
For illustration, a poll planner targeting a 95% margin of error of ±5 percentage points and
an unknown proportion may use p = 0.5 for the conservative estimate. That gives
n = (1.96)² × 0.25 / (0.05)² ≈ 384. The result is a planning estimate for a
proportion, not an output this mean-interval calculator can produce.
Frequently asked questions
When should I use the t-distribution?
Use the t-distribution when your sample size is small (n < 30) or the population standard deviation is unknown. For large samples, the z-distribution is a good approximation.
How does this calculator choose a t critical value?
It calculates the two-tailed Student-t quantile for the exact n − 1 degrees of freedom using a numerical inversion of the t distribution. It does not round degrees of freedom to a more permissive table row.
Related tools
- StatisticsProduce sample mean, sample standard deviation, and count from raw observations.
- Z-ScoreStandardize an individual value relative to the same mean and deviation.
- Distribution CalculatorInspect normal probability and cumulative area around a chosen value.
- Linear RegressionFit a relationship between paired observations after summarizing one sample.