Confidence Interval Calculator

t-interval for the mean with margin of error, critical t, and standard error.

Math and PercentUpdated 2026-10-172 min read
Confidence Interval Calculator
Confidence interval
...
Margin of error...
Critical t...
Standard error...

What it does

A confidence interval estimates a population mean from a sample, honestly paired with its uncertainty. The t-based version used here needs just three numbers: the sample mean, the sample standard deviation, and the sample size.

The construction is simple. The standard error of the mean is s / sqrt(n). Multiply it by the critical t value from the t distribution with n - 1 degrees of freedom, and you get the margin of error; the interval is the mean plus or minus that margin.

This is the method in NIST's engineering statistics handbook and OpenStax's statistics text: use t whenever the population standard deviation is unknown, which in practice is nearly always. With very large n the t* value converges to the familiar z of 1.96 at 95 %.

Interpretation matters as much as arithmetic. 95 % confidence describes the procedure: if you repeated the study forever, 95 % of the intervals built this way would contain the true mean. It is not a 95 % probability for one fixed interval.

How to use

  1. Enter the sample mean.
  2. Enter the sample standard deviation.
  3. Enter the sample size.
  4. Pick 90, 95, or 99 % confidence.
  5. Read the interval first.
  6. Read the margin, critical t, and standard error.

Formula

CI = x̄ ± t* x s / sqrt(n). SE = s / sqrt(n). t* comes from the t distribution with n - 1 degrees of freedom at the chosen confidence.
x̄
Sample mean.
s
Sample standard deviation.
n
Sample size.
t*
Critical value from the t distribution, n - 1 degrees of freedom.
SE
Standard error of the mean, s / sqrt(n).

The t interval assumes roughly normal data or a large enough n for the central limit theorem, independent observations, and a sample standard deviation (not a known population sigma). With known sigma or enormous n, swap t* for the z value: 1.645 at 90 %, 1.960 at 95 %, 2.576 at 99 %.

Worked example

Example: mean 100, SD 15, n 25, 95 %

Defaults: sample mean 100, standard deviation 15, sample size 25, 95 % confidence.

  1. SE = 15 / sqrt(25) = 3.00.
  2. Degrees of freedom 24; t* = 2.064.
  3. Margin = 2.064 x 3.00 = 6.19.
  4. Interval: 100 ± 6.19, or 93.81 to 106.19.
  5. Tool shows 93.81 to 106.19, margin 6.19, t* 2.064, SE 3.00.

Reference table

Same mean and SD, more samples, tighter interval (95 %)
Sample sizeSEt*MarginInterval
104.7432.26210.7389.27 to 110.73
253.0002.0646.1993.81 to 106.19
502.1212.0104.2695.74 to 104.26
1001.5001.9842.9897.02 to 102.98
4000.7501.9661.4798.53 to 101.47

Limits

  • Assumes roughly normal data or large n; heavy skew and outliers need bigger samples or bootstrap methods.
  • Observations should be independent; clusters, repeated measures, or weights break the standard error.
  • Uses the sample SD; a genuinely known population sigma calls for a z interval.
  • One interval for one mean; comparing groups or scanning many means needs multiplicity corrections.

Common mistakes

  • Saying this interval has a 95 % chance of containing the true mean.
  • Using z = 1.96 for small samples instead of t*.
  • Confusing the standard deviation with the standard error.
  • Treating a wide interval as a bad result; it is honest uncertainty from the data given.
  • Reading non-overlapping intervals as a formal significance test.

Try it yourself

Quick checks. Answers sit tucked under each question.

Mean 50, SD 10, n 100, 95 %?

SE 1.00, t* 1.984, margin 1.98, interval 48.02 to 51.98.

Mean 100, SD 15, n 25 at 99 %?

t* 2.797, margin 8.39, interval 91.61 to 108.39.

Back to 95 % with n 400?

Margin 1.47, interval 98.53 to 101.47.

Questions

What does 95 % confidence mean?

The procedure captures the true mean in 95 % of repeated studies. One computed interval is either in or out; it does not carry a 95 % chance.

When do I use z instead of t?

Only when the population SD is truly known or n is enormous; the tables meet around n of several hundred. Otherwise t is the correct default.

Why does more data tighten the interval?

Standard error shrinks with the square root of n. Quadrupling n roughly halves the margin, which is why n 100 shows 2.98 against 6.19 at n 25.

What changes at 99 %?

t* grows from 2.064 to 2.797 at 24 degrees of freedom, so the same data earns a wider 8.39 margin. Confidence and precision trade off.

Does this assume normal data?

Approximately. t intervals tolerate mild non-normality, but strong skew or outliers call for larger samples or resampling methods.

Can the interval be huge?

Yes, and that is information: small n plus large SD honestly reports wide uncertainty. The fix is more or better data, not a narrower formula.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.