# Confidence Interval Calculator

- **URL:** https://codeasystem.com/calculators/statistics/confidence-interval-calculator/
- **Category:** statistics
- **Description:** Build a 90%, 95% or 99% confidence interval for a mean from your sample mean, standard deviation and size.
- **Primary output:** 95% confidence interval: [99.02, 100.98]

## Inputs
- Sample mean (x̄) (name: `mean`, type: number, example: 100)
- Sample SD (or σ) (name: `sd`, type: number, example: 15)
- Sample size (n) (name: `n`, type: number, example: 900)
- Confidence level (name: `confidence`, type: select)

## Outputs
- 95% confidence interval: [99.02, 100.98]
- Margin of error: ±0.98
- Interval width: 1.96
- z multiplier used: 1.96

## Formula / methodology
```
CI = x̄ ± z·(s / √n)
```

The interval centers on your sample mean and extends z standard errors to each side, where the standard error is the sample SD divided by √n. Wider intervals mean less certainty; larger samples shrink the margin proportionally to √n.

z multipliers are 1.6449 (90%), 1.9600 (95%) and 2.5758 (99%). The normal approximation is appropriate when n ≥ 30 or the population SD is genuinely known; smaller samples should use a t-distribution instead.

## Assumptions & limitations
- Large-sample normal approximation (n ≥ 30 or known σ).
- Observations are independent and randomly sampled.
- For small samples, a t-based interval would be wider.

## How to use
1. **Enter your sample statistics**; The mean, standard deviation and size from your collected data.
2. **Pick a confidence level**; 95% is the scientific default; 99% widens the net, 90% narrows it.
3. **Read the range**; The primary output brackets where the true population mean plausibly lies; the margin-of-error row gives the half-width.

## Example
A sample of 900 measurements with mean 100 and SD 15 gives a 95% CI of [99.02, 100.98]; a margin of error of ±0.98 around the mean.

Result for these inputs:

```
95% confidence interval: [99.02, 100.98]
```

## About this calculator
### What “95% confident” really means

It describes the procedure, not any single interval: if you repeated the sampling many times, about 95% of the intervals built this way would capture the true mean. Your particular interval either contains it or does not; the confidence level quantifies long-run reliability.

### The levers you control

- Quadrupling n halves the margin of error.
- Raising confidence from 95% to 99% widens the interval by ~31%.
- Lower data variability (smaller s) narrows the interval directly.

## FAQs
### Should I use z or t here?

This tool uses z, appropriate for n ≥ 30 or known population σ. For small samples with estimated SD, the analogous t-interval will be slightly wider.

### Why did my margin of error come out small?

Margins shrink with √n; big surveys produce tight intervals. Check that n reflects completed responses, not invitations sent.

### Can the interval contain impossible values?

Yes, mechanically; e.g. a negative lower bound for a weight. That signals the model (often normality or sample size) fits poorly rather than a calculator bug.

### Does higher confidence mean a better estimate?

Not inherently. You trade width for confidence: 99% intervals are safer but vaguer. Report the level you commit to before seeing results.

## Related calculators
- [Sample Size Calculator](https://codeasystem.com/calculators/statistics/sample-size-calculator/)
- [Z-Score Calculator](https://codeasystem.com/calculators/statistics/z-score-calculator/)
- [Standard Deviation Calculator](https://codeasystem.com/calculators/statistics/standard-deviation-calculator/)

---
Last updated: 2026-08-23 · Version: 1.0.0 · [HTML version](https://codeasystem.com/calculators/statistics/confidence-interval-calculator/)
