Confidence Interval Calculator
Calculate the confidence interval for a population mean from sample data. Supports 90%, 95%, and 99% confidence levels.
Did this tool work for you?
How to use this calculator
The interval is centred on the sample mean x̄. z* is the critical value for the chosen confidence level, σ is the standard deviation, and n is the sample size.
- 1
Enter the sample mean, standard deviation, and sample size.
- 2
Select the desired confidence level (90%, 95%, or 99%).
- 3
The result gives the lower and upper bounds of the interval, and the margin of error.
Frequently asked questions
What formula does the calculator use?
x̄ ± z* × (σ ÷ √n), with z* fixed at 1.645 for 90%, 1.96 for 95% and 2.576 for 99% confidence. The standard error is the number you enter as the standard deviation divided by √n, and the margin of error is z* times that. For x̄ = 100, σ = 15 and n = 50, the 95% interval is 95.8422 to 104.1578, a margin of ±4.1578 from a standard error of 2.1213.
Does it use the t distribution?
No, only the normal-curve critical values, with no adjustment for sample size. That is exactly right when σ is a known population value. If you instead plug in a sample standard deviation from a small sample, the interval comes out too narrow. For n = 5 with s = 10, the tool gives ±8.7654, while the t critical value for 4 degrees of freedom is 2.776, which would give about ±12.4. By 29 degrees of freedom t is 2.045 versus 1.96, about 4% wider.
What does "95% confident" actually mean?
It describes the method: if you repeated the sampling and built an interval each time, about 95% of those intervals would contain the true mean. It does not mean this particular interval has a 95% probability of containing it, and it does not mean 95% of individual observations lie inside it. The interval is for the mean, not for individual values.
How do sample size and confidence level change the width?
Width is proportional to z* ÷ √n. Quadrupling n halves the margin: with σ = 10 and a 95% level, n = 100 gives ±1.96 and n = 400 gives ±0.98. Raising confidence widens the interval: for the default data, ±3.4896 at 90%, ±4.1578 at 95% and ±5.4645 at 99%.
Can I use it for a proportion or a percentage?
Not directly. The formula assumes you are estimating a mean with a spread you supply. Intervals for a yes/no proportion use a different standard error based on the observed share. To plan a proportion survey, use the sample size calculator.
What inputs are rejected or risky?
The standard deviation must be above 0 and n at least 1, otherwise an error appears. However n = 1 is only meaningful if σ is a known population value, since a sample standard deviation cannot be computed from one observation. The calculator does not check that n is a whole number and applies no finite-population correction.
Can the interval be used as a hypothesis test?
Loosely, yes. If a hypothesised mean lies outside a 95% interval built with z*, a two-sided z-test at the 5% level would reject it. For small samples with an estimated spread, use the t-test calculator instead, which gives an exact t-based p-value.
What assumptions does the interval rely on?
A random sample, independent observations, and either roughly normal data or a large enough sample for the mean to be nearly normal. It also treats the standard deviation as known. It cannot repair a biased sample: a very narrow interval around a biased mean is still wrong.
Confidence interval for a mean: z-based margin of error
Interval = estimate ± margin
A confidence interval turns a single sample mean into a range. The calculator takes the mean, the standard deviation and the sample size, forms the standard error σ ÷ √n, and multiplies it by the critical value for the level you choose. It reports the lower and upper bounds, the margin of error, the standard error and z*. The critical values are fixed constants, so the method is the large-sample or known-σ interval.
| Confidence | z* | Margin of error | Interval |
|---|---|---|---|
| 90% | 1.645 | ±3.4896 | 96.5104 to 103.4896 |
| 95% | 1.96 | ±4.1578 | 95.8422 to 104.1578 |
| 99% | 2.576 | ±5.4645 | 94.5355 to 105.4645 |
Worked example: effect of sample size
Take a mean of 72 and σ = 10. At n = 100 the standard error is 1.0000 and the 95% interval is 70.04 to 73.96. At n = 400 the standard error is 0.5000 and the interval narrows to 71.02 to 72.98. Four times the data buys half the margin, which is why precision gets expensive as you push for tighter intervals.
Worked example: when the z shortcut is too optimistic
Suppose a sample of five observations has mean 72 and a sample standard deviation of 10. The calculator returns 63.2346 to 80.7654 (±8.7654). But because 10 is an estimate from just five values, the appropriate multiplier is t = 2.776 on 4 degrees of freedom, not 1.96, and the honest margin is closer to ±12.4. The z-based result understates the uncertainty here. For thirty or more observations the difference is small.
Interpreting the range
The range shows which population means are consistent with your data at the chosen confidence. It is not a range for individual measurements, and it says nothing about the chance that this particular interval is correct. Overlap rules between two intervals are a rough guide at best. Reporting the interval alongside the mean is more informative than a bare significance verdict, because it shows both size and precision.
Scope and limits
The tool covers means with three confidence levels. It does not offer a t-based interval, intervals for proportions, medians or differences between groups, or finite-population corrections. Intervals reflect random sampling error only. Non-response, measurement mistakes and selection effects shift the mean in ways no interval captures.
Learn more from an authoritative source:
WikipediaSample Size Calculator
Calculate the minimum sample size required for a statistically valid survey or experiment. Specify confidence level, margin of error, and population size.
Percentile Calculator
Find the percentile rank of a score in a dataset, or find the value at a given percentile. Enter up to 10 data values.
Poisson Distribution Calculator
Calculate Poisson probabilities for rare events. Find P(X = k), P(X ≤ k), and P(X > k) given an average rate λ.
Variance Calculator
Calculate variance and standard deviation for a set of numbers. Choose population variance (σ²) or sample variance (s²).
Standard Error Calculator
Calculate the Standard Error of the Mean (SEM) from standard deviation and sample size. Includes margin of error for 90%, 95%, and 99% confidence levels.
Correlation Coefficient Calculator
Calculate Pearson correlation coefficient (r) between two variables. Measures strength and direction of linear relationships.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →