MaximCalculator Free, fun & accurate calculators
📈 Platinum stats layout
🌙Dark Mode

Confidence Interval Calculator

Build a confidence interval (CI) for a mean or a proportion in seconds. Pick a confidence level (90%, 95%, 98%, or 99%), enter your sample stats, and get the interval, margin of error, and a clear explanation you can screenshot or paste into a report. Everything runs in your browser (no signup).

Instant CI + margin of error
🧮Mean (z or t) + Proportion (z)
🧠Shows critical value + standard error
📱Made for sharing & screenshots

Enter your sample information

Choose what you’re estimating (mean or proportion). This calculator supports the most common intro stats setups: z-interval for a mean (when population σ is known), t-interval for a mean (when σ is unknown and you use sample s), and z-interval for a proportion (using successes and sample size).

🧩
🎯
📦
📍
📉
Your confidence interval will appear here
Choose an interval type, enter your sample values, and click “Calculate Confidence Interval”.
Tip: a confidence interval is reported as “estimate ± margin of error” (or as a lower and upper bound).
Confidence level “tightness”: 90% is narrower · 95% standard · 99% widest.
90%95%99%

Educational tool only. A confidence interval requires assumptions (random sample, independence, model fit). If you’re doing research or high-stakes decisions, consult a statistician.

📚 Deep explanation

What is a confidence interval?

A confidence interval (CI) is a range of values you compute from a sample that is intended to capture an unknown population parameter, such as a true mean (μ) or a true proportion (p). It is one of the most practical ideas in statistics because it turns a single “best guess” into a range that reflects real-world uncertainty. When people say “statistics is about uncertainty,” confidence intervals are a big part of what they mean.

Here’s the intuition: if you sample 36 people and measure their sleep hours, your sample mean won’t equal the true population mean perfectly. It will be close, but it will wiggle around depending on who you happened to sample. A confidence interval builds a buffer around your estimate based on how much wiggle you expect. That buffer is the margin of error.

Most confidence intervals have the same basic shape: estimate ± (critical value) × (standard error). The estimate is something like x̄ (sample mean) or p̂ (sample proportion). The standard error is the typical size of sampling fluctuations. The critical value is how “wide” you want your safety net to be. A 99% interval is wider than a 95% interval because it aims to catch the true value more often.

The 3 steps (works for almost every CI)
  • 1) Pick a confidence level: common choices are 90%, 95%, 98%, or 99%.
  • 2) Compute the standard error: it depends on what you’re estimating (mean vs proportion).
  • 3) Multiply by the critical value: margin of error = critical × SE, then build the interval.
Why does the confidence level change the width?

Imagine throwing a net to catch a moving fish. If you want to catch the fish more often, you make the net bigger. In CIs, “bigger net” means a larger critical value. For a normal curve, about 95% of values are within 1.96 standard deviations of the mean, but about 99% are within 2.576 standard deviations. That extra width is the price you pay for higher confidence.

Confidence vs probability (the honest wording)

The true mean (μ) is not random in classical statistics—it’s a fixed number you don’t know. The interval is random because your sample is random. So we don’t say “95% chance μ is in this specific interval.” We say: “Using this method, 95% of intervals built from repeated samples would contain μ.” In everyday speech, many people still say the first version. If you’re writing for a stats class or a paper, use the second.

🧮 Formula breakdown

Formulas this calculator uses

This page supports three common confidence intervals. Pick the one that matches your situation. (If you’re unsure: for a mean, use the t-interval when σ is unknown; for a proportion, use the z-interval.)

A) Mean, σ known → z interval
  • Estimate:
  • Standard error: SE = σ / √n
  • Critical value: z* (depends on confidence level)
  • Margin of error: ME = z* × σ / √n
  • CI: x̄ ± ME
B) Mean, σ unknown → t interval
  • Estimate:
  • Standard error: SE = s / √n
  • Degrees of freedom: df = n − 1
  • Critical value: t* (depends on df and confidence level)
  • Margin of error: ME = t* × s / √n
  • CI: x̄ ± ME
C) Proportion → z interval
  • Estimate: p̂ = x / n (successes divided by sample size)
  • Standard error: SE = √( p̂(1 − p̂) / n )
  • Critical value: z*
  • Margin of error: ME = z* × √( p̂(1 − p̂) / n )
  • CI: p̂ ± ME (often reported as a percentage)
What are z* and t*?

The “*” just means “critical.” For z*, we use the standard normal distribution. For t*, we use Student’s t distribution, which is a bit wider (heavier tails) when sample sizes are small. As n grows, t* approaches z*. That’s why big samples make the mean interval narrower even if your confidence level stays the same: your SE shrinks because √n grows.

