BY: Statistics Fundamentals Team
Reviewed By: Minsa A (Senior Statistics Editor)

Free Confidence Interval Calculator (Z, T, and Proportion)

Calculate confidence intervals for means and proportions using z-intervals and t-intervals. Enter your sample data, choose a confidence level, and get the interval bounds, margin of error, critical value, and step-by-step workings — instantly, with no signup required.

Confidence Interval Calculator

Formula CI = x̄ ± z* × (σ / √n) Use When Population SD (σ) is known

Use this tab when you know the population standard deviation (σ). Common in textbook problems, quality control, and standardized testing scenarios where historical σ is established.

Average of your sample data
Known population standard deviation
Number of observations
Most common: 95%
Formula CI = x̄ ± t* × (s / √n) Degrees of Freedom df = n − 1

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.

Average of your sample
Calculated from your data
At least 2 required
Most common: 95%
Formula CI = p̂ ± z* × √(p̂(1 − p̂) / n) Use For Polls, surveys, A/B tests

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.

Count of positive outcomes
Total observations
Most common: 95%

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.

Key Sources: Neyman, J. (1937). Outline of a theory of statistical estimation based on the classical theory of probability. Philosophical Transactions of the Royal Society A, 236, 333–380. • NIST Engineering Statistics Handbook — Confidence IntervalsAmerican Statistical Association

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

Standard Error (SE) for each CI type
ParameterStandard Error FormulaWhen to Use
Mean (σ known)σ / √nPopulation SD is established
Mean (σ unknown)s / √nMost 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.

Z critical values for two-tailed confidence intervals. Source: NIST/SEMATECH e-Handbook of Statistical Methods.
Confidence LevelAlpha (α)z* Critical Valuet* (df=30)Practical Use
80%0.201.2821.310Low-stakes estimates
85%0.151.4401.476Exploratory research
90%0.101.6451.697Business analytics
95%0.051.9602.042Academic standard
99%0.012.5762.750Clinical trials, safety
99.9%0.0013.2913.385Pharmaceutical approvals

How to Calculate a Confidence Interval — Step by Step

How to calculate a 95% confidence interval for a mean:

1
Collect your sample data

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.

2
Choose your confidence level and critical value

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.

3
Calculate the standard error

SE = σ/√n (or s/√n if σ is unknown). Example: SE = 12/√36 = 12/6 = 2.00

4
Calculate the margin of error

ME = z* × SE. Example: ME = 1.96 × 2.00 = 3.92

5
Build the confidence interval

Lower bound = x̄ − ME = 72 − 3.92 = 68.08. Upper bound = x̄ + ME = 72 + 3.92 = 75.92. CI = (68.08, 75.92).

6
Interpret the result correctly

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.

C
Confidence Level
How certain you want to be — e.g., 95%. This controls the width of your interval.
L
Lower Bound
The smallest plausible value for the true population parameter given your sample.
E
Estimation
Your best guess is the sample mean or proportion — the center of the interval.
A
Accuracy
Narrower interval = more precise estimate. Achieved with larger n or smaller variance.
R
Range
The full interval from lower to upper bound — where the true value most likely lives.

📊 Worked Case Studies

Case Study 1 — Election Polling

Proportion CI • 95% Confidence • Z-Method

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.

p̂ = 520/1000 = 0.52    n = 1,000    z* = 1.96 SE = √(0.52 × 0.48 / 1000) = √(0.0002496) = 0.01580 ME = 1.96 × 0.01580 = 0.031 (3.1%) CI = (0.489, 0.551) = (48.9%, 55.1%)

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)

Mean CI (unknown σ) • 99% Confidence • T-Method

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.

x̄ = 8.5 mmHg    s = 6.4 mmHg    n = 64    df = 63 t* (df=63, 99%) ≈ 2.656 SE = 6.4 / √64 = 6.4 / 8 = 0.80 ME = 2.656 × 0.80 = 2.12 CI = (8.5 − 2.12, 8.5 + 2.12) = (6.38, 10.62) mmHg

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)

Two Proportion CIs • 95% Confidence • Z-Method

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.

Version A: p̂ = 0.30   SE = √(0.30×0.70/600) = 0.01871   CI = (26.3%, 33.7%) Version B: p̂ = 0.35   SE = √(0.35×0.65/600) = 0.01948   CI = (31.2%, 38.8%)

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)

Mean CI (unknown σ) • 95% Confidence • T-Method

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?

x̄ = 500.2g    s = 3.5g    n = 49    df = 48 t* (df=48, 95%) ≈ 2.011 SE = 3.5 / √49 = 3.5 / 7 = 0.500 ME = 2.011 × 0.500 = 1.01 CI = (499.19g, 501.21g)

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.

Margin of Error at varying sample sizes (σ = 10). Calculated using the Z-interval formula ME = z* × σ/√n.
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

FeatureConfidence IntervalMargin of Error
DefinitionFull range from lower to upper boundHalf the width of the CI (± amount)
Format(68.08, 75.92)±3.92
Tells youWhere the true value likely fallsHow much your estimate could be off
Common inAcademic research, clinical trialsPolling, surveys, media reporting
RelationshipCI = estimate ± MEME = 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.

TermSymbolDefinitionFormula
Confidence IntervalCIRange likely containing the true population parameterx̄ ± ME
Margin of ErrorMEMaximum expected difference between sample estimate and true valuez* × SE
Z-ScorezNumber of standard deviations from the mean(x − μ) / σ
T-ScoretLike z-score but used when σ is unknown(x̄ − μ) / (s/√n)
Standard ErrorSEStandard deviation of the sampling distribution of the meanσ/√n or s/√n
Sample MeanAverage of sample values; center of the CIΣx / n
Population ProportionpTrue proportion in the population (estimated by p̂)Estimated from sample
Sample ProportionObserved proportion in sample; center of proportion CIsuccesses / n
Confidence Level1−αProbability that the interval-building procedure captures the true valuee.g., 0.95 for 95%
Critical Valuez* or t*Value from the relevant distribution at desired confidence levelFrom z or t table
Degrees of FreedomdfUsed in t-distribution; accounts for estimation of σ from samplen − 1
Alpha LevelαProbability of a type I error; complement of confidence level1 − confidence level
Two-Tailed TestTests for difference in either direction; most CI calculationsα/2 in each tail
Point Estimatex̄ or p̂Single best guess for the population parameterCenter 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

Primary References for This Page:
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.