Confidence Interval Calculator

Enter your sample mean, standard deviation, sample size, and confidence level to calculate the confidence interval for a population mean. Choose between a Z-interval (known population SD) or t-interval (unknown population SD), and get back the lower bound, upper bound, margin of error, and critical value — all in one place.

%

Enter a value between 50 and 99.99

Population SD (σ) for Z-interval, sample SD (s) for t-interval

Number of successes in your sample (for proportion CI)

Results

Confidence Interval

--

Lower Bound

--

Upper Bound

--

Margin of Error (±E)

--

Critical Value

--

Standard Error (SE)

--

Confidence Interval Visualization

Frequently Asked Questions

What is a confidence interval?

A confidence interval is a range of values, derived from sample data, that is likely to contain the true population parameter (such as a mean or proportion). For example, a 95% confidence interval means that if you repeated the study 100 times, approximately 95 of those intervals would contain the true population value. It does not mean there is a 95% probability that the true value lies within any single computed interval.

When should I use a Z-interval vs. a t-interval?

Use a Z-interval when you know the population standard deviation (σ) or when your sample size is very large (n > 30 is a common rule of thumb). Use a t-interval when the population standard deviation is unknown and you are estimating it from the sample standard deviation (s). The t-distribution has heavier tails than the normal distribution, producing wider intervals for smaller samples — this reflects additional uncertainty.

What does the confidence level mean?

The confidence level (e.g. 90%, 95%, 99%) reflects the long-run reliability of the estimation procedure. A 95% confidence level means that the method used to construct the interval will capture the true parameter 95% of the time across repeated samples. A higher confidence level produces a wider interval because you need to cast a wider net to be more certain of capturing the true value.

How does sample size affect the confidence interval?

Larger sample sizes produce narrower confidence intervals because the standard error (SE = σ/√n) decreases as n increases. This means more data leads to more precise estimates of the population parameter. Doubling precision requires quadrupling the sample size, since SE is proportional to 1/√n.

How is the margin of error calculated?

The margin of error (E) is calculated as E = critical value × standard error. For a mean with known σ, SE = σ/√n. For a proportion, SE = √(p̂(1−p̂)/n). The critical value comes from the Z or t distribution depending on which type of interval you are computing. The confidence interval is then estimate ± E.

What is a proportion confidence interval?

A proportion confidence interval estimates the true population proportion based on observed successes in a sample. For example, if 45 out of 100 surveyed people prefer a product, p̂ = 0.45. The confidence interval tells you the plausible range for the true proportion in the population. This calculator uses the standard Wald interval formula: p̂ ± z* × √(p̂(1−p̂)/n).

What are the assumptions for a valid confidence interval?

Key assumptions include: the sample is randomly selected from the population, observations are independent, and for the Z or t interval, the population is approximately normally distributed (or n is large enough by the Central Limit Theorem, typically n ≥ 30). For proportion intervals, both np̂ and n(1−p̂) should be at least 5 to ensure the normal approximation is valid.

What is degrees of freedom in a t-interval?

Degrees of freedom (df) for a one-sample t-interval equals n − 1, where n is the sample size. The t-distribution with df degrees of freedom is used to find the critical value t*. As df increases (i.e., larger sample sizes), the t-distribution approaches the standard normal distribution, and the t* value converges toward the corresponding z* value.

More Math Tools