Confidence Interval Calculator
Use this tab when you know the population standard deviation (σ). Common in textbook problems, quality control, and standardized testing scenarios where historical σ is established.
Use this tab when the population standard deviation (σ) is unknown — which is the most common real-world situation. The t-distribution accounts for additional uncertainty from estimating σ with s.
Calculate a confidence interval for a population proportion. Enter the number of successes and the total sample size. Common for election polling, conversion rate analysis, and survey response rates.
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 an unknown population parameter at a specified level of certainty. For example, a 95% confidence interval means that if the same study were repeated 100 times under identical conditions, approximately 95 of the resulting intervals would capture the true population value. The interval is defined by a lower bound and an upper bound, separated by the margin of error.
The concept was formally developed by Jerzy Neyman in 1937, whose foundational framework remains the basis for modern frequentist interval estimation. According to the NIST Engineering Statistics Handbook, a confidence interval "provides an estimated range of values which is likely to include an unknown population parameter, the estimated range being calculated from a given set of sample data." The American Statistical Association defines confidence intervals as a core tool of statistical inference, noting their superiority over point estimates for communicating uncertainty in research findings.
Think of a confidence interval like a weather forecast range: "The high temperature tomorrow will be between 72°F and 78°F." The meteorologist is not giving a single answer — they are giving an honest range based on available data. The interval communicates both the best estimate and the inherent uncertainty around it. This is exactly what a confidence interval does in statistical research.
Confidence Interval Formulas
Formula for a Mean — Z-Interval (Known Population SD)
Use this formula when the population standard deviation (σ) is known — typically in textbook problems, quality control scenarios with established process parameters, or standardized tests with known variance.
Z-Interval Formula
CI = x̄ ± z* × (σ / √n)
Variable Definitions
x̄ = sample mean
z* = critical value (1.96 for 95%)
σ = population standard deviation
n = sample size
In plain English: the margin of error equals the critical value multiplied by the standard error (σ/√n). A larger sample or smaller spread produces a narrower, more precise interval. Doubling the sample size reduces the margin of error by a factor of √2 ≈ 1.41.
Formula for a Mean — T-Interval (Unknown Population SD)
Use this formula when the population standard deviation is unknown, which is almost always the case in practice. The t-distribution has heavier tails than the normal distribution, producing wider intervals to account for the added uncertainty of estimating σ with the sample standard deviation s.
T-Interval Formula
CI = x̄ ± t* × (s / √n)
Variable Definitions
t* = critical value (t-distribution)
s = sample standard deviation
df = degrees of freedom = n − 1
n = sample size
As sample size increases (n ≥ 30), the t-distribution approaches the normal distribution and the z-interval and t-interval produce nearly identical results. For small samples (n < 30), the t-interval is wider and more appropriate. According to OpenStax Introductory Statistics, "if the sample size is large (say, greater than 30), we can use the normal distribution instead of the t-distribution."
Formula for a Proportion — Z-Interval
Use for election polls, conversion rate analysis, survey response rates, and any situation where you are estimating a population proportion rather than a mean.
Proportion CI Formula
CI = p̂ ± z* × √(p̂(1−p̂)/n)
Variable Definitions
p̂ = sample proportion (x/n)
z* = critical value (1.96 for 95%)
n = sample size
x = number of successes
Standard Error Formulas — Quick Reference
| Parameter | Standard Error Formula | When to Use |
|---|---|---|
| Mean (σ known) | σ / √n | Population SD is established |
| Mean (σ unknown) | s / √n | Most real-world scenarios |
| Proportion | √(p̂(1−p̂)/n) | Polls, surveys, binary outcomes |
Common Confidence Levels and Critical Values
The critical value z* is determined by the confidence level and read from the standard normal distribution. Higher confidence levels require larger critical values, producing wider intervals. The table below shows z* for two-tailed confidence intervals, the most common type in applied statistics.
| Confidence Level | Alpha (α) | z* Critical Value | t* (df=30) | Practical Use |
|---|---|---|---|---|
| 80% | 0.20 | 1.282 | 1.310 | Low-stakes estimates |
| 85% | 0.15 | 1.440 | 1.476 | Exploratory research |
| 90% | 0.10 | 1.645 | 1.697 | Business analytics |
| 95% | 0.05 | 1.960 | 2.042 | Academic standard |
| 99% | 0.01 | 2.576 | 2.750 | Clinical trials, safety |
| 99.9% | 0.001 | 3.291 | 3.385 | Pharmaceutical approvals |
How to Calculate a Confidence Interval — Step by Step
How to calculate a 95% confidence interval for a mean:
Determine the sample size (n), sample mean (x̄), and standard deviation (s or σ). For a dataset of resting heart rates from 36 adults: n = 36, x̄ = 72 bpm, σ = 12 bpm.
Select 95% confidence and look up z* = 1.96 from the standard normal distribution. For 90%, use z* = 1.645; for 99%, use z* = 2.576.
SE = σ/√n (or s/√n if σ is unknown). Example: SE = 12/√36 = 12/6 = 2.00
ME = z* × SE. Example: ME = 1.96 × 2.00 = 3.92
Lower bound = x̄ − ME = 72 − 3.92 = 68.08. Upper bound = x̄ + ME = 72 + 3.92 = 75.92. CI = (68.08, 75.92).
We are 95% confident the true mean resting heart rate of the population lies between 68.08 and 75.92 bpm. (Not: "there is a 95% chance the mean is in this interval" — see the FAQ for the crucial distinction.)
🧠 The CLEAR Framework — Understanding Confidence Intervals Without Heavy Math
Many students understand the mechanics of calculating a confidence interval but struggle to explain what it actually means. The CLEAR Framework provides an intuitive structure for every component of a confidence interval, making it easy to explain and remember.
📊 Worked Case Studies
Case Study 1 — Election Polling
A political poll surveys 1,000 registered voters. 52% (520 respondents) support Candidate A. Calculate the 95% confidence interval for the true proportion of voters who support Candidate A.
Interpretation: The poll shows Candidate A leading with 52% support, but the margin of error of ±3.1% means the true proportion could fall anywhere between 48.9% and 55.1%. The race is statistically competitive.
Case Study 2 — Clinical Trial (Blood Pressure Drug)
A clinical trial tests a new blood pressure medication on 64 patients. The mean systolic reduction is 8.5 mmHg with a sample standard deviation of 6.4 mmHg. Calculate a 99% CI. This design follows the FDA's guidance on statistical reporting for clinical studies.
Interpretation: Researchers are 99% confident the drug reduces systolic blood pressure by between 6.38 and 10.62 mmHg on average in the target population — a clinically meaningful reduction.
Case Study 3 — A/B Testing (Conversion Rate)
Version A of a landing page converts 180 of 600 visitors (30%). Version B converts 210 of 600 visitors (35%). Calculate 95% CIs for each to compare.
Interpretation: The intervals barely overlap (around 31%–34%), suggesting Version B likely outperforms Version A. However, collecting more data would confirm statistical significance definitively.
Case Study 4 — Quality Control (Manufacturing)
A factory tests the weight of 49 cereal boxes. The sample mean is 500.2g with s = 3.5g. Does the production line meet the 500g specification?
Interpretation: Quality control can report with 95% confidence that the true mean box weight lies between 499.19g and 501.21g, confirming the 500g specification is within the plausible range.
📊 How Sample Size Affects Confidence Interval Width — Reference Dataset
One of the most practically important relationships in statistics is how sample size n affects confidence interval width. The table below shows the margin of error at varying sample sizes for a population with σ = 10, demonstrating that precision improves as the square root of n, not linearly.
| Sample Size (n) | 95% CI Width (±) | 90% CI Width (±) | 99% CI Width (±) |
|---|---|---|---|
| 10 | ±6.20 | ±5.19 | ±8.15 |
| 30 | ±3.58 | ±3.00 | ±4.70 |
| 100 | ±1.96 | ±1.64 | ±2.58 |
| 500 | ±0.88 | ±0.73 | ±1.15 |
| 1,000 | ±0.62 | ±0.52 | ±0.81 |
| 5,000 | ±0.28 | ±0.23 | ±0.36 |
Notice: going from n = 100 to n = 400 (a 4x increase) halves the margin of error from ±1.96 to ±0.98. This square-root relationship — described in all major statistics textbooks, including OpenStax Introductory Statistics — means that precision improvements become increasingly expensive as sample sizes grow large.
Confidence Interval vs. Margin of Error — Key Differences
| Feature | Confidence Interval | Margin of Error |
|---|---|---|
| Definition | Full range from lower to upper bound | Half the width of the CI (± amount) |
| Format | (68.08, 75.92) | ±3.92 |
| Tells you | Where the true value likely falls | How much your estimate could be off |
| Common in | Academic research, clinical trials | Polling, surveys, media reporting |
| Relationship | CI = estimate ± ME | ME = z* × SE |
When to Use Z vs. T — Decision Guide
Use Z-Interval When:
- Population standard deviation (σ) is known
- Estimating a proportion (p̂) — always use Z
- Large samples where Z and T converge (n ≥ 30)
- Standardized tests with established σ
Use T-Interval When:
- Population σ is unknown (most real-world cases)
- Small samples (n < 30) — T gives more accurate intervals
- Clinical trials with limited patient data
- You have a sample SD (s) but not a population SD (σ)
Entity & Formula Glossary
A complete reference for all statistical terms used in confidence interval analysis, formatted for quick lookup. Definitions align with NIST Statistical Methods and standard textbook usage.
| Term | Symbol | Definition | Formula |
|---|---|---|---|
| Confidence Interval | CI | Range likely containing the true population parameter | x̄ ± ME |
| Margin of Error | ME | Maximum expected difference between sample estimate and true value | z* × SE |
| Z-Score | z | Number of standard deviations from the mean | (x − μ) / σ |
| T-Score | t | Like z-score but used when σ is unknown | (x̄ − μ) / (s/√n) |
| Standard Error | SE | Standard deviation of the sampling distribution of the mean | σ/√n or s/√n |
| Sample Mean | x̄ | Average of sample values; center of the CI | Σx / n |
| Population Proportion | p | True proportion in the population (estimated by p̂) | Estimated from sample |
| Sample Proportion | p̂ | Observed proportion in sample; center of proportion CI | successes / n |
| Confidence Level | 1−α | Probability that the interval-building procedure captures the true value | e.g., 0.95 for 95% |
| Critical Value | z* or t* | Value from the relevant distribution at desired confidence level | From z or t table |
| Degrees of Freedom | df | Used in t-distribution; accounts for estimation of σ from sample | n − 1 |
| Alpha Level | α | Probability of a type I error; complement of confidence level | 1 − confidence level |
| Two-Tailed Test | — | Tests for difference in either direction; most CI calculations | α/2 in each tail |
| Point Estimate | x̄ or p̂ | Single best guess for the population parameter | Center of the CI |
Frequently Asked Questions
A confidence interval is a range of values, calculated from sample data, that is likely to contain the true value of an unknown population parameter at a specified confidence level. A 95% CI means: if you repeated the study 100 times and built a confidence interval each time, approximately 95 of those intervals would contain the true population value. The interval does not mean there is a 95% probability the true value is inside any specific interval — once calculated, the interval either contains the true value or it does not.
To calculate a 95% CI for a mean with known σ: (1) Collect sample data to find n, x̄, and σ. (2) Use critical value z* = 1.96 for 95% confidence. (3) Calculate standard error: SE = σ/√n. (4) Calculate margin of error: ME = 1.96 × SE. (5) Build the interval: CI = (x̄ − ME, x̄ + ME). If σ is unknown, substitute the sample SD s and use the t-distribution critical value instead of z* = 1.96.
No — this is the most common misconception about confidence intervals. The true population parameter is fixed; it either is or is not in any specific calculated interval. The 95% refers to the procedure, not the individual interval. If you repeated your study 100 times and built a confidence interval each time, approximately 95 of those intervals would contain the true value. Once you have a specific interval, there is no probability attached to it — it contains the true value or it does not.
Use a z-interval when the population standard deviation (σ) is known — this is common in textbook problems, quality control scenarios with established process parameters, and proportion estimation. Use a t-interval when σ is unknown, which is almost always the case in practice. With large samples (n ≥ 30), the t-distribution approaches the normal distribution and the two methods produce nearly identical results. Always use a z-interval for proportion confidence intervals.
Larger sample sizes produce narrower (more precise) confidence intervals. The margin of error equals z* × σ/√n, so increasing n shrinks the interval. Specifically: doubling n reduces the interval width by a factor of √2 ≈ 1.41; quadrupling n halves the interval width. This diminishing return means that going from n = 10 to n = 40 provides much more precision improvement than going from n = 1,000 to n = 4,000, even though both are a 4x increase in sample size.
The margin of error (ME) is half the width of a confidence interval — the ± value you see in polling results. It equals the critical value multiplied by the standard error: ME = z* × SE. For a 95% CI with SE = 2, the margin of error is 1.96 × 2 = 3.92, producing an interval of x̄ ± 3.92. In media reporting, "this poll has a margin of error of ±3 percentage points" means the 95% confidence interval extends 3 points in each direction from the reported estimate.
A confidence interval for a proportion uses the formula CI = p̂ ± z* × √(p̂(1−p̂)/n), where p̂ is the sample proportion (successes/n), z* is the critical value (1.96 for 95%), and n is the sample size. This is used for polling, survey response rates, conversion rate analysis, and any binary outcome. The formula assumes a large enough sample that both np̂ and n(1−p̂) are at least 5, ensuring the sampling distribution is approximately normal.
The confidence level (e.g., 95%) is the chosen probability that describes the long-run performance of the interval-building procedure — it is an input you select before calculating. The confidence interval is the output: the specific range of values produced by applying that procedure to your sample data. A higher confidence level produces wider intervals because more certainty requires a larger net to reliably capture the true value across repeated sampling.
A confidence interval tells you: (1) the most plausible range of values for an unknown population parameter based on your sample data; (2) the precision of your estimate — narrower intervals indicate more precise estimation; and (3) the direction and magnitude of an effect in applied research. In clinical trials, a CI that excludes zero indicates a statistically significant effect. In polling, a CI that excludes 50% indicates a clear leader. CIs communicate far more information than p-values alone, which is why the American Statistical Association recommends their use as a primary reporting tool.
Yes — a specific confidence interval can fail to contain the true value. At 95% confidence, approximately 5% of all calculated intervals will not contain the true population parameter. This is expected and acceptable — it is the meaning of α = 0.05. An interval can also be misleading if the underlying assumptions are violated: the sample must be random, the population approximately normal (or n large enough for the Central Limit Theorem to apply), and observations must be independent. Convenience samples, non-random selection, or correlated observations can produce intervals that are technically calculated correctly but statistically invalid.
Related Calculators & Tools on Statistics Fundamentals
• NIST/SEMATECH e-Handbook of Statistical Methods — Confidence Intervals
• OpenStax Introductory Statistics, Chapter 8: Confidence Intervals (open access)
• FDA Statistical Guidance for Clinical Studies
• Devore, J. L. (2015). Probability and Statistics for Engineering and the Sciences, 9th ed. Cengage Learning.
• Moore, D. S., McCabe, G. P., & Craig, B. A. (2017). Introduction to the Practice of Statistics, 9th ed. W. H. Freeman.
• Neyman, J. (1937). Outline of a theory of statistical estimation. Philosophical Transactions of the Royal Society A, 236, 333–380.