Confidence Interval Calculator

Calculate confidence intervals for population means. Determine the range likely to contain the true population parameter.

%

Quick Reference

90% Confidence
Z = 1.645
10% chance CI misses true mean
95% Confidence
Z = 1.96
Most commonly used level
99% Confidence
Z = 2.576
Widest interval, most certain

Your Results

Calculated
Confidence Interval
--
Lower to Upper bound
Margin of Error
--
+/- from the mean
Standard Error
--
SD / sqrt(n)

Visual Representation

-- Mean: -- --

Frequently Asked Questions

When should I use a t-distribution instead of z-distribution?

Use the t-distribution when: (1) your sample size is small (typically n less than 30), and (2) the population standard deviation is unknown (you're using the sample standard deviation). For large samples (n greater than 30), the t and z distributions are nearly identical, so either works.

What sample size do I need for a specific margin of error?

Rearranging the formula: n = (z * s / E)^2, where E is your desired margin of error. For example, for a 95% CI with standard deviation 10 and margin of error 2: n = (1.96 * 10 / 2)^2 = 96.04, so you need at least 97 samples.

Can a confidence interval be negative?

Yes, confidence intervals can include negative values if the mean is close to zero relative to the margin of error. This often happens with difference-in-means tests or when measuring changes that could go either direction.

What's the difference between confidence interval and prediction interval?

A confidence interval estimates where the population mean lies. A prediction interval estimates where a single new observation will fall. Prediction intervals are always wider because they account for both uncertainty about the mean AND the natural variability of individual observations.

Why is 95% the most common confidence level?

95% is a convention that provides a good balance between precision and reliability. It corresponds to the widely-used p less than 0.05 significance level in hypothesis testing. However, the "right" confidence level depends on your context - medical studies often use 99% while preliminary research might use 90%.

What does a confidence interval mean?
A confidence interval (CI) is a range of values that is likely to contain a true population parameter (like the population mean or proportion) with a specified level of confidence. Correct interpretation: if we were to repeat the sampling process many times and calculate a 95% CI each time, approximately 95% of those intervals would contain the true population parameter. What it does NOT mean: a 95% CI does NOT mean: "there is a 95% probability that the true value is in this specific interval." "The true value is somewhere in this interval." (It either is or it isn't — we just don't know.) Once a specific CI has been calculated, the true value is either in the interval or it isn't — the "95%" refers to the long-run frequency of the procedure, not a probability statement about this specific interval. Practical interpretation: for communication purposes, saying "we are 95% confident that the true population mean is between 42 and 58" is an acceptable shorthand — just understand what it technically means. Example: a poll finds 52% of voters prefer Candidate A, with a 95% CI of [48%, 56%]. This means: the methodology used to create this interval will contain the true population percentage 95% of the time in repeated sampling. We cannot rule out 48–56% as plausible values for the true preference. Candidate A's lead is not statistically certain (the CI includes 50%). Key components of a CI: point estimate (the center): the sample statistic (mean, proportion). Margin of error: z* × SE. Confidence level: 95% is convention; 90% or 99% are also used. Width of the interval: wider = less precise. Narrower = more precise. Wider CIs result from: smaller sample size. Higher variability in the data. Higher confidence level (99% CI is wider than 95% CI for same data).
What is the difference between confidence interval and margin of error?
The margin of error (MOE) and confidence interval (CI) are closely related but refer to different things. Definitions: margin of error: the ± range added and subtracted from the point estimate to create the CI. MOE = z* × SE = z* × (σ/√n). Confidence interval: the full range from (estimate − MOE) to (estimate + MOE). Relationship: CI = point estimate ± margin of error. Example: a survey of 1,000 people finds 55% support a policy. Standard error: SE = √(0.55 × 0.45 / 1000) = √(0.0002475) = 0.01573. Margin of error (95%): 1.96 × 0.01573 = 0.0308 = ±3.1%. Confidence interval: 55% ± 3.1% = [51.9%, 58.1%]. In news media: the "margin of error" in political polling is the MOE for a proportion at 95% confidence. "±3 points" means a confidence interval of 6 percentage points wide. For a sample size of 1,000 at 95% CI: MOE ≈ 1.96 × √(0.25/1000) ≈ ±3.1% (at p=0.5, worst case). How MOE changes with sample size: n = 500 → MOE ≈ ±4.4%. n = 1,000 → MOE ≈ ±3.1%. n = 2,000 → MOE ≈ ±2.2%. n = 10,000 → MOE ≈ ±1.0%. Key insight: to halve the margin of error, you must quadruple the sample size (because MOE ∝ 1/√n). When interpreting CIs: the interval is symmetric around the point estimate (assuming normal approximation). Width = 2 × MOE. A wide CI = high uncertainty; a narrow CI = high precision.
How does sample size affect confidence intervals?
Sample size is the most controllable factor that determines the width (precision) of a confidence interval. The mathematical relationship: margin of error = z* × (σ / √n). MOE is inversely proportional to √n. Doubling sample size reduces MOE by a factor of √2 ≈ 1.41 (29% reduction). Quadrupling sample size reduces MOE by half. This means that improving precision becomes increasingly expensive as sample size grows. Required sample size formula: to achieve a desired margin of error (MOE) at a given confidence level: n = (z* × σ / MOE)². For proportions: n = z*² × p̂(1−p̂) / MOE². Example — polling: target MOE: ±3% at 95% confidence (z* = 1.96). Assume p̂ = 0.5 (worst case). n = (1.96)² × 0.5 × 0.5 / (0.03)² = 3.8416 × 0.25 / 0.0009 = 0.9604 / 0.0009 ≈ 1,067. Round up: need at least 1,067 respondents. Diminishing returns example (95% CI, σ=1): n=100 → MOE = ±0.196. n=400 → MOE = ±0.098 (half the MOE at 4× the cost). n=1,600 → MOE = ±0.049 (quarter the MOE at 16× the cost). n=10,000 → MOE = ±0.020 (10% of original MOE at 100× the cost). Practical sample size guidance: for most business and social research: n = 300–1,000 gives adequate precision. National polling: n = 1,000–1,500 is standard (±3% MOE). High-precision scientific research: n = 1,000–10,000+ depending on effect size. Medical trials: sample size determined by power analysis (effect size, significance level, desired power).
When should I use a t-distribution instead of a z-distribution?
The choice between t-distribution and z-distribution depends on whether you know the population standard deviation and your sample size. Use z-distribution (normal distribution) when: you know the population standard deviation (σ). This is rare in practice — usually σ is unknown. Your sample size is very large (n > 100) and you're using the sample standard deviation s as an estimate. For proportions (using √(p̂(1−p̂)/n) as the standard error) with large samples. Use t-distribution when: you don't know σ (the typical case for most research). You're working with a relatively small sample (n < 100, though the rule varies by context). You're comparing means of two groups. Almost all real-world CI calculations for means should use the t-distribution. Why the t-distribution is different: the t-distribution is bell-shaped like the normal distribution but has heavier tails. The degrees of freedom (df = n − 1) control how much heavier the tails are. With small samples, the heavier tails produce wider CIs (more uncertainty). As n increases, t* approaches z* — with n = 120+, the difference is less than 1%. Critical values comparison (95% CI): n=10 (df=9): t* = 2.262 vs z* = 1.960. n=20 (df=19): t* = 2.093 vs z* = 1.960. n=30 (df=29): t* = 2.045 vs z* = 1.960. n=100 (df=99): t* = 1.984 vs z* = 1.960. n=∞: t* = z* = 1.960. Practical implication: for n ≥ 30, using z instead of t is often acceptable (the difference in the final interval is small). For n < 30, always use t. Most statistical software uses the t-distribution by default for mean-based CIs, which is the safer and more correct choice.
Does a 95% confidence interval mean there's a 95% chance the true mean is inside it?
No — that's the most common misinterpretation of confidence intervals. The correct reading is: if you repeated your sampling process many times and built a CI each time, about 95% of those intervals would contain the true population mean. Any single interval you calculate either does or doesn't contain the true value — you just don't know which, since the true mean is a fixed (if unknown) number, not a random variable.
Why did my confidence interval get wider when I increased the confidence level?
That's expected, not a bug. Going from 90% to 99% confidence means you want to be more certain the interval captures the true mean, and the only way to increase certainty with the same data is to cast a wider net — the z-score jumps from 1.645 to 2.576. Higher confidence always trades away precision.
How much does sample size actually matter here?
A lot — standard error scales with 1/√n, so quadrupling your sample size only halves your margin of error, not quarters it. Going from n=25 to n=100 tightens your interval noticeably; going from n=100 to n=400 gives the same proportional tightening but requires 4x more data. Diminishing returns set in fast.

Key Takeaways

  • A confidence interval gives a range likely to contain the true population parameter
  • 95% confidence means if you repeated the sampling 100 times, ~95 intervals would contain the true mean
  • Larger sample sizes produce narrower (more precise) confidence intervals
  • Higher confidence levels produce wider intervals (trading precision for certainty)
  • The margin of error equals z-score times standard error

What Is a Confidence Interval?

Critical Z-Values for Common Confidence Levels Reference
Confidence Level Alpha (α) Z-score (z*) Notes
80%0.201.282Less common; wider intervals sacrificed for smaller sample
85%0.151.440Rarely used in formal research
90%0.101.645Common in business and industry
95%0.051.960Most common in scientific literature
99%0.012.576High-stakes research; medical, pharmaceutical
99.5%0.0052.807Rarely used; very conservative
99.9%0.0013.291Extreme caution; particle physics standard
Note: Z-score is the number of standard deviations from the mean in a standard normal distribution. For a 95% CI, α = 0.05, so α/2 = 0.025 — we use z* = 1.96 (the value where 97.5% of the normal curve falls below, leaving 2.5% in each tail).
Sample Size vs Margin of Error Reference (95% CI, σ=1)
Sample Size (n) Margin of Error Notes
30±0.356Small sample; wide margin
50±0.277
100±0.196Common minimum for many studies
200±0.138Meaningful improvement; diminishing returns begin
500±0.088Solid precision for many applications
1,000±0.062Polling standard; ≈ ±3% for proportions
2,000±0.044Large survey; national polling level
5,000±0.028Very high precision; scientific study
10,000±0.020Diminishing returns; rarely worth cost
Note: ME = z* × (σ/√n) = 1.96 × (1/√n). Halving the margin of error requires quadrupling the sample size. For proportion estimates (p̂), σ is replaced with √(p̂(1−p̂)), which is maximized at p̂ = 0.5 (σ_max ≈ 0.5).
Confidence Interval Formulas Reference
Scenario Formula When to Use Notes
Mean (σ known)x̄ ± z* × (σ/√n)Large sample; population σ knownUse Z-distribution; σ = population standard deviation
Mean (σ unknown)x̄ ± t* × (s/√n)Any sample; σ unknown (typical)Use t-distribution; df = n−1; s = sample standard deviation
Proportionp̂ ± z* × √(p̂(1−p̂)/n)Binary outcomes (yes/no, success/fail)Requires np̂ ≥ 10 and n(1−p̂) ≥ 10
Difference of means(x̄₁−x̄₂) ± t* × SEComparing two group meansSE = pooled or Welch standard error
Note: The t-distribution approaches the Z-distribution as sample size increases (t* ≈ z* for n > 100). For proportions near 0 or 1 (rare events), use Wilson interval or exact binomial CI instead of the standard normal approximation.

A confidence interval (CI) is a range of values that is likely to contain an unknown population parameter. Instead of estimating the parameter by a single value, an interval is given along with a confidence level that specifies how certain we are that the parameter lies within the interval.

For example, if you calculate a 95% confidence interval for the mean height of adult males and get [5'8", 5'11"], you can say: "We are 95% confident that the true average height of adult males in the population falls between 5'8" and 5'11"."

The Confidence Interval Formula

CI = x +/- z * (s / sqrt(n))
x = Sample Mean
z = Z-score (critical value)
s = Standard Deviation
n = Sample Size
s/sqrt(n) = Standard Error

Z-Score Reference Table

Confidence Level Z-Score Alpha (a)
80% 1.282 0.20
90% 1.645 0.10
95% 1.960 0.05
99% 2.576 0.01
99.9% 3.291 0.001

How to Interpret Confidence Intervals

A common misconception is that a 95% confidence interval means there's a 95% probability that the true parameter is within that specific interval. The correct interpretation is:

  • If we repeated our sampling procedure many times and calculated a 95% CI each time, approximately 95% of those intervals would contain the true population parameter.
  • Any single interval either contains the true value or it doesn't - we just don't know which case applies.
  • The 95% refers to the reliability of the method, not the probability for any single interval.

Factors That Affect Confidence Interval Width

1. Sample Size (n)

Larger sample = Narrower interval. Doubling your sample size reduces the margin of error by about 30% (dividing by sqrt(2)). This is why larger studies provide more precise estimates.

2. Confidence Level

Higher confidence = Wider interval. A 99% CI is wider than a 95% CI because we need a larger range to be more certain we've captured the true value.

3. Standard Deviation

Higher variability = Wider interval. When data is more spread out, there's more uncertainty about where the true mean lies.

What sample size do I need for reliable results?
It depends on the desired confidence level, margin of error, and population variance. For a typical survey (95% confidence, ±5% margin), n ≈ 385 for a large population. Smaller samples are fine for exploratory analysis, but don't over-interpret the results — widen your confidence intervals to reflect the uncertainty.