Confidence interval calculator
Confidence interval for a mean from sample size, standard deviation and confidence level.
Fill in the fields and the result will appear here automatically.
Constructs a two-sided normal Z interval for a mean: x̄ ± z·σ/√n. For independent observations from a normal population, this method assumes a known population standard deviation σ. Substituting a sample deviation s gives a normal approximation, not the exact small-sample Student t interval. With the deviation fixed, halving the width requires four times the sample size. Confidence describes repeated use of the procedure and does not guarantee that this particular interval contains the population mean.
How it works
Formula and logic
SE = σ/√n; E = z·SE; the bounds are x̄ − E and x̄ + E. The preserved rounded normal quantiles are z = 1.645 for 90%, 1.96 for 95% and 2.576 for 99%. α = 1 − confidence level, split equally between the two tails. This calculator accepts integer n from 2 to 9007199254740991 and σ ≥ 0. The mean, σ, SE, E and bounds share the data unit; z and α are dimensionless. If a nonzero width cannot be resolved in the numeric bounds, a range error is returned. Resolvable narrow bounds are displayed with additional significant digits.
Example
A mean of 100 with a deviation of 15 over a sample of 36 gives 95.1 … 104.9 at the 95% level.
Fields and units
- Sample mean — data unit
- Standard deviation — data unit
- Sample size — unitless
- Confidence level — list option
How to use
- — Enter the sample mean — it may be negative.
- — Enter known σ or deliberately use sample s as an approximation, in the same unit as the mean.
- — Enter the sample size; it must be at least two.
- — Choose the confidence level — a higher level gives a wider interval.
Method and limitations
- Calculation method
- Formula and logic
- Data or methodology source
- NIST: normal mean interval with known σ and repeated coverage NIST: unknown σ calls for a t method; scope of the normal approximation
- Limitation
- For independent observations from a normal population, this method assumes a known population standard deviation σ. Substituting a sample deviation s gives a normal approximation, not the exact small-sample Student t interval.
FAQ
Why does sample size enter through a square root?
Because averaging reduces spread in proportion to the root of the number of observations. Halving the interval takes four times the sample.
Is the Student distribution used?
No. With unknown σ and normal data, the exact method uses s and a t quantile with n−1 degrees of freedom. This tool calculates a Z interval using known σ or an explicitly chosen normal approximation with s. The small-sample difference need not be slight.
Why is a sample of one rejected?
This calculator requires n ≥ 2. One observation cannot estimate a sample s, although the normal formula is mathematically defined at n = 1 when σ is known externally. The product restriction does not make every such interval impossible.
What does a 95% confidence level mean?
That across repeated experiments about 95% of such intervals would contain the true mean. It is a property of the method, not a probability for one particular interval.
Can the deviation be zero?
Formally yes: σ = 0 gives SE = E = 0 and a point interval. Identical observed values and a sample s of zero do not by themselves establish zero population variance or justify certainty about the population mean.