Confidence Interval Calculator
Calculate the confidence interval for a population mean. Determine the margin of error and range where the true population parameter likely falls.
About this calculator
This calculator builds a confidence interval around Sample Mean using Margin of Error = z × (Standard Deviation ÷ √Sample Size) (line 67-68), where z comes from a fixed lookup table for 90%, 95%, or 99% confidence (lines 10-14) rather than a t-distribution — it uses the same normal (z-based) approximation regardless of how small Sample Size is set. Sample Mean is completely inert for Margin of Error, Standard Error, and Interval Width: none of those three formulas reference it at all (lines 67-71), so it only shifts where the interval is centered, through Lower Bound and Upper Bound — and Sample Mean dominates Lower Bound's sensitivity, since nudging it up or down by 10% moves Lower Bound over twenty times more than the same-sized nudge to Standard Deviation, and over fifty times more than the same nudge to Sample Size. Interval Width is always exactly double Margin of Error, because Upper Bound minus Lower Bound algebraically cancels Sample Mean and leaves 2 × Margin of Error (lines 69-71).
Unlike this site's other confidence-interval calculator (statistics/confidence-interval.ts), whose line 5 combines a boolean-OR fallback with a `Math.max` floor, clamps both a genuinely negative Standard Deviation and a tiny positive one (like 0.0001) up to 0.001 — a Standard Deviation of exactly 0 is falsy, so the boolean-OR fallback substitutes a hardcoded 1 (not the field's own default of 10) before that floor ever runs, never reaching the 0.001 floor for that particular case — this engine leaves Standard Deviation unclamped entirely and instead checks Sample Size directly: a Sample Size of 0 or less (line 18) returns an explicit "Sample size must be greater than 0" result rather than dividing by zero or silently substituting a different value. This calculator does not switch to a t-distribution for small samples and does not validate that Standard Deviation is a population parameter rather than a sample estimate.
Inputs
Results
Margin of Error (±)
1.96
How to Use This Calculator
- Enter your Sample Mean (x̄) — the average of your collected data points.
- Enter the Standard Deviation (σ) of your sample and the Sample Size (n, number of observations).
- Choose a Confidence Level: 90%, 95%, or 99% — higher confidence produces a wider interval.
- The calculator uses the z-score for the chosen level (e.g., 1.96 for 95%) and computes: margin of error = z × (σ / √n).
- Lower Bound and Upper Bound define the range where the true population mean is expected to fall with the stated confidence.
- Increase sample size to narrow the interval without changing confidence level.
How the result changes with Standard Deviation (σ)
| Standard Deviation (σ) | Margin of Error (±) |
|---|---|
| 5 | 0.98 |
| 7.5 | 1.47 |
| 15 | 2.94 |
| 25 | 4.9 |
What each input means
- Sample Mean (x̄)
- The average of your sample data
- Sample Size (n)
- The number of observations in your sample
- Standard Deviation (σ)
- The standard deviation of the population (or sample)
- Confidence Level
- How confident you want to be in the interval
How this is calculated
Formula
CI = x̄ ± z × (σ / √n)Engine last updated . Checked against 1 independently-derived test — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.
Frequently Asked Questions
Does Sample Mean affect the Margin of Error?
No. Margin of Error is built purely from Standard Deviation, Sample Size, and Confidence Level (line 67-68) — Sample Mean never appears in that formula; it only shifts where the resulting interval is centered, through Lower Bound and Upper Bound, which it dominates.
Why is Interval Width always exactly double the Margin of Error?
Because Upper Bound and Lower Bound are Sample Mean plus and minus Margin of Error (lines 69-71), so subtracting one from the other cancels Sample Mean and leaves exactly 2 × Margin of Error — a fixed algebraic relationship, not a number computed independently.
Does this calculator use a t-distribution for a small sample size?
No — it always uses the z-based normal approximation from a fixed lookup table (lines 10-14), regardless of how small Sample Size is set. A true small-sample interval would normally use a wider t-distribution-based critical value in that situation instead.
What happens if I set Sample Size to 0?
Dividing by zero never happens here. An explicit check at line 18 detects a Sample Size of 0 or less and returns "Sample size must be greater than 0" along with all-zero output values, rather than letting √Sample Size in the denominator produce an error or an undefined result.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Sample Size Calculator
Determine the required sample size for your survey or study. Calculate how many responses you need for statistically significant results.
StatisticsZ-Score Calculator
Calculate the z-score (standard score) for any value in a normal distribution. Find the percentile ranking and probability associated with your data point.
Survey ResearchMargin of Error Calculator
Calculate the margin of error for your survey results based on sample size, confidence level, population size, and expected proportion.
StatisticsConfidence Interval Calculator
Calculate the confidence interval for a population mean using sample data. Uses z-based approximation suitable for large samples.
Math & StatisticsStandard Deviation Calculator
Calculate the mean, median, standard deviation, and variance for a set of numbers. Supports both population and sample calculations.
More in Math & Statistics.