Confidence Interval Calculator
Calculate the confidence interval for a population mean using sample data. Uses z-based approximation suitable for large samples.
About this calculator
This calculator builds a confidence interval around Sample Mean using the z-based formula Margin of Error = z × (Standard Deviation / √Sample Size) (lines 9, 15), where the z-value comes from inverting the standard normal CDF at the chosen Confidence Level (line 13). Margin of Error, Standard Error, Z-Value, and Interval Width are all completely unaffected by Sample Mean — none of their formulas ever reference it (lines 9-18); Sample Mean only shifts where the interval is centered, via Lower Bound and Upper Bound, which it dominates. Confidence Level, similarly, has zero effect on Standard Error, since Standard Error depends only on Standard Deviation and Sample Size — but it's the single input driving Z-Value, and by extension Margin of Error and Interval Width.
Interval Width is always exactly twice Margin of Error, since Upper Bound minus Lower Bound algebraically cancels Sample Mean and leaves 2 × Margin of Error (line 18) — a fixed relationship, not a separate calculation. This calculator does not switch to a t-distribution for small samples: it always uses the z-approximation regardless of Sample Size, even down to the field's allowed minimum of 2, where a t-based interval would normally be noticeably wider than what this calculator reports.
Inputs
Results
Lower Bound
48.04
Upper Bound
51.96
Margin of Error
1.96
How to Use This Calculator
- Enter Sample Mean (x̄), Standard Deviation (σ or s), and Sample Size (n).
- Set Confidence Level (%).
- Review Lower Bound, Upper Bound, and Margin of Error.
- Use Standard Error and Z-Value to inform your decision.
- Use the chart to visualize the results and explore different scenarios by adjusting inputs.
How the result changes with Sample Mean (x̄)
| Sample Mean (x̄) | Lower Bound | Upper Bound | Margin of Error |
|---|---|---|---|
| 25 | 23.04 | 26.96 | 1.96 |
| 38 | 36.04 | 39.96 | 1.96 |
| 75 | 73.04 | 76.96 | 1.96 |
| 125 | 123.04 | 126.96 | 1.96 |
What each input means
- Sample Mean (x̄)
- The arithmetic mean of your sample data.
- Standard Deviation (σ or s)
- Population or sample standard deviation. Use sample SD if population SD is unknown.
- Sample Size (n)
- Number of observations in the sample. Larger samples yield narrower intervals.
- Confidence Level (%)
- Desired confidence level as a percentage. Common choices: 90%, 95%, 99%.
How this is calculated
Worked example, using the default values
- Identify Input Parameters4 parametersSample Mean (x̄) = 50, Standard Deviation (σ or s) = 10, Sample Size (n) = 100, Confidence Level (%) = 95 = 4 input(s) provided
- Calculate Lower BoundLower Bound48.0396 = 48.0396
- Calculate Upper BoundUpper Bound51.9604 = 51.9604
- Calculate Margin of ErrorMargin of Error1.9604 = 1.9604
- Calculate Standard ErrorStandard Error1 = 1
- Calculate Z-ValueZ-Value1.9604 = 1.9604
Engine last updated . Checked against 2 independently-derived tests — 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 (lines 9, 15) — Sample Mean never appears in that formula; it only shifts where the resulting interval is centered, through Lower Bound and Upper Bound.
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, so subtracting one from the other cancels Sample Mean and leaves exactly 2 × Margin of Error (line 18) — it's a fixed algebraic relationship, not a number computed separately.
Does Confidence Level affect the Standard Error shown?
No — Standard Error is computed purely as Standard Deviation divided by the square root of Sample Size (line 9), with no reference to Confidence Level at all; Confidence Level only affects the Z-Value used to convert that Standard Error into a Margin of Error.
Does this calculator use a t-distribution for a small sample size?
No — it always uses the z-based normal approximation (line 13), regardless of how small Sample Size is set, even at the field's allowed minimum of 2. A true small-sample interval would normally use a wider t-distribution-based critical value instead.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
T-Test Calculator
Calculate the t-statistic, degrees of freedom, and approximate p-value for a one-sample t-test.
StatisticsPower Analysis Calculator
Calculate the required sample size for a study given the effect size, significance level, and desired statistical power.
StatisticsConfidence Interval Calculator
Calculate the confidence interval for a population mean. Determine the margin of error and range where the true population parameter likely falls.
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.
DevopsCI/CD Pipeline Cost Calculator
Calculate total CI/CD cost including platform fees and developer wait time.
More in Math & Statistics.