Confidence Intervals

Confidence Interval Calculator

Use this confidence interval calculator to find a confidence interval for a population mean or proportion. Enter the required values, choose a confidence level, and get the confidence interval, margin of error, critical value, and a complete step-by-step solution.

Estimate
Choose Mean for numerical measurements or Proportion for success/failure, yes/no, or percentage data.
Data
Population SD, σ
Select Known only when σ is given or already known.

Common values are 90, 95, and 99.
Only the final answer is rounded.

How to Use the Confidence Interval Calculator

This calculator can estimate a confidence interval for a population mean or population proportion. Therefore, the inputs you need depend on what you want to estimate.

To calculate a confidence interval for a mean

  1. Select Mean.
  2. Choose Summary Data if you already know the sample mean, standard deviation, and sample size. However, if you have the individual sample values, select Raw Data.
  3. Indicate whether the population standard deviation, σ, is Known or Unknown.
  4. Enter the required values.
  5. Enter the confidence level, such as 90, 95, or 99.
  6. Select the number of decimal places for the final answer.
  7. Click Calculate.

However, to calculate a confidence interval for a proportion

  1. Select Proportion.
  2. Choose whether you want to enter Successes + n or p̂ + n. If you select Successes + n, enter the number of successes and the sample size. However, if you select p̂ + n, enter the sample proportion as a decimal and the sample size.
  3. Enter the confidence level.
  4. Select the number of decimal places for the final answer.
  5. Click Calculate.

The calculator returns the lower and upper confidence limits, margin of error, critical value, standard error, and a complete step-by-step solution.

Tip. When calculating a confidence interval for the mean, the calculator allows you to enter raw values separated by commas, spaces, tabs, or linebreaks. You can also paste the values directly from Excel, Google Sheets, or text documents. In this case, the calculator automatically finds the sample mean and sample size, and if the population standard deviation (σ) is unknown, it also calculates the sample standard deviation to estimate the confidence interval using the t-distribution.

Which Confidence Interval Should I Use?

Still unsure which confidence interval formula to use? The table below provides a quick summary of the method used by the calculator.

What You Want to EstimateInformation AvailableMethod
Population mean CIPopulation standard deviation, σ, is unknownT confidence interval
Population mean CIPopulation standard deviation, σ, is knownZ confidence interval
Population mean CIIndividual sample valuesRaw Data
Population proportion CINumber of successes and sample sizeOne-proportion z confidence interval
Population proportion CISample proportion, p̂, and sample sizeOne-proportion z confidence interval

Tip: If your problem gives the sample standard deviation, s, rather than the population standard deviation, σ, treat σ as unknown and use the t-distribution.

If you only need to estimate one population proportion, you can also use the Proportion Confidence Interval Calculator. To estimate the difference between two population proportions, use the Two Proportion Confidence Interval Calculator.

What Is a Confidence Interval?

A confidence interval is a range of values calculated from sample data and used to estimate an unknown population parameter, such as a population mean or population proportion.

For example, suppose a sample gives the following 95% confidence interval for a population mean: 95% CI = [45.87, 54.13]. This interval gives a plausible range for the true population mean, μ.

A 95% confidence level refers to the reliability of the method used to construct the interval. If we repeatedly took random samples and calculated a 95% confidence interval from each sample, about 95% of those intervals would contain the true population parameter.

Therefore, a suitable interpretation is: we are 95% confident that the interval from 45.87 to 54.13 captures the true population mean.

A confidence interval has two endpoints:

  • Lower confidence limit: the smallest value in the interval
  • Upper confidence limit: the largest value in the interval

The distance from the point estimate to either endpoint is the margin of error.

Confidence Interval Formula

The general confidence interval formula is: Point estimate ± Margin of error

Where:

  • Point estimate is a single number calculated from a sample to serve as an estimate of the unknown population parameter. For instance, the point estimate of the population mean is the sample mean (x̄), while that of population proportion is the sample proportion (p̂).
  • Margin of error = Critical value × Standard error

Therefore, the confidence interval formula can be written as: Confidence interval = Point estimate ± Critical value × Standard error

Note. The exact confidence interval formula depends on what you are estimating and the information available.

Confidence Interval for a Population Mean

