Home Math & Calculator Tools Confidence Interval Calculator
CI
Math

Confidence Interval Calculator

Calculate confidence intervals for means (z or t, auto-selected), proportions, or raw data. Shows margin of error, standard error, critical value, APA-style output, and a visual CI bar. Supports 80%, 90%, 95%, 99%, and custom confidence levels.

📊 Mean, proportion, raw data🔄 Auto z/t selection📋 APA-style output📈 Visual CI bar
Switch Tool:
🔒 100% Private — All calculations run in your browser. Nothing sent to any server.

📖 How to Use the Confidence Interval Calculator

  1. 1
    Choose your data type

    Select one of three modes: Mean (enter sample mean, SD, and n), Proportion (enter successes and trials or p̂), or Raw Data (paste comma-separated numbers and the tool computes everything). The calculator automatically selects z-distribution (σ known or n≥30) or t-distribution (σ unknown, small sample).

  2. 2
    Set confidence level and calculate

    Choose from 80%, 90%, 95%, 99%, or enter a custom level. The calculator shows the critical value (z* or t*), standard error, margin of error, and the full CI as [lower, upper]. APA-style reporting is included for academic use.

  3. 3
    Read the visual output

    A visual confidence interval bar plots the point estimate with the interval extending left and right. The width visually represents the margin of error. Hover over the bar to see exact values. Copy the result or the APA sentence with one click.

💡 Key Reference

Confidence Levelz* or t*(large n)
80%z* = 1.282
90%z* = 1.645
95%z* = 1.960
99%z* = 2.576

Frequently Asked Questions

What is a confidence interval?

A confidence interval (CI) is a range of values, computed from sample data, that is likely to contain the true population parameter. A 95% CI means that if you repeated the experiment 100 times, about 95 of the resulting intervals would contain the true value. It does NOT mean there is a 95% chance the true value is in this specific interval — the true value is either in it or not. The width of the CI depends on sample size (larger n = narrower), variability (higher SD = wider), and confidence level (higher % = wider).

When should I use z vs t distribution?

Use z-distribution when: (1) the population standard deviation σ is known, or (2) the sample size is large (n ≥ 30, by the Central Limit Theorem). Use t-distribution when: σ is unknown (estimated from sample) AND the sample size is small (n < 30). The t-distribution has heavier tails than the normal distribution, producing wider intervals for small samples — this conservatively accounts for greater uncertainty when estimating σ from limited data. This calculator selects automatically based on your inputs.

What is the margin of error?

The margin of error (ME) is half the width of the confidence interval: ME = critical value × standard error. It represents the maximum expected difference between the sample estimate and the true population value. In surveys, "margin of error ±3%" at 95% confidence means if you repeated the poll many times with different samples, 95% of the polls would have results within 3 percentage points of the true population proportion. Reducing ME requires a larger sample size.

What is standard error?

Standard error (SE) measures how much sample means (or proportions) vary from sample to sample. For means: SE = σ/√n (population SD known) or s/√n (sample SD). For proportions: SE = √(p̂(1−p̂)/n). The SE decreases as sample size increases — doubling the sample size reduces SE by a factor of √2 ≈ 1.41. Standard error is not the same as standard deviation: SD measures spread within a single sample; SE measures variability of estimates across repeated samples.

How do I interpret a confidence interval for a proportion?

If your CI is [0.42, 0.58] at 95%, it means your sample estimate is 0.50, and you are 95% confident the true population proportion lies between 42% and 58%. If the interval is wide (like [0.20, 0.80]), the estimate is imprecise — you need a larger sample. If the interval does not cross a specific value of interest (e.g., 0.50), that value is statistically distinguishable from your estimate at that confidence level.

What sample size gives a margin of error of ±3%?

For a proportion at 95% confidence with p̂ = 0.5 (maximum variance), n = (z*)² × p̂(1−p̂) / ME² = (1.96)² × 0.25 / (0.03)² ≈ 1068. For ±5%, n ≈ 384. For ±2%, n ≈ 2401. These are the standard sample sizes quoted in news polls. Using p̂ = 0.5 gives the most conservative (largest) required sample size because variance p(1−p) is maximised at p = 0.5.