Math

Confidence Interval Calculator

Results

Enter values and calculate to see results.

Embed on your site

Any ezcalcs calculator can be embedded with one script tag. Copy the snippet below or use the homepage playground to preview and customize.

<!-- ezcalcs embed: confidence-interval-calculator — paste anywhere in the body -->
<script
  async
  src="https://ezcalcs.net/embed.js"
  data-calc="confidence-interval-calculator"
  data-theme="light"
  data-width="100%"
  data-height="640"
></script>

A confidence interval gives you a range of values likely to contain a true population parameter. Enter your sample data into the calculator above to get your interval estimate in seconds.

A confidence interval is a statistical tool that pairs a point estimate (like a sample mean or proportion) with a margin of error. The result is a range of values. That range reflects how precisely your sample represents the larger population.

For example, a 95% confidence interval means that if you repeated the same sampling process many times, about 95% of those intervals would contain the true population value. This calculator handles both mean and proportion inputs, so you can use it for surveys, experiments, lab results, and more.

Calculate the confidence interval for a sample

Use this confidence interval calculator to estimate a plausible range for a population mean or a population proportion. You only need a few summary statistics.

To calculate the confidence interval for a sample, you need:

  • Sample mean (x̄) or sample proportion (p̂), depending on your data type
  • Sample size (n)
  • Standard deviation (population σ if known, or sample s)
  • Confidence level (commonly 95%, but adjustable)

Enter those values into the form above. The calculator returns the confidence interval range, margin of error, and the critical value used in the computation. Results update instantly when you change any input.

Step-by-step input to calculate confidence intervals

Sample mean, sample size, and standard deviation

Start with the mean-based confidence interval if you are working with continuous numerical data (test scores, weights, temperatures, and similar measurements).

  1. Enter the sample mean (x̄). This is the average of your observed values.
  2. Enter the sample size (n). A larger sample size produces a narrower interval.
  3. Enter the standard deviation. If you know the population standard deviation (σ), use it. If not, the sample standard deviation (s) works. The calculator adjusts the formula accordingly.

Not sure whether you know the population standard deviation? In most real-world cases you do not. Use the sample standard deviation. The calculator will apply the t distribution instead of the normal distribution when appropriate.

Proportion input for a confidence interval calculator

Choose proportion mode when your data represents a yes/no outcome, a success rate, or a percentage. Common examples include survey response rates and defect rates.

  1. Enter the sample proportion (p̂). Express it as a decimal (0.62, not 62%).
  2. Enter the sample size (n).

The calculator uses the standard error formula for proportions: √[p̂(1 − p̂) / n]. No separate standard deviation entry is needed because the proportion itself determines variability.

Select a 95 or custom confidence level

The default confidence level is 95%, written as 0.95. This is the most common choice in research and reporting.

You can also select 90% or 99%, or type any custom level. A 99% confidence interval is wider than a 95% interval because higher confidence demands a larger margin of error to capture the true value more often. A 90% interval is narrower but carries more risk of missing the parameter.

What is the z-score for a 95% confidence interval? It is 1.96. For a 99% confidence interval, the z-score is 2.576. The calculator looks up or computes the correct critical value for whatever level you choose.

Confidence interval formula and equation

Formula for a sample with known standard deviation

When the population standard deviation (σ) is known, the confidence interval for a mean is:

CI = x̄ ± z × (σ / √n)

  • = sample mean
  • z = z-score for the chosen confidence level (1.96 for 95%)
  • σ = population standard deviation
  • n = sample size

The term σ / √n is the standard error. It measures how much a sample mean is expected to vary from the true population mean. Multiply the standard error by the z-score to get the margin of error.

Equation for a proportion confidence interval

For proportions, the equation is:

CI = p̂ ± z × √[p̂(1 − p̂) / n]

  • = sample proportion
  • z = critical value for your confidence level
  • n = sample size

