Confidence Interval Calculator — Margin of Error
Enter your sample mean, standard deviation, and sample size to instantly calculate a 90%, 95%, or 99% confidence interval, along with the margin of error.
📊 Enter Sample Statistics
📊 Result
Disclaimer: This tool performs standard mathematical calculations for educational and reference purposes. Always double-check results independently for graded coursework, exams, or safety-critical applications.
What a Confidence Interval Tells You
A confidence interval gives you a range of plausible values for an unknown population mean, based on a sample you've collected. Instead of reporting a single number as your best guess, it reports a range along with a confidence level (like 95%) that describes how reliable the range-building method is. The wider the interval, the more certain you can be that it captures the true value — but the less precise that estimate becomes.
The Formula
This calculator uses the z-based confidence interval formula, appropriate when your sample size is reasonably large (a common rule of thumb is n ≥ 30) or the population standard deviation is otherwise known:
Margin of Error = z × (s / √n)
Confidence Interval = [mean − margin, mean + margin]
where s is the sample standard deviation, n is the sample size, and z is the critical value matching your chosen confidence level: 1.645 for 90%, 1.96 for 95%, and 2.576 for 99%. These values come from the standard normal distribution and represent how many standard errors you need to travel from the mean to capture the corresponding percentage of a normal curve.
Worked Example
Suppose a sample of n = 30 items has a mean of 50 and a standard deviation of 5, and you want a 95% confidence interval (z = 1.96).
- Step 1 — Standard error: 5 / √30 ≈ 5 / 5.477 ≈ 0.9129
- Step 2 — Margin of error: 1.96 × 0.9129 ≈ 1.789
- Step 3 — Interval: [50 − 1.789, 50 + 1.789] = [48.21, 51.79]
So we can say, with 95% confidence, the true population mean likely falls between roughly 48.21 and 51.79.