There are two common methods for estimating a confidence interval for one population mean: the t confidence interval and the z confidence interval. The correct method depends on whether the population standard deviation, σ, is known.

  • If the population standard deviation, σ, is unknown, use the t-distribution and estimate σ using the sample standard deviation, s.
  • However, if the population standard deviation, σ, is known, use the standard normal (z) distribution.

Each method is discussed below, together with a worked example showing how to calculate and interpret the confidence interval.

1. Population Standard Deviation Unknown: T Confidence Interval

If the population standard deviation, σ, is unknown, use the sample standard deviation, s, and estimate the confidence interval using the t-distribution.

The formula is:

x̄ ± t* × (s / √n)

where:

  • x̄ is the sample mean
  • t* is the t critical value
  • s is the sample standard deviation
  • n is the sample size

The standard error is: SE = s / √n

You also need the degrees of freedom to find the t critical value. For a single population mean, the degrees of freedom formula is: df = n − 1

The t critical value depends on both the confidence level and degrees of freedom. You can find it using the t-critical value calculator or the t-table.

Example 1: Confidence Interval for a Mean When σ Is Unknown

A regional e-commerce store wants to estimate the true average delivery time for its express shipping service. A random sample of 7 deliveries has a sample mean of 430 minutes and a sample standard deviation of 26.9 minutes. Find the 90% confidence interval for the population mean delivery time.

Solution

From the question:

  • Sample mean, x̄ = 430
  • Sample standard deviation, s = 26.9
  • Sample size, n = 7
  • Confidence level = 90%

Since the population standard deviation is unknown, use the t-distribution.

The confidence interval formula is: x̄ ± t* × (s / √n)

First, find the significance level:

α = 1 − 0.90

= 0.10

Next, calculate the degrees of freedom:

df = n − 1

= 7 − 1

= 6

Since the confidence interval has two tails, we divide the significance level by two. Therefore, α/2 = 0.10 / 2 = 0.05

Using α/2 = 0.05 and df = 6:

t* = 1.943

Now calculate the standard error:

SE = s / √n

= 26.9 / √7

= 10.1672

Next, calculate the margin of error:

ME = t* × SE

= 1.94318 × 10.1672

= 19.7568

Therefore: CI = 430 ± 19.7568

Lower limit = 430 − 19.7568

= 410.2432

Upper limit = 430 + 19.7568

= 449.7568

Rounded to three decimal places: 90% CI = [410.243, 449.757]

Therefore, we are 90% confident that the interval from 410.243 to 449.757 minutes captures the true mean delivery time for all express shipments.

2. Population Standard Deviation Known: Z Confidence Interval

If the population standard deviation, σ, is known, use the standard normal or z-distribution.

The confidence interval formula is: x̄ ± z* × (σ / √n)

where:

  • x̄ is the sample mean
  • z* is the z critical value
  • σ is the population standard deviation
  • n is the sample size

The standard error is: SE = σ / √n

The z critical value depends on the confidence level. You can find it using the Z Critical Value Calculator or the standard normal table.

Tip: Do not switch automatically from t to z just because the sample size is greater than 30. If σ is unknown and you are using the sample standard deviation, s, use the t-distribution.

Example 2: Confidence Interval for a Mean When σ Is Known

A manufacturing plant monitors package weights. The population standard deviation is known to be 12 grams. A quality manager takes a random sample of 36 packages and gets a sample mean weight of 72 grams. Find the 95% confidence interval for the true population mean weight.

Solution

From the question:

  • Sample mean, x̄ = 72
  • Population standard deviation, σ = 12
  • Sample size, n = 36
  • Confidence level = 95%

Since the population standard deviation is known, use the z-distribution.

The confidence interval formula is:

x̄ ± z* × (σ / √n)

For a 95% confidence interval: α = 1 − 0.95 = 0.05

Since the interval has two tails: α/2 = 0.05 / 2

= 0.025

Using α/2 = 0.025, the critical value, z* = 1.96

Now calculate the standard error.

By definition, SE = σ / √n

= 12 / √36

= 2

Next, calculate the margin of error. The margin of error formula is: ME = z* × SE

Substituting the values, we get

SE = 1.96 × 2

= 3.92

Therefore: CI = 72 ± 3.92

Calculating the lower and upper limits, we have:

Lower limit = 72 − 3.92

= 68.08

Upper limit = 72 + 3.92

= 75.92

Therefore, 95% CI = [68.08, 75.92]. This implies that we are 95% confident that the interval from 68.08 to 75.92 grams captures the true population mean package weight.

