Confidence Interval Calculator Formula
Understand the math behind the confidence interval calculator. Each variable explained with a worked example.
Formulas Used
Lower Bound
lower = x_bar - moeUpper Bound
upper = x_bar + moeMargin of Error
margin_of_error = moeStandard Error
standard_error = seVariables
| Variable | Description | Default |
|---|---|---|
x_bar | Sample Mean | 50 |
sigma | Standard Deviation | 10 |
n | Sample Size | 36 |
z | Z-Value (e.g., 1.96 for 95%) | 1.96 |
se | Derived value= sigma / sqrt(n) | calculated |
moe | Derived value= z * sigma / sqrt(n) | calculated |
How It Works
How to Calculate a Confidence Interval
Formula
CI = x_bar +/- z * (sigma / sqrt(n))
The confidence interval gives a range of plausible values for the population mean. The standard error (sigma/sqrt(n)) measures how much the sample mean varies across samples. The z-value determines the confidence level: 1.645 for 90%, 1.96 for 95%, 2.576 for 99%.
Worked Example
Sample mean = 50, SD = 10, n = 36. Build a 95% confidence interval.
x_bar = 50sigma = 10n = 36z = 1.96
- 01Standard Error = 10 / sqrt(36) = 10 / 6 = 1.6667
- 02Margin of Error = 1.96 * 1.6667 = 3.2667
- 03Lower bound = 50 - 3.2667 = 46.7333
- 04Upper bound = 50 + 3.2667 = 53.2667
- 0595% CI: (46.7333, 53.2667)
Ready to run the numbers?
Open Confidence Interval Calculator