Confidence Interval Calculator

Estimate a population mean from a sample mean, standard deviation and sample size. Choose Student t when the SD is estimated from the sample, or z when the population SD is genuinely known. This choice depends on the source of the SD, not an automatic sample-size cutoff. Results assume an appropriate sampling design and reference distribution; they describe uncertainty in a mean, not a range containing individual observations.

Confidence Interval Calculator Interactive Tool

Choose by the source of the SD
Estimated sample SD → Student t; known population SD → z.

The method never switches automatically with sample size. Interval arithmetic is approximate.

Results

95% Confidence Interval
[94.3989079486283, 105.601092051372]
Margin of Error
5.60109205137168
Standard Error
2.73861278752583
Method
Student t; df = 29
Critical Value (approx.)
2.04522964213277

How to use this calculator

  1. Enter the sample mean and a nonnegative standard deviation in the same units. Blank values are not treated as zero.
  2. Choose Sample SD · Student t if the SD was estimated from these observations; choose Known population SD · z only when that population SD is known independently.
  3. Enter a whole-number sample size: at least 2 for sample SD, or at least 1 for known population SD. Select 90%, 95% or 99% confidence.
  4. Read the interval, margin of error and standard error together. Check the sampling assumptions before interpreting coverage; rescale inputs if a numerical-limit message appears.

The Formula

The mathematical logic powering this calculation is:

Estimated sample SD: SE = s / √n; df = n − 1
CI = x̄ ± t(1 − α/2, df) × SE
Known population SD: SE = σ / √n
CI = x̄ ± z(1 − α/2) × SE
Confidence = 100(1 − α)%; margin of error = critical value × SE

Worked Example

If you input:

  • Sample Mean (x̄): 100
  • Standard Deviation (σ or s): 15
  • Sample Size (n): 30
  • Confidence Level: 95%
  • SD source and interval method: Sample SD · Student t

Result:

With sample SD 15 and n = 30, df = 29 and the 95% t critical value is approximately 2.04523. SE ≈ 2.73861, margin ≈ 5.60109, and the confidence interval is approximately [94.39891, 105.60109].

Frequently Asked Questions

When should I use Student t rather than z?

Use Student t when the supplied SD estimates the population SD from the sample. Its degrees of freedom are n − 1. Use z when the population SD is known, rather than merely estimated from a large sample. A large sample makes t approach z, but this calculator does not silently change the chosen method at n = 30 or any other threshold.

What does 95% confidence mean?

Under the stated sampling and distribution assumptions, the procedure would contain the fixed population mean in 95% of intervals over repeated samples. It does not assign a 95% probability to that fixed mean after this interval has been observed, and it does not say that 95% of individual measurements lie inside the interval.

Which sampling and distribution assumptions does a mean interval require?

The observations should support independent, representative sampling. The classical t interval is exact under an independent normal-population model; departures such as severe skew, outliers or dependence can make small-sample coverage unreliable. Known-SD z inference also needs a normal sampling distribution for the mean, either from the model or a suitable large-sample approximation. The calculator cannot verify those assumptions from summary inputs.

How do confidence and sample size change the interval?

For fixed SD and sample size, a higher confidence level uses a larger critical value and a wider interval. For fixed SD, increasing n reduces SE = SD/√n; the t critical value also approaches the corresponding normal critical value. These changes describe statistical precision, not protection against sampling bias or inaccurate measurements.

Why can zero SD produce a point interval?

The stated formulas give zero SE and zero margin when SD is zero, so both endpoints equal the mean. A zero sample SD only says the observed values are identical at their recorded precision; it does not establish zero uncertainty in the population. A warning accompanies this algebraic point interval.

Which numbers and numerical limits are supported?

Use complete finite decimal or scientific-notation values, at most 128 characters each, with explicit exponents from −324 to 324. Sample size must be an exact integer no larger than 9,007,199,254,740,991. The confidence choices are exactly 90%, 95% and 99%. Distribution functions and interval arithmetic are numerical approximations. Nonzero values that cannot be represented, overflowed endpoints, and intervals whose endpoints collapse onto the mean are rejected rather than displayed as zero-width certainty.

Where are the methods documented?

NIST's Confidence Limits for the Mean documents the sample-SD t interval and repeated-sampling interpretation. OpenStax Introductory Statistics 2e, section 8.1, explains a mean interval when population SD is known. Both distinguish standard error from the spread of individual data values.

Similar Calculators