Confidence Interval for a Mean from Raw Data

If you have the individual sample values rather than summary statistics, you do not need to calculate x̄, s, or n before using the calculator. Simply select Mean, then Raw Data, and paste your values into the data field.

You can separate the values using commas, spaces, tabs, or new lines. You can also paste a column directly from Excel or Google Sheets.

If σ is unknown, the calculator finds:

  • sample mean, x̄;
  • sample standard deviation, s; and
  • sample size, n.

It then uses the t-distribution.

However, if σ is known, the calculator finds x̄ and n from the raw data and uses the population standard deviation you provide to calculate a z confidence interval.

Example 3: Confidence Interval from Raw Data

A coffee roaster wants to estimate the true average weight of its packaged coffee bags. The packing process has a known population standard deviation of 0.6 ounces.

A random sample gives the following weights:

11.2, 11.6, 11.8, 12.0, 12.0, 12.2, 12.4, 12.8, 12.0

Find the 95% confidence interval for the population mean.

To solve the problem with the calculator:

  1. Select Mean.
  2. Select Raw Data.
  3. Select Known for the population standard deviation.
  4. Paste the sample values into the data field.
  5. Enter σ = 0.6.
  6. Enter 95 as the confidence level.
  7. Click Calculate.

The calculator automatically finds:

  • Sample mean, x̄ = 12
  • Sample size, n = 9

Since σ is known, it uses the z-distribution.

The result is: 95% CI = [11.61, 12.39]

If the population standard deviation were unknown, you would select Unknown instead. The calculator would find the sample standard deviation from the raw data and use the t-distribution.

Confidence Interval for a Population Proportion

A population proportion represents the fraction or percentage of a population with a particular characteristic.

For example, you may want to estimate the proportion of:

  • students who prefer online classes;
  • voters who support a candidate;
  • customers who prefer a product; or
  • manufactured items that pass inspection.

If you know the number of successes, x, and sample size, n, first calculate the sample proportion: p̂ = x / n

The standard one-proportion z confidence interval is:

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

where:

  • p̂ is the sample proportion
  • z* is the z critical value
  • n is the sample size

The standard error is:

SE = √[p̂(1 − p̂) / n]

Check the Success-Failure Condition

Before using the normal approximation, check that there are enough successes and failures.

A commonly used rule is:

np̂ ≥ 10

and

n(1 − p̂) ≥ 10

If both values are at least 10, the normal approximation is generally reasonable.

The calculator checks this automatically and displays a warning when the condition is not met.

Example 4: Confidence Interval for a Population Proportion

A college surveys 200 students, and 84 say they prefer online registration to in-person registration.

Find the 95% confidence interval for the true proportion of students who prefer online registration.

Solution

From the question:

  • Number of successes, x = 84
  • Sample size, n = 200
  • Confidence level = 95%

First calculate the sample proportion:

p̂ = x / n
= 84 / 200
= 0.42

Next, check the success-failure condition:

np̂ = 200 × 0.42
= 84

n(1 − p̂) = 200 × 0.58
= 116

Both values are greater than 10. Therefore, the normal approximation is appropriate.

For a 95% confidence interval:

z* = 1.96

Now calculate the standard error:

SE = √[p̂(1 − p̂) / n]
= √[(0.42 × 0.58) / 200]
= 0.03491

Next, calculate the margin of error:

ME = z* × SE
= 1.96 × 0.03491
= 0.06842

Therefore:

CI = 0.42 ± 0.06842

Lower limit = 0.42 − 0.06842
= 0.35158

Upper limit = 0.42 + 0.06842
= 0.48842

Rounded to three decimal places:

95% CI = [0.352, 0.488]

Therefore, we are 95% confident that the true proportion of students who prefer online registration is between approximately 35.2% and 48.8%.

Common Z Critical Values for Confidence Intervals

Confidence intervals that use the standard normal distribution require a z critical value. The value depends on the confidence level.

Confidence Levelαα/2z Critical Value
80%0.200.101.282
90%0.100.051.645
95%0.050.0251.960
98%0.020.012.326
99%0.010.0052.576

For example, a 95% confidence interval uses z* = 1.960, while a 99% confidence interval uses z* = 2.576.

As the confidence level increases, the critical value also increases. This increases the margin of error and produces a wider confidence interval.

