Confidence Intervals

Confidence Interval Calculator

Use this calculator to find the confidence interval for the population mean. Choose summary data or raw data, indicate whether the population standard deviation is known or unknown, and enter the required values. You can calculate common 90%, 95%, and 99% confidence intervals or enter any custom confidence level. The calculator gives the confidence interval and a clear step-by-step solution.

Data Type
Population Standard Deviation, σ
Select Known only when the population standard deviation, σ, is given or already known.
Enter 90, 95, 99, or a custom level.
Calculations use full precision. Only the final confidence interval is rounded.

How to Use the Confidence Interval Calculator

This confidence interval calculator finds the confidence interval for a population mean from summary data or raw data. It can calculate 90%, 95%, and 99% confidence intervals, or any custom confidence level between 0% and 100%.

To use the calculator:

  1. Select 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.
  2. Indicate whether the population standard deviation, σ, is Known or Unknown.
  3. Enter the required values.
  4. Enter the confidence level as an integer (e.g., 95 for a 95% confidence interval, 90 for a 90% confidence interval, etc).
  5. Select how many decimal places you want in the final answer.
  6. Click Calculate.

The calculator will return the confidence interval for the population means and round the values to your preferred number of decimal places. You will also see a clear step-by-step solution, showing you how to calculate the confidence interval manually.

Tip. When the population standard deviation is known, the calculator uses the z distribution to find the margin of error. However, if the population standard deviation is unknown, the calculator uses the t distribution to estimate the margin of error.

What Is a Confidence Interval?

A confidence interval is a range of values, derived from sample data, that is likely to contain the true value of an unknown population parameter. In this case, the unknown population parameter is the population mean (μ). 

For instance, if the estimated 95% confidence interval for the population mean is [45.87, 54.13], it means that if we were to repeat this sampling process many times, 95% of the calculated intervals would contain the true population mean. Therefore, we are 95% confident that the statistical procedure used to generate this specific interval has captured the true population mean between 45.87 and 54.13. 

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 sample mean lies at the center of the confidence interval when the usual z or t interval for a population mean is used.

Which Confidence Interval Should I Use?

The correct confidence interval for the population mean depends on whether or not you know the population standard deviation. If the population standard deviation is known (given in your problem), you should estimate the confidence interval using the z-distribution. Specifically, you should use the z-table to look up the critical value for the confidence interval.

However, if the population standard deviation is unknown (not given in your problem), we estimate it using the sample standard deviation and instead use the t-distribution to find the critical values. In this case, you’ll need to find the degrees of freedom and use the t-distribution table to look up the critical value.

Tip. If a problem specifies the sample standard deviation (s), you should treat the population standard deviation (σ) as unknown and use the t-distribution instead of the standard normal distribution.

Confidence Interval Formula

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

Where:

  • Point estimate is the single value from a sample (like the sample mean or sample proportion) used to estimate an unknown population parameter.
  • Margin of error is a statistical measure that shows how much the estimate might vary due to random sampling

Confidence Interval Formula for the Population Mean

As aforementioned, the confidence interval formula for the population mean varies depending on whether we know the population standard deviation (σ) or not. If the population standard deviation is known, the confidence interval formula for the population mean 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

However, if the population standard deviation is unknown (only the sample standard deviation is given), the confidence interval formula for the population mean 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

Note. z* × (σ / √n) and t* × (s / √n) are the margin of error, whereas σ / √n and s / √n are the standard error of the mean.

Recall. The degrees of freedom formula for a single mean is: df=n-1, where n is the sample size.

Example 1: Confidence Interval When Population Standard Deviation 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 shows a sample mean delivery time of 430 minutes with a sample standard deviation of 26.9 minutes. Assuming the delivery times are approximately normally distributed, find the 90% confidence interval for the true mean delivery time of all express shipments.

Solution

From the question, we know that:

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

As you can see, the population standard deviation is unknown because we only have the sample standard deviation. Therefore, we use the t distribution to estimate the confidence interval for the population mean.

The confidence interval formula is:

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

To use the formula, we first need to find the t critical value, t*.

For a confidence interval for one population mean, the degrees of freedom are:

df = n − 1

Thus, df = 7 − 1

= 6

Next, find the significance level, α:

α = 1 − 0.90

= 0.10

Since a confidence interval has two tails, divide α by 2:

α/2 = 0.10/2

= 0.05

Using α/2 = 0.05 and df = 6, the t table gives: t*= 1.943*

Alternatively, you can use our t critical value calculator to get a more precise critical value.

We now have all the values needed to calculate the confidence interval. Substituting the values into the formula gives:

CI = 430 ± 1.943 × (26.9 / √7)

= 430 ± 1.943 × 10.1672

= 430 ± 19.7550

Now calculate the lower and upper bounds:

  • Lower bound = 430 − 19.7550 = 410.245
  • Upper bound = 430 + 19.7550 = 449.755

Therefore, using the t-table critical value, the 90% confidence interval for the population mean is [410.245, 449.755].

Example 1.1: Using the Calculator

To solve the same problem using the calculator:

  1. Select Summary Data.
  2. Select Unknown for the population standard deviation.
  3. Enter x̄ = 430.
  4. Enter s = 26.9.
  5. Enter n = 7.
  6. Enter 90 as the confidence level.
  7. Select 3 decimal places.
  8. Click Calculate.

The calculator will return: 90% CI = [410.243, 449.757].

As you can see, there is a minor deviation in the two confidence intervals because the calculator is more precise than using t-tables, which round critical values to three decimal places.

