Confidence Interval Calculator — Free, with Bell Curve & AI Insights
Trusted by students, researchers, and analysts, this confidence interval calculator turns a sample mean or proportion into a precise, defensible range in seconds.
Your sample data
Choose whether you're estimating a mean or a proportion, then enter your sample statistics.
What is a Confidence Interval?
A confidence interval is a range of values, calculated from sample data, that is likely to contain the true population parameter — such as a mean or proportion — at a stated confidence level like 95%.
Rather than reporting a single number (a "point estimate") and pretending it's exact, a confidence interval acknowledges that any sample is just one slice of a larger population and gives you a defensible range of plausible values along with a sense of how precise that range is. Here's how the calculation works, step by step:
- State your sample statistic. This is the sample mean (x̄) for continuous data, or the sample proportion (p̂) for yes/no data.
- Calculate the standard error (SE). For a mean, SE = s/√n. For a proportion, SE = √(p̂(1−p̂)/n).
- Choose a confidence level (commonly 90%, 95%, or 99%) — this determines how wide the interval needs to be.
- Find the critical value (z) that corresponds to your chosen confidence level (1.645, 1.96, or 2.576).
- Multiply the critical value by the standard error to get the margin of error.
- Add and subtract the margin of error from your sample statistic to get the lower and upper bounds of the interval.
How the Confidence Interval Calculator Works — The Formula
This calculator supports two common confidence interval formulas, depending on whether your data is a continuous measurement (a mean) or a yes/no proportion.
Mean: CI = x̄ ± z × (s / √n)
Proportion: CI = p̂ ± z × √(p̂(1−p̂) / n)
- x̄
- The sample mean — the average of your observed values.
- p̂
- The sample proportion — the fraction of your sample with a given characteristic, expressed as a decimal.
- s
- The sample standard deviation — how spread out your data values are.
- n
- The sample size — the number of observations you collected.
- z
- The critical value from the standard normal distribution corresponding to your confidence level.
- SE
- The standard error — a measure of how much the sample statistic is expected to vary from sample to sample.
Common z-values
| Confidence level | Critical value (z) |
|---|---|
| 90% | 1.645 |
| 95% | 1.96 |
| 99% | 2.576 |
Worked example
Suppose you sample 30 students and find a mean test score of x̄ = 100 with a sample standard deviation of s = 15. At 95% confidence:
SE = 15 / √30 ≈ 2.7386
Margin = 1.96 × 2.7386 ≈ 5.367
CI = 100 ± 5.367
The resulting interval is 94.63 to 105.37 — you can be 95% confident the true population mean test score lies somewhere in this range.
A 95% confidence interval does not mean "there's a 95% chance the true value falls in this specific range." The true population mean or proportion is a fixed number — it's either inside the interval or it isn't. The 95% describes the long-run reliability of the method: if you repeated the sampling process many times, about 95% of the resulting intervals would contain the true value. Another common mistake is using the z-distribution for small samples (n < 30) when the t-distribution would give a more accurate, slightly wider interval.
How to Use the Confidence Interval Calculator
- Choose your data type — select "Mean" if you have a continuous measurement (like test scores or weights), or "Proportion" if you have a yes/no or pass/fail rate.
- If you selected Mean, enter your sample mean (x̄) and sample standard deviation (s).
- If you selected Proportion, enter your sample proportion (p̂) as a percentage.
- Enter your sample size (n) — the number of observations or respondents in your sample.
- Choose your confidence level from the dropdown (90%, 95%, or 99%).
- Click Calculate to see your results instantly.
- Scroll to the AI Insights section to understand what your result means.
How to Interpret Your Confidence Interval Results
What a Good Result Looks Like
For survey research using proportions, a margin of error under 5% is generally considered tight and is the standard used by most national polls. For mean-based intervals, a useful rule of thumb is to compare the margin of error to the size of the mean itself — a margin under roughly 5-10% of the mean suggests a precise estimate, while a margin approaching or exceeding 20% of the mean suggests your sample may be too small or too variable to draw firm conclusions.
Warning Signs in Your Results
Watch for an interval that is very wide relative to your estimate — for example, a margin of error larger than the sample mean itself, which suggests the data is too noisy or the sample too small to support a precise conclusion. In mean mode, a sample size below 30 is a flag: the z-based interval shown here assumes a roughly normal sampling distribution, and with fewer than 30 observations a t-distribution interval (which is slightly wider) would be more appropriate. For proportions, be cautious if p̂ is very close to 0% or 100%, since the normal approximation becomes less reliable at the extremes.
How to Improve Your Result
The most direct way to narrow your interval is to increase your sample size (n) — because the margin of error shrinks proportionally to 1/√n, quadrupling your sample size roughly halves your margin of error. If you're measuring a mean, reducing variability in your data collection (more consistent measurement methods, more homogeneous subjects) lowers the sample standard deviation (s) and tightens the interval directly. Finally, your choice of confidence level is a trade-off: dropping from 99% to 95% or 90% narrows the interval, but means you're less certain the true value falls within it — choose the level appropriate for how much risk your decision can tolerate.
Confidence Interval Calculator Examples
Confidence Interval for Proportions
A marketing team surveys 400 customers and finds that 220 say they would recommend the product to a friend.
- Data type: Proportion
- Sample proportion (p̂): 55% (220 ÷ 400)
- Sample size (n): 400
- Confidence level: 95%
Result: 50.12% to 59.88%, a margin of error of about ±4.88%.
What this means: the team can be 95% confident that between roughly 50% and 60% of all customers — not just the 400 surveyed — would recommend the product.
What to do next: if a tighter estimate is needed for a board presentation, increase the sample size — quadrupling it to 1,600 respondents would roughly halve the margin of error to about ±2.4%.
Margin of Error Calculator
A pollster wants to know how precise their estimate is before publishing results from a sample of 1,000 likely voters, where 48% said they support a particular candidate.
- Data type: Proportion
- Sample proportion (p̂): 48%
- Sample size (n): 1000
- Confidence level: 95%
Result: margin of error ≈ ±3.10%, giving a confidence interval of roughly 44.9% to 51.1%.
What this means: the true level of support is likely somewhere between about 45% and 51% — close enough to 50% that the race could be considered a statistical toss-up.
What to do next: compare this margin against the gap between candidates. If the gap is smaller than the margin of error, the result is too close to call without a larger sample.
Confidence Interval for Two Means
A researcher measures the average reaction time of 25 participants after a treatment, getting a mean of 240 ms with a standard deviation of 35 ms, and wants a single-sample CI as a baseline before comparing to a control group.
- Data type: Mean
- Sample mean (x̄): 240
- Sample standard deviation (s): 35
- Sample size (n): 25
- Confidence level: 95%
Result: 225.28 to 254.72, with a margin of error of about ±14.72 ms.
What this means: with n = 25 (below 30), the AI insights will flag that a t-distribution interval would be slightly wider and more accurate than this z-based estimate.
What to do next: for a true two-sample comparison (e.g., treatment vs. control), the same logic extends to the difference of two means: you would compute each group's CI separately, or use a pooled standard error formula SE = √(s₁²/n₁ + s₂²/n₂) and apply the same z (or t) critical value to the difference x̄₁ − x̄₂. Run this calculator once per group to get a feel for each group's precision before combining them.
Frequently Asked Questions about the Confidence Interval Calculator
What does a 95% confidence interval mean?
It means that if you repeated your sampling process many times and built a confidence interval each time, about 95% of those intervals would contain the true population mean or proportion. It does not mean there is a 95% probability that this specific interval contains the true value — the true value either is or isn't inside it; the 95% describes the reliability of the method, not this one outcome.
How is CI different from a p-value?
A confidence interval gives a range of plausible values for a population parameter, along with a sense of precision (how wide the range is). A p-value, used in hypothesis testing, is a single number measuring how compatible your data is with a specific null hypothesis (e.g., "the true mean is 100"). CIs are often more informative because they show both the estimate and its uncertainty, while a p-value alone tells you only whether to reject a hypothesis at a chosen threshold like 0.05.
When should I use t vs z distribution?
Use the t-distribution when your sample size is small (commonly n < 30) and the population standard deviation is unknown — which describes most real-world samples. Use the z-distribution when the population standard deviation is known, or when n is large (typically n ≥ 30), because the t-distribution converges to the normal (z) distribution as sample size grows. This calculator uses z-values for simplicity; for small samples, a t-based interval would be slightly wider.
How accurate is this confidence interval calculator?
The math is exact for the standard z-based formulas: x̄ ± z·(s/√n) for means and p̂ ± z·√(p̂(1−p̂)/n) for proportions, using the standard critical values 1.645, 1.96, and 2.576 for 90%, 95%, and 99% confidence. Accuracy of the result as an estimate of the true population value depends on your data: a random, representative sample of at least 30 observations gives results that closely match more advanced t-based or exact methods.
What formula does this calculator use?
For a sample mean, it computes the standard error SE = s/√n, multiplies by the z-critical value for your chosen confidence level, and adds/subtracts that margin from the sample mean. For a sample proportion, it computes SE = √(p̂(1−p̂)/n), multiplies by the same z-value, and adds/subtracts the margin from p̂. Both are the standard large-sample (z-based) confidence interval formulas taught in introductory statistics.
How is this different from a margin-of-error-only calculator?
A margin-of-error-only tool gives you just the ± value (e.g., "±3.2%") without showing the full interval, the underlying standard error, or how the result changes at other confidence levels. This calculator shows the complete interval (lower and upper bounds), the margin of error, the critical z-value used, the standard error, a side-by-side comparison across 90/95/99% confidence, a bell-curve visualization, and AI-generated insights about what the result means and how to tighten it.
What happens with a very small sample size or a proportion near 0% or 100%?
With n below about 30, the z-based interval understates uncertainty — a t-distribution interval would be wider, so treat results from small samples as optimistic. For proportions very close to 0% or 100% (e.g., p̂ = 1% or 99%), the standard formula can produce an interval that dips below 0% or above 100%; this calculator computes the math as-is but caps the displayed bounds at 0% and 100% since a proportion cannot exist outside that range.
What are the limitations of this confidence interval calculator?
It assumes your sample was drawn randomly and is representative of the population — it cannot detect or correct for biased sampling, measurement error, or non-response bias. It also assumes the sampling distribution is approximately normal, which is reasonable for n ≥ 30 by the central limit theorem but less reliable for very small or highly skewed samples. For rigorous research, pair this tool with a t-distribution calculation for small samples and consult a statistician for complex survey designs.