🧪 Worked examples

Examples you can copy

Example 1: t-interval for a mean (σ unknown)

Suppose you sampled n = 36 students and measured exam scores. You got a sample mean of x̄ = 72.4 and a sample standard deviation of s = 8.1. Build a 95% CI for the true mean.

  • Confidence = 95% ⇒ use t* with df = n − 1 = 35.
  • SE = s / √n = 8.1 / √36 = 8.1 / 6 = 1.35.
  • t* ≈ 2.030 (df=35).
  • ME = t* × SE ≈ 2.030 × 1.35 ≈ 2.74.
  • CI = 72.4 ± 2.74 ⇒ (69.66, 75.14).

Interpretation: “We are 95% confident the true average exam score lies between about 69.7 and 75.1.”

Example 2: z-interval for a proportion

A poll asks whether people support a proposal. Out of n = 200 respondents, x = 116 say “yes.” Find a 95% CI for the true support proportion.

  • p̂ = x/n = 116/200 = 0.58.
  • SE = √(p̂(1−p̂)/n) = √(0.58×0.42/200) ≈ √(0.001218) ≈ 0.0349.
  • z* = 1.96 for 95%.
  • ME = 1.96 × 0.0349 ≈ 0.0684.
  • CI = 0.58 ± 0.0684 ⇒ (0.5116, 0.6484) ⇒ (51.2%, 64.8%).

Interpretation: “We are 95% confident the true support rate is between 51% and 65%.” The interval is fairly wide because polls are noisy — the standard error reflects that.

Example 3: what happens if you change confidence?

Keep the same exam-score sample as Example 1, but change the confidence level. A 90% CI uses a smaller critical value, so the interval is narrower. A 99% CI uses a larger critical value, so the interval is wider. That’s the tradeoff: higher confidence → wider interval (larger margin of error).

✅ Assumptions

When a confidence interval is valid

Confidence intervals are powerful, but they are not magic. The formulas assume the sample represents the population in a reasonable way. If you violate the assumptions, the interval might be too narrow (overconfident) or misleading.

Mean intervals (z or t)
  • Random sampling (or random assignment) is ideal.
  • Independence: one observation doesn’t determine another.
  • Approx. normality: the sampling distribution of x̄ should be roughly normal. This is often okay if n is large (CLT) or if the population is not extremely skewed.
Proportion interval
  • Random sample + independence.
  • Success-failure condition: n·p̂ ≥ 10 and n·(1−p̂) ≥ 10 is a common rule of thumb.

If your class uses different cutoffs (like 5 instead of 10), follow your instructor’s rule. The math idea is the same: we want the normal approximation to behave.

❓ FAQ

Frequently Asked Questions

  • What does “95% confident” mean in plain English?

    It means your method is calibrated so that, in the long run, about 95% of the intervals you build would contain the true population value. It is confidence in the process that generated the interval.

  • Why do I use t instead of z when σ is unknown?

    When σ is unknown, you estimate variability using the sample standard deviation s. That adds uncertainty. The t distribution accounts for that by having heavier tails (bigger critical values for small n). As n increases, t and z become nearly the same.

  • Can a confidence interval be outside “possible” values?

    For proportions, yes — a simple z-interval can sometimes dip below 0 or above 1 (especially with small samples). In practice you might clamp it to [0,1] or use a different method (Wilson interval). This calculator shows the standard intro-stats z-interval because it’s the most commonly taught.

  • How do I make the interval narrower?

    Three big levers: (1) increase your sample size n, (2) reduce variability (smaller s or more consistent measurements), or (3) choose a lower confidence level (90% instead of 95%). Most of the time, the honest answer is: collect more data.

  • Is margin of error the same as standard error?

    Not exactly. Standard error is the typical sampling variability (e.g., s/√n). Margin of error multiplies that variability by a critical value, so it includes both the uncertainty from sampling and the “coverage goal” from your confidence level.

  • What if my class uses a different confidence level (like 92%)?

    This calculator focuses on the most common confidence levels for speed and shareability. If you need an unusual confidence level, you can still use the “idea”: estimate ± (critical value) × SE. (A future version can add a custom confidence slider.)

  • Does a 99% confidence interval mean the estimate is “more accurate”?

    Higher confidence means wider intervals, not a magically better sample. Your sample quality and design matter most. A biased sample can produce a very “confident” interval that is confidently wrong.

MaximCalculator provides simple, user-friendly tools. Always treat results as educational and double-check any important numbers elsewhere.