Skip to main content

Confidence Interval Calculator

Build a confidence interval for a mean (z or t), a proportion, or straight from a raw data list — with a shaded normal/t-curve diagram, an interval visual, and full step-by-step working.

Background

A confidence interval gives a range of plausible values for a population parameter based on sample data. A larger sample size narrows the interval; a higher confidence level widens it — because reaching a higher confidence requires a larger critical value, and a larger critical value means more margin of error.


🔎 Looking for how large a sample you need to collect, rather than the interval from a sample you already have? That's a related but different calculation — see our Sample Size Calculator.

Set up your interval

Step 1 — What are you building a CI for?

Step 2 — Enter your sample data

Separate values with commas, spaces, or line breaks.

Use this mode only when the population standard deviation σ is actually known — that's uncommon outside textbook problems.

Learning options

Result

No result yet. Set up your sample data above and click Calculate.

How to use this calculator

  • Choose Mean, σ known only if the population standard deviation is explicitly given — otherwise use Mean, σ unknown, which uses a t-interval instead.
  • Choose Proportion to enter either a sample proportion directly, or successes and trials to have it computed for you.
  • Choose Raw Data to paste a full dataset — the calculator computes n, the mean, and the sample standard deviation automatically.
  • Click Calculate to see the interval, a shaded critical-region diagram, an interval visual, and full step-by-step working.

How confidence intervals work

1

Every confidence interval has the same shape: estimate ± (critical value) × (standard error).

2

A higher confidence level pushes the critical value further into the tails of the distribution, which widens the margin of error.

3

Use a z-critical value when the population standard deviation is known; use a t-critical value (which depends on degrees of freedom) when it's estimated from the sample.

4

As degrees of freedom increase, the t-distribution gets closer to the normal distribution — which is why the t-table's last row is essentially the z-value.

5

"95% confidence" describes the method, not this one interval — it means that if you repeated the sampling many times, about 95% of the resulting intervals would contain the true population value.

Formula & Equations Used

Mean, σ known: x̄ ± z* · (σ/√n)

Mean, σ unknown: x̄ ± t* · (s/√n), with df = n − 1

Proportion: p̂ ± z* · √(p̂(1−p̂)/n)

Sample standard deviation: s = √(Σ(x−x̄)² / (n−1))

Example Problems & Step-by-Step Solutions

These cover cases the Quick Examples chips above don't already demonstrate.

Example 1 — Mean, σ known

A sample of n=49 has x̄=64, drawn from a population with known σ=8. Build a 90% CI.

Step: z* ≈ 1.645. SE = 8/√49 = 1.143. ME = 1.645 × 1.143 = 1.880.

Result: 90% CI = (62.12, 65.88).

Example 2 — Mean, σ unknown

A sample of n=20 has x̄=50, s=6. Build a 95% CI (σ unknown, so this needs a t-interval).

Step: df=19, t* ≈ 2.093. SE = 6/√20 = 1.342. ME = 2.093 × 1.342 = 2.808.

Result: 95% CI = (47.19, 52.81).

Example 3 — Proportion

A poll of 150 people finds p̂=0.65 support a measure. Build a 98% CI.

Step: Check n·p̂=97.5 and n·(1−p̂)=52.5 — both ≥10, so the interval is reliable. z*≈2.326, SE=0.039, ME=0.091.

Result: 98% CI = (0.559, 0.741).

Example 4 — Raw data

Build a 95% CI for the mean from the dataset 12, 15, 11, 18, 20, 14.

Step: n=6, x̄=15, s≈3.464, df=5, t*≈2.571. SE=1.414, ME=3.636.

Result: 95% CI = (11.36, 18.64).

Frequently Asked Questions

Why does a 99% CI look wider than a 95% CI?

Because higher confidence requires a larger critical value, and a larger critical value directly increases the margin of error — there's no way to get more confidence without paying for it in interval width, unless you also increase the sample size.

When do I use a t-interval instead of a z-interval?

Use a t-interval for a mean whenever the population standard deviation is unknown and you're using the sample standard deviation as an estimate — which describes the vast majority of real studies.

Does a 95% CI mean there's a 95% chance the true value is in this specific interval?

Not quite. It means the method used would capture the true population value in about 95% of intervals built this way across many repeated samples — this specific interval either contains the true value or it doesn't.

I need the sample size for my study, not a confidence interval — is this the right tool?

Not quite — this calculator builds an interval from a sample you already have. To find how large a sample to collect for a target margin of error, use our Sample Size Calculator instead, which rearranges the same formulas to solve for n.