Example 2: Confidence Interval When Population Standard Deviation Is Known

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

Solution

From the question, we know that:

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

As you can see, the population standard deviation is known. Therefore, we use the z distribution to estimate the confidence interval for the population mean.

By definition, the confidence interval formula is: x̄ ± z × (σ / √n)*

To find the confidence interval, we first need to determine the z critical value, z*.

Since we want to find the 95% confidence interval, the significance level is:

α = 100% − 95%

= 5%

In decimals, α = 0.05

Since a confidence interval has two tails, divide α by 2. Thus, α/2 = 0.05/2

= 0.025

Using α/2 = 0.025, the standard normal table gives a z critical value of approximately: z* = 1.96

Alternatively, you can use the z critical value calculator to get the more precise value: z* = 1.959964

We now have all the required parameters to find the 95% confidence interval. Substituting the values into the formula, we get:

CI = 72 ± 1.96 × (12 / √36)

= 72 ± 1.96 × 2

= 72 ± 3.920

The lower bound is: 72 − 3.920 = 68.08

The upper bound is: 72 + 3.92 = 75.92

Therefore, the 95% confidence interval for the true population mean weight is [68.08, 75.92].

Example 2.1: Using the Calculator

To calculate the 95% confidence interval for Example 2 using the calculator:

  1. Select Summary Data.
  2. Select Known for the population standard deviation.
  3. Enter x̄ = 72.
  4. Enter σ = 12.
  5. Enter n = 36.
  6. Enter 95 as the confidence level.
  7. Select 2 decimal places.
  8. Click Calculate.

The calculator will return: 95% CI = [68.08, 75.92]

How to Find a Confidence Interval from Raw Data

Do you want to find a confidence interval for a single population mean from raw data? You do not need to calculate the summary statistics manually. This confidence interval calculator also allows you to enter raw data directly.

You can enter the values manually and separate them using commas, spaces, tabs, or new lines. You can also paste the values directly from Excel, Google Sheets, or a text document.

To help you understand how to find a confidence interval from raw data using the calculator, consider the following example.

Example 3: Confidence Interval from Raw Data

A specialty coffee roaster wants to estimate the true average weight of its “12-ounce” bean bags. The packing machine has a known population standard deviation of 0.6 ounces. A quality control check takes a random sample of 9 bags and records the following weights in ounces:

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 true mean weight of all bags.

Solution

From the example, the population standard deviation is known, σ = 0.6. Therefore, the calculator will use the z distribution to estimate the confidence interval.

To find the 95% confidence interval using the calculator:

  1. Select Raw Data.
  2. Select Known for the population standard deviation.
  3. Copy and paste the sample data into the data input field.
  4. Enter 0.6 as the population standard deviation.
  5. Enter 95 as the confidence level.
  6. Select the number of decimal places you want the answer rounded to.
  7. Click Calculate.

The calculator will automatically find the sample mean and sample size from the raw data. In this example:

  • Sample mean, x̄ = 12
  • Sample size, n = 9
  • Population standard deviation, σ = 0.6

Since the population standard deviation is known, the calculator uses the z distribution and returns: 95% CI = [11.61, 12.39]

However, if the population standard deviation is unknown, the procedure is almost the same. In that case, you will select unknown for the population standard deviation, and you will not need to enter a population standard deviation because the calculator will find the sample standard deviation from the raw data and use the t distribution to calculate the confidence interval.

Common Z Critical Values for Confidence Intervals

When the population standard deviation, σ, is known, the confidence interval for a population mean is calculated using the z distribution. The formula is:x̄ ± z* × (σ / √n)

The value of z* depends on the confidence level. The table below shows the z critical values for some of the most commonly used confidence levels.

Confidence Levelαα/2Z Critical Value, z*
80%0.200.101.282
85%0.150.0751.440
90%0.100.051.645
95%0.050.0251.960
98%0.020.012.326
99%0.010.0052.576
99.5%0.0050.00252.807
99.9%0.0010.00053.291

For example, the z critical value for a 95% confidence interval is z* = 1.960, and that of 99% is z* = 2.576

As you can see from the table, the z critical value increases as the confidence level increases. This consequently increases the margin of error and produces wider confidence intervals.

Frequently Asked Questions

What is a confidence interval calculator?

A confidence interval calculator estimates a range of values for a population mean using sample data. This calculator supports both summary data and raw data. You can enter the sample mean, standard deviation, and sample size, or paste the individual sample values directly. It also allows you to specify whether the population standard deviation is known or unknown, enter a common or custom confidence level, and choose how many decimal places to round the final answer to. The calculator then uses the correct z or t distribution and provides the confidence interval together with a clear step-by-step solution.

Should I use Z or T for a confidence interval?

Use z when the population standard deviation, σ, is known. However, if σ is unknown and you use the sample standard deviation, s, instead, you should use the t distribution.

Can I calculate a confidence interval from raw data?

Yes. Select Raw Data and enter or paste the individual sample values. When σ is unknown, the calculator finds the sample mean, sample standard deviation, and sample size before calculating the correct confidence interval using the t distribution.

Can I calculate a confidence interval other than 95%?

Yes. The calculator allows you to enter 90, 95, or 99 for the most common confidence levels, or a custom confidence level required by your problem.

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

A larger sample size generally reduces the standard error and margin of error. Therefore, the confidence interval becomes narrower when the other quantities remain unchanged.

Cite

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

Mburu, J.. (2026, August 19). Confidence Interval Calculator. StatCalc.net. Retrieved August 23, 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.