# Confidence Interval Calculator

> Find the confidence interval for a population mean from the sample mean, standard deviation and size, using the t-distribution or a known σ.

Category: Statistics & probability · Applies to: Worldwide · Last updated: 2026-10-29
Interactive calculator: https://calculators.geekmidst.com/calculators/confidence-interval-calculator

A confidence interval for a mean is the sample mean plus or minus a critical value times the standard error. Use t when the standard deviation comes from your sample.

Also called: Margin of error calculator (mean).

## Inputs
- Sample mean (x̄) (default 50)
- Standard deviation (default 10)
- Sample size (n) (default 25)
- Confidence level (unit %; default 95)
- Method (options: t (σ unknown), z (σ known); default t)

## Results
- Confidence interval
- Lower bound
- Upper bound
- Margin of error (±)
- Standard error
- Critical value (t* or z*)
- Degrees of freedom (t only)

## Formula

```
CI = x̄ ± c × s ÷ √n, where c = t(1 − α/2, n − 1) or z(1 − α/2), and α = 1 − confidence
```

Where:
- x̄: sample mean
- s: standard deviation
- n: sample size
- c: two-sided critical value

## Worked example
1. Standard error = 10 ÷ √25 = 2.
2. t* for 95% with 24 degrees of freedom = 2.0639.
3. Margin = 2.0639 × 2 = 4.1278, so the interval is 50 ± 4.1278.

**Result:** With a sample mean of 50, s = 10 and n = 25, the 95% confidence interval for the mean is 45.87 to 54.13.

## What the result means

If you repeated the sampling many times, about 95% of intervals built this way would contain the true mean. A narrower interval needs a larger sample: halving the margin takes roughly four times as many observations.

## Assumptions and limits
- Observations are independent and come from a random sample.
- The population is roughly normal, or the sample is large enough (about 30+) for the mean to be close to normal.
- This is for a single mean. Proportions, differences between groups and paired data need different formulas.
- Strong skew or outliers in small samples make the interval unreliable.

## Questions

### Should I use t or z?

Use t whenever the standard deviation is estimated from the sample, which is almost always. Use z only when σ is genuinely known in advance. For large n they give nearly the same answer.

### Does a 95% interval mean a 95% chance the mean is inside?

Not strictly. The true mean is fixed; the 95% describes how often the method captures it over repeated samples.

## Related calculators
- [Z-score Calculator](https://calculators.geekmidst.com/calculators/z-score-calculator)
- [P-value Calculator](https://calculators.geekmidst.com/calculators/p-value-calculator)
- [Standard Deviation Calculator](https://calculators.geekmidst.com/calculators/standard-deviation-calculator)
- [Average Calculator](https://calculators.geekmidst.com/calculators/average-calculator)

Source: GM¹X CalcVerse — https://calculators.geekmidst.com/calculators/confidence-interval-calculator
