Use this calculator to compute the confidence interval or margin of error, assuming the sample mean most likely follows a normal distribution. Use the Standard Deviation Calculator if you have raw data only.
• Sample Size (n): Total observations in your dataset (n ≥ 2).
• Sample Mean (X̄): The point estimate average of your sample.
• Standard Deviation (σ or s): Degree of dispersion in the sample or population.
• Automatic Branching: Uses Z-Distribution for n ≥ 30 and Student's t-Distribution for n < 30.
Enter your sample size (n), sample mean (X̄), and standard deviation (s) on the left to calculate the exact confidence limits and margin of error.
Inferential parameter estimation, standard error derivation, and Z-distribution vs. Student's t-distribution selection.
In statistics, a confidence interval (CI) is an estimated range of values within which an unknown population parameter (such as the true population mean μ) is expected to lie with a specified degree of confidence (e.g., 95% or 99%).
Rather than providing a single point estimate (which is virtually guaranteed not to equal the true population mean exactly), a confidence interval accounts for random sampling variability by providing an interval bounded by a lower limit and an upper limit.
Incorrect: "There is a 95% probability that the true population mean lies between 19.71 and 21.49." (The true mean is a fixed constant, not a random variable — it either is in the interval or it is not).
Correct: "If we were to take 100 independent random samples from the same population and compute a 95% confidence interval for each sample, approximately 95 of those 100 intervals would successfully contain the true population mean."
Increasing n reduces the standard error (SE = s/√n), which decreases the margin of error and creates a narrower, more precise confidence interval.
Higher confidence levels (e.g. 99% vs. 90%) require larger critical values (2.576 vs. 1.645), resulting in a wider margin of error to capture more probability mass.
When estimating population variance from a sample, one degree of freedom is lost to estimate the sample mean (X̄), leaving n - 1 independent pieces of information.
A 95% confidence interval corresponds to a two-sided hypothesis test at significance level α = 0.05. If a hypothesized value falls outside the confidence interval, the null hypothesis is rejected at p < 0.05.