← Home

🎯 Confidence Interval Calculator

Confidence Interval Calculator is a free statistics tool that computes the lower and upper bounds of a confidence interval for a population mean. Enter the sample mean, standard deviation, sample size, and confidence level, and choose whether the population sigma is known. The calculator picks the correct Z or t critical value, shows the margin of error, and displays the full interval. All calculations run locally in your browser, with data kept private and no account required. Students, researchers, and analysts use it for survey analysis, experiment reporting, and quality control.

Compute a confidence interval for a population mean with Z or t critical values.

What is this tool?

A confidence interval (CI) is a range of values, calculated from sample data, that is likely to contain the true population parameter (such as the mean μ) at a chosen confidence level. Instead of giving a single point estimate like the sample mean x̄, a confidence interval provides a lower and upper bound that bracket the plausible values of the parameter. For example, a 95% confidence interval of [48.2, 51.8] means that if you repeated the sampling process many times, about 95% of the resulting intervals would contain the true population mean. The concept is closely tied to the normal distribution and the Z-score, since the width of the interval depends on how spread out the data is and how confident you want to be.

There are two main formulas. When the population standard deviation σ is known, the interval uses a Z critical value and follows the form x̄ ± Z* × σ/√n. When σ is unknown (the typical real-world case), you use the sample standard deviation s and a t critical value with n−1 degrees of freedom: x̄ ± t* × s/√n. The t-distribution is wider than the normal curve for small samples, which produces slightly more conservative intervals. As sample size grows, t converges to Z. Our calculator handles both cases automatically and works alongside the standard deviation calculator and the p-value calculator.

Lower Upper x̄ 95% Confidence Interval Margin of Error

How it works

The confidence interval calculator applies one of two classic statistics formulas, depending on whether the population standard deviation is known.

Z-Interval (σ known)

CI = x̄ ± Z* × σ / √n

Used when you know the true population standard deviation σ. The critical value Z* comes from the standard normal distribution: 1.645 for 90%, 1.96 for 95%, and 2.576 for 99% confidence.

t-Interval (σ unknown)

CI = x̄ ± t* × s / √n

Used when σ is unknown and you estimate it with the sample standard deviation s. The critical value t* comes from the t-distribution with n − 1 degrees of freedom. For large n, t* approaches Z*. The calculator looks up the correct t* for your sample size and confidence level automatically.

Margin of Error

ME = critical value × (sd / √n)

The lower bound equals x̄ − ME and the upper bound equals x̄ + ME. A larger sample size shrinks ME, while a higher confidence level widens it because the critical value grows.

Confidence Level and Critical Values

Confidence LevelZ* (σ known)t* at df=10t* at df=30t* at df=∞
90%1.6451.8121.6971.645
95%1.9602.2282.0421.960
99%2.5763.1692.7502.576

As degrees of freedom increase, the t critical value approaches the Z value. For df above 30 the difference is negligible for most practical work.

Margin of Error Examples

These worked examples show how sample size, standard deviation, and confidence level combine to set the margin of error (ME).

ScenariosdnLevelCriticalME
σ known, large n1010095%1.9601.96
σ unknown, moderate n102595%2.0644.13
Small sample, t used121099%3.16912.02
Large sample, high confidence840099%2.5761.03

ME = critical × sd / √n. The last row shows how a large sample keeps the interval narrow even at 99% confidence.

Ad

How to use

  1. Enter your sample mean (x̄) — for example, 50. This is the average of your sampled data.
  2. Enter the standard deviation. If σ is known, type the population value; otherwise type the sample standard deviation s.
  3. Enter the sample size (n). Values larger than 1 are required; larger samples give narrower intervals.
  4. Select a confidence level — 90%, 95%, or 99%. Then choose whether sigma is known (Z method) or unknown (t method).
  5. Click Calculate to see the lower bound, upper bound, margin of error, and the critical value used.

Frequently Asked Questions

When should I use the Z-interval versus the t-interval?

Use the Z-interval when you know the true population standard deviation σ from prior studies or census data. Use the t-interval when σ is unknown and you must estimate it with the sample standard deviation s. For samples larger than about 30 the two methods give nearly identical results because the t-distribution converges to the normal distribution.

What does a 95% confidence interval actually mean?

It means that if you repeated the sampling procedure many times and built a confidence interval each time, about 95% of those intervals would contain the true population mean. It does not mean there is a 95% probability that the specific interval you calculated contains the parameter, because the parameter is fixed, not random.

Why is my interval wider at 99% confidence than at 90%?

Higher confidence requires a larger critical value (2.576 versus 1.645), which increases the margin of error and therefore widens the interval. You are trading precision for certainty. To keep the interval narrow at high confidence, you need a larger sample size.

How does sample size affect the confidence interval?

The margin of error is divided by the square root of n, so quadrupling the sample size only halves the width of the interval. This diminishing return means that very precise estimates require exponentially more data, which is why most polls use samples of 1,000 to 2,000 rather than tens of thousands.

Can this calculator handle a confidence level other than 90, 95, or 99 percent?

This version supports the three most common levels. For custom levels you would need the exact Z or t critical value for that probability, which is beyond the scope of this simplified tool. Most published research uses one of these three standard levels.

What if my sample size is very small?

With n below 10 and σ unknown, the t-distribution produces very wide intervals because there is little information to estimate variability. Such intervals may be too broad to be useful. Consider collecting more data or reporting the result alongside its wide margin of error so readers understand the uncertainty.

Tips & Advice

Choose 95% as your default confidence level — it is the most widely used convention in scientific research. Use 99% only when a false conclusion is very costly, since the wider interval is less precise. If your sample size is below 30 and σ is unknown, the t-distribution noticeably widens the interval, so always select the t method for small samples. Remember that a confidence interval is not the probability that the parameter lies inside the interval; it describes the long-run success rate of the method. All data stays in your browser.

Related Tools

Sources & References

Limitations

This confidence interval calculator assumes a simple random sample from a normally distributed population or a sufficiently large sample for the Central Limit Theorem to apply. It does not handle stratified sampling, cluster sampling, weighted survey data, or finite population corrections. The t critical values are approximated from a lookup table at common degrees of freedom (5, 10, 15, 20, 25, 30, 40, 50, 100, and infinity), so results for intermediate sample sizes may differ slightly from a continuous t-distribution calculator. The tool supports only three confidence levels (90%, 95%, 99%). For complex survey designs, small non-normal populations, or custom confidence levels, consult a statistician or use a dedicated statistical package such as R, SAS, or SPSS.

Ad