This formula assumes a reasonably large sample. A common rule of thumb is that both n × p̂ and n × (1 − p̂) should be at least 5 for the normal approximation to be reliable.

When to use the normal distribution vs. the t distribution

Use the normal (z) distribution when:

  • The population standard deviation (σ) is known, or
  • The sample size is large (commonly n ≥ 30) and you are comfortable treating s as a close estimate of σ

Use the t distribution when:

  • The population standard deviation is unknown and the sample size is small
  • Your data is approximately normally distributed

The t distribution has heavier tails than the normal distribution. This produces a slightly wider interval, which accounts for the extra uncertainty of estimating σ from a small sample. As n grows, the t distribution approaches the normal distribution and the difference becomes negligible.

Calculate confidence intervals using statistical analysis

How sample size affects the confidence interval

Sample size (n) appears under the square root in every confidence interval formula. That means its effect on interval width is not linear.

  • Doubling n does not cut the interval in half. It reduces the margin of error by a factor of √2 (about 29%).
  • A larger sample size always produces a narrower interval, holding everything else constant.
  • Very small samples (under 30) rely on the t distribution, which further widens the interval.

If your confidence interval is wider than useful, collecting more data is the most direct way to tighten it.

Margin of error and population parameter estimates

The margin of error is the "±" portion of the confidence interval. It depends on three things:

  1. Confidence level. Higher confidence means a larger margin of error.
  2. Standard deviation. More variability in the data widens the interval.
  3. Sample size. More observations shrink the margin of error.

The resulting interval is your best estimate of the population parameter. It does not guarantee the true value falls inside, but it quantifies the uncertainty around your estimate with a stated degree of certainty.

What will decrease the width of a confidence interval?

  • Increasing the sample size
  • Lowering the confidence level (e.g., from 99% to 95%)
  • Lower variability in the underlying data

What will increase the width?

  • Smaller sample sizes
  • Higher confidence levels
  • Greater variability in the population

Raw data vs. summary statistics

This calculator accepts summary statistics (mean, standard deviation, sample size). You do not need to upload raw data.

If you have raw data in a spreadsheet, compute the sample mean and sample standard deviation first, then enter them here. Many spreadsheet tools calculate these with built-in functions (AVERAGE and STDEV.S in most software). Researchers working in R or similar statistical software can compute confidence intervals directly from raw data, but for a quick check, entering the summary values here is faster.

Description of confidence interval calculator results

What the confidence interval range contains

The output shows a lower bound and an upper bound. Together they form the range of values that is plausible for the true population parameter, given your data and chosen confidence level.

For example, if the calculator returns (48.2, 52.8) at 95% confidence, you can say: "We are 95% confident that the true population mean falls between 48.2 and 52.8."

The calculator also displays the margin of error and the critical value (z or t) used in the calculation, so you can verify each step.

Probability, confidence level, and common misinterpretations

A confidence level of 95% does not mean there is a 95% probability that the true value sits inside this specific interval. The true value is fixed. It is either in the interval or it is not.

What 95% confidence means is procedural: if you repeated the study and rebuilt the interval many times under the same conditions, about 95 out of 100 of those intervals would contain the true parameter. This is a subtle but important distinction.

Still not sure about the difference between confidence interval and standard deviation? The standard deviation describes how spread out individual data points are. The confidence interval describes uncertainty about a population parameter (like the mean). They are related, because standard deviation feeds into the confidence interval formula, but they answer different questions.

Statistical calculators for related analysis

Confidence intervals are one part of a broader statistical analysis toolkit. Depending on your project, you may also need:

  • Standard deviation calculator for summarizing the spread of sample data
  • P-value and hypothesis testing tools for deciding whether an observed effect is statistically significant
  • Regression and correlation calculators for examining relationships between variables
  • Chi-square and ANOVA calculators for comparing groups
  • Sample size calculators for planning a study before you collect data

Explore the full set of statistical calculators on ezcalcs.net to perform related analyses alongside your confidence interval results.