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 - moe

Upper Bound

upper = x_bar + moe

Margin of Error

margin_of_error = moe

Standard Error

standard_error = se

Variables

VariableDescriptionDefault
x_barSample Mean50
sigmaStandard Deviation10
nSample Size36
zZ-Value (e.g., 1.96 for 95%)1.96
seDerived value= sigma / sqrt(n)calculated
moeDerived 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
  1. 01Standard Error = 10 / sqrt(36) = 10 / 6 = 1.6667
  2. 02Margin of Error = 1.96 * 1.6667 = 3.2667
  3. 03Lower bound = 50 - 3.2667 = 46.7333
  4. 04Upper bound = 50 + 3.2667 = 53.2667
  5. 0595% CI: (46.7333, 53.2667)

Ready to run the numbers?

Open Confidence Interval Calculator