---
slug: confidence-interval-calculator
title: "Confidence Interval Calculator"
category: math
updated: 2026-11-18
canonical: https://calcseed.com/c/math/confidence-interval-calculator/
html: /c/math/confidence-interval-calculator/
---

# Confidence Interval Calculator

Calculate the confidence interval for a population mean from your sample mean, standard deviation and sample size.

## Quick answer

**Quick answer:** with the default inputs (100, 15, 30, 1.96), the margin of error is **5.37**. At these inputs: lower bound = **94.63**, upper bound = **105.37**. Change any input to update the result.

## Default calculation

Values computed by this calculator at exactly the default inputs listed below.

### Inputs (defaults)

| Input | Value | Unit |
| --- | --- | --- |
| Sample mean | 100 |  |
| Standard deviation | 15 |  |
| Sample size | 30 |  |
| Confidence level | 1.96 |  |

### Outputs at these defaults

| Output | Value | Unit |
| --- | --- | --- |
| Margin of error | 5.36768 |  |
| Lower bound | 94.6323 |  |
| Upper bound | 105.368 |  |
| Standard error | 2.73861 |  |

## Formula

```text
CI = x&#772; &plusmn; z &middot; (s / &radic;n)
```

## Inputs

| Variable | Type | Unit | Default |
| --- | --- | --- | --- |
| Sample mean | number |  | 100 |
| Standard deviation | number |  | 15 |
| Sample size | number |  | 30 |
| Confidence level | select |  | 1.96 |

## Outputs

| Result | Format |
| --- | --- |
| Margin of error | primary |
| Margin of error | number |
| Lower bound | number |
| Upper bound | number |
| Standard error | number |

## How it works

### What this calculator does

Enter a sample mean, a standard deviation, a sample size and a confidence level, and the calculator returns the standard error, the margin of error and the full interval. With the defaults — mean 100, standard deviation 15, sample size 30, 95% confidence — it reports a margin of error of 5.368 and an interval of [94.63, 105.37]. That is the range where the true population mean plausibly sits.

### How the interval is built

The **standard error** (SE) is the sample standard deviation divided by the square root of the sample size; it measures how much a sample mean of this size wobbles from sample to sample. The **margin of error** is the confidence-level z-score times the SE, and the interval is the sample mean plus and minus that margin.

Where **x&#772;** is the sample mean, **z** is the z-score for your confidence level, **s** is the sample standard deviation, and **n** is the sample size.

### Worked example at the defaults

- Standard error: SE = 15 ÷ &radic;30 = 15 ÷ 5.4772 ≈ 2.739
- Margin of error: ME = 1.96 × 2.739 ≈ 5.368
- Lower bound: 100 − 5.368 = 94.63
- Upper bound: 100 + 5.368 = 105.37

The interval [94.63, 105.37] spans about 10.7 points. If a claim says the population mean equals 108, the interval already rejects it — 108 lies well above 105.37, more than two standard errors above 100, which a 95% interval does not tolerate.

### How the confidence level changes the width

Raising the confidence level multiplies the margin of error by a bigger z-score, so the interval gets wider. At the defaults the 90% interval is roughly [95.49, 104.51] with a margin of 4.505, the 95% interval is [94.63, 105.37] with 5.368, and the 99% interval widens to about [92.95, 107.05] with 7.055. Confidence is purchased with width: demanding more certainty about capturing the mean forces you to accept a vaguer range.

| Confidence level | z-score | Margin of error | Interval |
| --- | --- | --- | --- |
| 90% | 1.645 | ≈ 4.51 | ≈ [95.49, 104.51] |
| 95% | 1.96 | ≈ 5.37 | [94.63, 105.37] |
| 99% | 2.576 | ≈ 7.05 | ≈ [92.95, 107.05] |

Notice the intervals are not dramatically different from one another — moving from 90% to 99% adds less than three points of margin at these settings. The expensive lever is not the confidence level; it is the sample size.

### How the sample size changes the width