Unlike z critical values, t critical values depend on both the confidence level and degrees of freedom. Use the T Critical Value Calculator when you need t*.

What Makes a Confidence Interval Wider or Narrower?

The width of a confidence interval mainly depends on the confidence level, sample size, and variability.

Confidence Level

A higher confidence level produces a wider interval.

For the same sample, a 99% confidence interval will normally be wider than a 95% confidence interval because it uses a larger critical value.

Sample Size

A larger sample reduces the standard error and usually produces a narrower confidence interval.

Therefore, estimates based on larger samples are generally more precise.

Variability

More variability produces a larger standard error and a wider confidence interval.

For a population mean, variability is represented by σ or s.

In general:

  • higher confidence → wider interval;
  • larger sample → narrower interval; and
  • greater variability → wider interval.

Confidence Interval vs. Margin of Error

The confidence interval and margin of error are related, but they are not the same thing.

The margin of error is the distance from the point estimate to either confidence limit.

For example, suppose:

  • Sample mean = 50
  • Margin of error = 4

Then:

CI = 50 ± 4

Therefore:

Confidence interval = [46, 54]

The margin of error is 4, while the confidence interval extends from 46 to 54.

The calculator reports both values.

Common Mistakes When Calculating Confidence Intervals

Here are some common mistakes to avoid:

  • Using z just because the sample is large. For a population mean, use t when σ is unknown and you are using s instead.
  • Confusing s and σ. The symbol s is the sample standard deviation, while σ is the population standard deviation.
  • Forgetting to divide α by 2. A two-sided confidence interval has a tail on each side.
  • Entering p̂ as a percentage. Enter 0.42 for 42%, not 42.
  • Confusing a mean with a proportion. Measurements such as weight, height, time, and test score normally involve a mean. Yes/no or success/failure outcomes involve a proportion.
  • Misinterpreting the confidence level. A 95% confidence interval does not mean there is a 95% probability that the fixed population parameter lies inside the interval after it has been calculated.

Frequently Asked Questions

What does a confidence interval calculator do?

It uses sample data to estimate a range of plausible values for an unknown population parameter. This calculator can estimate a population mean using a z or t confidence interval and a population proportion using a one-proportion z confidence interval.

Should I use z or t for a confidence interval?

For a population mean, use z when the population standard deviation, σ, is known. If σ is unknown and you use the sample standard deviation, s, use the t-distribution.
For a population proportion, the standard confidence interval uses the z-distribution when the normal approximation conditions are satisfied.

Can I calculate a confidence interval from raw data?

Yes. Select Mean and then Raw Data. Paste the individual sample values into the calculator. It will calculate the required sample statistics automatically.
If σ is unknown, it calculates x̄, s, and n and uses the t-distribution. If σ is known, it calculates x̄ and n and uses the value of σ you provide.

Can I calculate a confidence interval for a proportion?

Yes. Select Proportion and enter either the number of successes and sample size or the sample proportion, p̂, and sample size.
The calculator returns the lower and upper confidence limits, margin of error, standard error, critical value, and a step-by-step solution.

Can I calculate a confidence interval other than 95%?

Yes. You can enter common confidence levels such as 90%, 95%, and 99%, or enter a custom confidence level required by your problem.

What is the difference between a 90%, 95%, and 99% confidence interval?

The main difference is the confidence level and resulting width. For the same data, a 99% confidence interval is wider than a 95% interval, while a 90% confidence interval is narrower. This happens because higher confidence levels require larger critical values.

What happens to a confidence interval when the sample size increases?

When the other quantities remain unchanged, increasing the sample size reduces the standard error and margin of error. As a result, the confidence interval becomes narrower, and the estimate becomes more precise.

Cite

Choose APA, MLA, Chicago, or Harvard, then copy the citation.

Mburu, J.. (2026, August 28). Confidence Interval Calculator. StatCalc.net. Retrieved September 6, 2026, from https://statcalc.net/confidence-interval-calculator/

Joseph Mburu

About This Calculator

Prepared by Joseph Mburu · Updated on

Joseph is an applied statistician and data analyst with over 6 years of experience helping students, researchers, and professionals solve statistics and data analysis problems. He holds a degree in Applied Statistics and a Master’s degree in Data…

We aim to keep our calculators accurate, easy to use, and helpful for learning. Always check that your inputs match the assumptions of the method you are using.