Mean
3. Describing Data Numerically
4 problems
Topic
Ernest
Standard Deviation
3. Describing Data Numerically
7 problems
Topic
Jonathan
Standard Normal Distribution
6. Normal Distribution and Continuous Random Variables
7 problems
Topic
Laura
Sampling Distribution of the Sample Mean and Central Limit Theorem
7. Sampling Distributions & Confidence Intervals: Mean
5 problems
Topic
Brendan
Confidence Intervals for Population Mean
7. Sampling Distributions & Confidence Intervals: Mean
7 problems
Topic
Justin
Determining the Minimum Sample Size Required
7. Sampling Distributions & Confidence Intervals: Mean
5 problems
Topic
Zachary
Sampling Distribution of Sample Proportion
8. Sampling Distributions & Confidence Intervals: Proportion
5 problems
Topic
Brendan
Confidence Intervals for Population Proportion
8. Sampling Distributions & Confidence Intervals: Proportion
7 problems
Topic
Ernest
Introduction to Confidence Intervals
7. Sampling Distributions & Confidence Intervals: Mean
6 problems
Topic
Ernest
3. Describing Data Numerically - Part 1 of 2
5 topics 15 problems
Chapter
David-Paige
3. Describing Data Numerically - Part 2 of 2
3 topics 8 problems
Chapter
Jonathan
6. Normal Distribution and Continuous Random Variables
4 topics 12 problems
Chapter
Justin
7. Sampling Distributions & Confidence Intervals: Mean
4 topics 12 problems
Chapter
Ally
8. Sampling Distributions & Confidence Intervals: Proportion
4 topics 11 problems
Chapter
Ernest
Confidence Intervals
4 & 5. Statistics, Quality Assurance and Calibration Methods
5 problems
Topic
4 & 5. Statistics, Quality Assurance and Calibration Methods - Part 1 of 2
4 topics 12 problems
Chapter
4 & 5. Statistics, Quality Assurance and Calibration Methods - Part 2 of 2
2 topics 6 problems
Chapter
Mean
3. Describing Data Numerically
10 problems
Topic
Brendan
Standard Deviation
3. Describing Data Numerically
10 problems
Topic
Jonathan
Standard Normal Distribution
6. Normal Distribution & Continuous Random Variables
10 problems
Topic
Ernest
Sampling Distribution of the Sample Mean and Central Limit Theorem
7. Sampling Distributions & Confidence Intervals: Mean
10 problems
Topic
David-Paige
Confidence Intervals for Population Mean
7. Sampling Distributions & Confidence Intervals: Mean
10 problems
Topic
Laura
Determining the Minimum Sample Size Required
7. Sampling Distributions & Confidence Intervals: Mean
5 problems
Topic
Ernest
Sampling Distribution of Sample Proportion
8. Sampling Distributions & Confidence Intervals: Proportion
10 problems
Topic
David-Paige
Confidence Intervals for Population Proportion
8. Sampling Distributions & Confidence Intervals: Proportion
10 problems
Topic
Ernest
Introduction to Confidence Intervals
7. Sampling Distributions & Confidence Intervals: Mean
10 problems
Topic
Justin
3. Describing Data Numerically
8 topics 19 problems
Chapter
Jonathan
6. Normal Distribution & Continuous Random Variables
4 topics 15 problems
Chapter
Ernest
7. Sampling Distributions & Confidence Intervals: Mean - Part 1 of 2
3 topics 15 problems
Chapter
Ally
7. Sampling Distributions & Confidence Intervals: Mean - Part 2 of 2
1 topic 2 problems
Chapter
Zachary
8. Sampling Distributions & Confidence Intervals: Proportion - Part 1 of 2
2 topics 15 problems
Chapter
Laura
8. Sampling Distributions & Confidence Intervals: Proportion - Part 2 of 2
2 topics 6 problems
Chapter
Nicole
Sample Size Calculator
Calculate sample size for means or proportions using confidence level and margin of error
Probability Distribution Calculator
Calculate probabilities for normal, binomial, Poisson, t, chi-square, F, and other common distributions
Critical Value Calculator
Find critical values for Z, t, χ², or F distributions using α and tail type
Degrees of Freedom Calculator
Calculate degrees of freedom for t-tests, χ², ANOVA, F, and regression
Z-Score Calculator
Calculate z-scores, percentiles, and reverse-solve x, μ, or σ
Central Limit Theorem Calculator
Calculate sample mean probabilities, standard error, and quantiles using CLT
Mean Median Mode Calculator
Calculate mean, median, and mode from a list of numbers or a frequency table
Average Calculator
Calculate averages and weighted means from any set of numbers
Percent Error Calculator
Calculate percent error between experimental and accepted values
P-Value Calculator
Compute p-values from Z, t, χ², or F test statistics with one- or two-tailed options
Variance Calculator
Calculate population or sample variance from raw data, a frequency table, or by combining two groups
Binomial Distribution Calculator
Calculate binomial probabilities, expected values, cumulative probabilities, and exact success outcomes
Statistics & Data Analysis Lab
Upload datasets, analyze statistics visually, run hypothesis tests, and interpret results with interactive charts
ANOVA Calculator
Run one-way ANOVA, two-way ANOVA, and Tukey HSD — with F-distribution curves and step-by-step solutions
Normal Distribution Calculator
Calculate normal distribution probabilities, z-scores, percentiles, and shaded bell-curve areas
Poisson Distribution Calculator
Calculate Poisson probabilities, expected event counts, cumulative probabilities, and rare event outcomes
Standard Deviation Calculator
Calculate standard deviation, variance, and mean from data
Hypothesis Testing Calculator
Perform hypothesis tests with p-values, critical values, effect sizes, and visual step-by-step solutions
Standard Error Calculator
Calculate standard error for mean, proportion, or raw data inputs
A/B Test Significance Calculator
Check if A/B test results are statistically significant
Correlation Coefficient Calculator
Calculate Pearson’s r, Spearman’s rank correlation, r², regression line, significance, and relationship strength
Back to all calculatorsAll calculators