The standard error shrinks as 1/&radic;n, so precision improves only with the square root of effort. At the defaults, n = 30 gives SE ≈ 2.739 and a margin of ≈ 5.37. Quadrupling the sample to n = 120 halves the standard error to 15 ÷ &radic;120 ≈ 1.369 and the margin to ≈ 2.684, producing [97.32, 102.68]. Halving the margin again would need n = 480. This square-root penalty is why national surveys settle for margins near 3% rather than chasing 1%.

#### The t-distribution caveat

This calculator uses the z-distribution, which treats the standard deviation as known. When s comes from a small sample (n below about 30), the estimate of &sigma; is itself uncertain and the t-distribution gives slightly wider, more honest intervals. At n = 30 the difference is modest — a t-critical value of about 2.045 versus 1.96 widens the margin by roughly 4% — but at n = 5 the t multiplier reaches 2.776, over 40% wider than z.

#### Reporting an interval

Standard scientific style reports the estimate plus and minus the margin, with the confidence level in parentheses: 100 &plusmn; 5.37 (95% CI). Graphs show the same information as error bars extending 5.37 units above and below the point estimate. Always state the confidence level — an interval of [94.63, 105.37] means nothing without knowing whether it is a 90% or a 99% interval.

### Common mistakes

- Reading the interval as a 95% probability that this particular interval contains the mean — the 95% describes the long-run success rate of the method, not one interval
- Confusing the standard deviation (15) with the standard error (2.739); the SE is always the smaller number
- Using z on very small samples instead of the t-distribution
- Adding the margin of error to only one side of the interval
- Comparing two groups by checking whether their intervals overlap, which is more conservative than a proper two-sample test

A useful self-check: the margin of error should equal z × SE exactly, and the two bounds must sit symmetrically around the sample mean. For the defaults, 100 − 5.368 = 94.63 and 100 + 5.368 = 105.37, so the arithmetic closes.

## FAQ

### What does a 95% confidence interval mean?

It means that if you repeated the sampling many times, about 95% of the intervals constructed this way would capture the true population mean. It is a statement about the method, not about any single interval.

### What is the difference between z and t?

The z-distribution assumes you know the population standard deviation or have a large sample; the t-distribution is wider for small samples to account for the extra uncertainty in estimating the standard deviation. At n = 30 the gap is only about 4%.

### Why does a bigger sample shrink the interval?

The standard error falls as 1/&radic;n, so quadrupling the sample roughly halves the margin of error. Going from n = 30 to n = 120 cuts the margin from about 5.37 to about 2.68.

### What interval does the default setup produce?

With mean 100, standard deviation 15, n = 30 and 95% confidence, the margin of error is about 5.37 and the interval is [94.63, 105.37].

### How much wider is a 99% interval than a 90% one?

At the defaults the 90% margin is about 4.51 and the 99% margin is about 7.05, so moving from 90% to 99% confidence widens the interval by roughly 56%.

### Can I use this for proportions?

This tool is for means. For proportions use the sample size calculator, which applies the p(1 − p) proportion formula instead of s/&radic;n.

### How large a sample do I need for a 3% margin of error?

For a proportion question at 95% confidence the answer is about 1,068 responses. For a mean it depends on the standard deviation: with s = 15, a margin of 3 requires n ≈ (1.96 × 15 ÷ 3)² ≈ 96.

### Does a wider interval mean my data is bad?

No. Width reflects uncertainty, not quality. A wide interval usually means a small sample or a spread-out population, and the honest response is more data, not a lower confidence level.

### Why is 95% the standard confidence level?

It is a historical convention that balances false alarms against useful precision. Most scientific fields report 95% intervals by default, while safety-critical quality control often prefers 99%.

### How should I report the result?

Standard style is 100 &plusmn; 5.37 (95% CI), or the full interval [94.63, 105.37] with the confidence level stated. Error bars on a chart usually show the same 5.37-unit margin.

## Method and sources

Methodology: Results follow exact mathematical definitions; the arithmetic is deterministic and can be verified by hand from the steps shown.

Last updated: 2026-11-18.
- Standard error = s/√n; margin of error = z × SE; interval = mean ± margin of error.
