Confidence Interval Calculator
Enter the sample mean, standard deviation, sample size, and confidence level to calculate the confidence interval for the mean, the margin of error, the standard error, and the z critical value — with every step shown.
- 01Calculate a 90%, 95%, or 99% confidence interval for the mean instantly.
- 02Get the margin of error, standard error, and z critical value in one click.
- 03See the confidence interval formula worked out step by step.
- 04Choose from common confidence levels from 80% up to 99.9%.
- 05100% free and private — every calculation runs in your browser.
Confidence Interval Calculator
95% Confidence Interval
[94.632319, 105.367681]
Estimate of the mean: 100 ± 5.367681
Margin of Error (ME)
5.367681
Standard Error (SE)
2.738613
z Critical Value
1.96
Confidence Level
95%
Lower Bound
94.632319
Upper Bound
105.367681
Sample Mean (x̄)
100
Sample Size (n)
30
Step-by-step calculation
- 01Find the z critical value for a 95% confidence level: z = 1.96
- 02Standard error SE = s ÷ √n = 15 ÷ √30 = 2.738613
- 03Margin of error ME = z × SE = 1.96 × 2.738613 = 5.367681
- 04Confidence interval = x̄ ± ME = 100 ± 5.367681 = [94.632319, 105.367681]
Why Use This Confidence Interval Calculator
Confidence Interval for the Mean
Enter the sample mean, standard deviation, and sample size to get the confidence interval for the population mean instantly. The calculator returns the lower and upper bounds so you know the plausible range for the true mean at your chosen confidence level.
Margin of Error Built In
This confidence interval calculator doubles as a margin of error calculator: it reports the margin of error (z × standard error) directly, so you can express your estimate as mean ± margin of error and see exactly how wide the interval is.
Choose Your Confidence Level
Pick from common confidence levels — 80%, 85%, 90%, 95%, 98%, 99%, and 99.9% — each mapped to its standard z critical value. Switch between a 90%, 95%, or 99% confidence interval to see how the level changes the width of the interval.
Step-by-Step Working
See the confidence interval formula applied step by step: the z critical value, the standard error of the mean, the margin of error, and the final interval. Perfect for statistics homework, exam revision, and checking your own calculations.
Instant and Private
Everything runs entirely in your browser with no server round-trips. Your numbers never leave your device, results appear instantly, and there is no signup or installation required.
Free with No Limits
Calculate as many confidence intervals as you need — no daily limits, no account, and no paywall. The full CI calculator is completely free to use.
What Is a Confidence Interval?
A confidence interval is a range of values, calculated from sample data, that is likely to contain the true value of a population parameter — most commonly the population mean. A 95% confidence interval, for example, means that if you repeated the sampling process many times, about 95% of the intervals constructed this way would contain the true mean. The width of the interval is controlled by the margin of error, which depends on the standard error and the chosen confidence level.
Whether you are a student learning inferential statistics, a researcher reporting results, or an analyst quantifying uncertainty, this confidence interval calculator gives instant, step-by-step estimates of the mean and its margin of error for any sample.
- The Confidence Interval Formula
- For a mean, the confidence interval is x̄ ± z × (s ÷ √n), where x̄ is the sample mean, s is the standard deviation, n is the sample size, and z is the critical value for your confidence level. This calculator uses the z (normal) interval, which is appropriate for large samples or when the population standard deviation σ is known.
- Margin of Error and Standard Error
- The standard error of the mean is s ÷ √n, and the margin of error is the z critical value multiplied by the standard error. A larger sample size reduces the standard error and therefore narrows the confidence interval, giving a more precise estimate of the mean.
- Confidence Level and the z Value
- Higher confidence levels use larger z critical values, which produce wider intervals. Common z values are 1.645 for 90%, 1.96 for 95%, and 2.576 for 99%. There is always a trade-off: more confidence means a wider, less precise interval for the same data.
- z Interval vs t Interval
- This tool computes the z confidence interval, which assumes the sampling distribution of the mean is approximately normal — valid for large samples (commonly n ≥ 30) or a known σ. For small samples with an unknown population standard deviation, use the t interval, which replaces z with a t critical value based on n − 1 degrees of freedom to produce a slightly wider, more conservative interval.
How to Use the Confidence Interval Calculator
- 01
Enter the sample mean
Type your sample mean (x̄) into the first box. This is the average of your sample data and is the center of the confidence interval.
- 02
Enter the standard deviation and sample size
Enter the standard deviation (s or σ) of your data and the sample size (n). Together with the confidence level these determine the standard error and the margin of error.
- 03
Pick a confidence level
Choose a confidence level from the dropdown — for example 95%. The calculator maps it to the matching z critical value (such as 1.96 for 95%) automatically.
- 04
Read the confidence interval
Click Calculate to see the confidence interval shown as [lower, upper], along with the margin of error, standard error, and z value, plus a step-by-step breakdown of the confidence interval formula.
Tips for Calculating Confidence Intervals
Use z for Large Samples
The z confidence interval is appropriate when the sample is large (commonly n ≥ 30) or when the population standard deviation is known. For small samples with an unknown σ, switch to the t interval for a more accurate result.
Bigger Samples, Narrower Intervals
Because the standard error is s ÷ √n, increasing the sample size shrinks the margin of error and narrows the confidence interval. Quadrupling n roughly halves the margin of error.
Match the Confidence Level to the Stakes
A 99% confidence interval is wider than a 95% interval for the same data. Choose a higher confidence level only when missing the true value would be costly, and accept the wider, less precise range that comes with it.
Report the Margin of Error
Express your result as mean ± margin of error so readers can see both the point estimate and its uncertainty. The margin of error is often more intuitive than the raw interval bounds alone.
Check Your Assumptions
A confidence interval for the mean assumes the data is a random sample and, for small samples, that the underlying distribution is roughly normal. Violating these assumptions can make the interval misleading.
Interpret It Correctly
A 95% confidence interval does not mean there is a 95% probability the true mean lies in this one interval. It means 95% of intervals built this way, over many samples, would capture the true mean.
Confidence Interval Formulas and Definitions
Definition of a confidence interval
A confidence interval is a range of plausible values for a population parameter, estimated from sample data. For a mean it is centered on the sample mean and extends by the margin of error in each direction, with the width set by the confidence level.
What a confidence interval tells you
- A plausible range for the true population mean given your sample.
- How precise your estimate is — narrower intervals mean more precision.
- The margin of error, the uncertainty attached to the sample mean.
- How the choice of confidence level (90%, 95%, 99%) trades precision for confidence.
z interval vs t interval — which to use
Use the z (normal) interval for large samples (commonly n ≥ 30) or a known population standard deviation σ. Use the t interval, with a t critical value on n − 1 degrees of freedom, for small samples when σ is unknown.
Key Confidence Interval Formulas
Standard error of the mean
SE = s ÷ √n
Example: 15 ÷ √30 ≈ 2.739.
Margin of error
ME = z × SE
Example: 1.96 × 2.739 ≈ 5.368 for a 95% interval.
Confidence interval for the mean
x̄ ± z × (s ÷ √n)
Lower = x̄ − ME, Upper = x̄ + ME.
z critical values
90% → 1.645, 95% → 1.96, 99% → 2.576
Larger z values give wider, higher-confidence intervals.
t interval (small samples)
x̄ ± t(n−1) × (s ÷ √n)
Use when σ is unknown and the sample is small.
Confidence Interval Calculator FAQ
Q01How do I calculate a confidence interval for the mean?
Find the standard error by dividing the standard deviation by the square root of the sample size (SE = s ÷ √n). Multiply the standard error by the z critical value for your confidence level to get the margin of error (ME = z × SE). The confidence interval is the sample mean plus and minus the margin of error: x̄ ± ME. This calculator does every step for you and shows the working.
Q02What is the confidence interval formula?
For a mean using the z (normal) interval, the formula is x̄ ± z × (s ÷ √n), where x̄ is the sample mean, s is the standard deviation, n is the sample size, and z is the critical value for the confidence level. The interval runs from x̄ − margin of error to x̄ + margin of error.
Q03What z value should I use for a 95% confidence interval?
For a 95% confidence interval the two-sided z critical value is 1.96. Other common values are 1.645 for 90%, 2.326 for 98%, 2.576 for 99%, and 3.291 for 99.9%. This calculator selects the correct z value automatically when you choose a confidence level.
Q04What is the margin of error?
The margin of error is the amount added to and subtracted from the sample mean to form the confidence interval. It equals the z critical value multiplied by the standard error (ME = z × s ÷ √n). A larger sample size or a lower confidence level produces a smaller margin of error.
Q05When should I use a z interval versus a t interval?
Use the z confidence interval, which this calculator computes, when the sample is large (commonly n ≥ 30) or the population standard deviation σ is known. Use the t interval — which replaces z with a t critical value based on n − 1 degrees of freedom — for small samples with an unknown σ. The t interval is slightly wider and more conservative.
Q06How does sample size affect the confidence interval?
Increasing the sample size reduces the standard error (s ÷ √n) and therefore narrows the confidence interval, giving a more precise estimate of the mean. Because of the square root, you need roughly four times the sample size to halve the margin of error.
Q07How should I interpret a 95% confidence interval?
A 95% confidence interval means that if you repeated the sampling and interval-building process many times, about 95% of the resulting intervals would contain the true population mean. It does not mean there is a 95% probability that the true mean falls inside this particular interval.
Q08Is my data sent to a server?
No. The calculator runs entirely in your browser using JavaScript. Your inputs are never uploaded or stored anywhere, so it is safe to use with private or sensitive data.
Q09Is this confidence interval calculator free?
Yes, it is completely free with no limits, no signup, and no premium tier. Calculate as many confidence intervals and margins of error as you like.