Confidence Interval Calculator


$n$ =   =   =
$\text{Confidence Level:}$ %
Example 1Example 2
Sample Size
=   $E$ =
$\text{Confidence Level:}$ %
Example 1Example 2

How it Works:

A confidence interval is made up of two parts, the point estimate and the margin of error. The point estimate is simply the sample statistic corresponding to the population parameter of interest. So, if we're constructing a confidence interval for the population mean (μ), we use the sample mean ($\bar{x}$). Since the sample mean is easy to calculate, the focus will be on finding the margin of error. The formula we use to compute the margin of error depends on whether the population standard deviation (σ) is known or unknown. If the population standard deviation is unknown, the sample standard deviation (s) is used instead. To change from $\sigma$ known to $\sigma$ unknown, click on $\boxed{σ}$ and select $\boxed{s}$ in the Confidence Interval Calculator.

$\sigma$ Known $\sigma$ Unknown
Margin of Error $ z_{\alpha/2} \dfrac{\sigma}{\sqrt{{\color{Black} n}}} $ $ t_{\alpha/2} \dfrac{s}{\sqrt{n}} $

In order to find $ z_{\alpha/2} $ (or $ t_{\alpha/2} $), we must first find the value of $\alpha/2$. We start by setting 1 - $\alpha$ equal to the confidence coefficient. The confidence coefficient is simply the decimal form of the confidence level. So, for example, if the confidence level is 95%, the confidence coefficient is .95. The next step is to solve for $\alpha/2$. So, continuing with our example, we would have 1 - $\alpha$ = .95 and find the value of $\alpha/2$ to be .025. The most commonly used confidence level is 95% while 90% and 99% are also popular. An interval estimate constructed at a confidence level of 95% is called a 95% confidence interval. To change the confidence level, click on $\boxed{95\%}$.

Confidence Level Confidence Coefficient
99% .99
95% .95
90% .90

Now that we know the value of $\alpha/2$, we can find $ z_{\alpha/2} $ (or $ t_{\alpha/2} $). We can get $ z_{\alpha/2} $ by finding the z-value that provides an area of $\alpha/2$ in the upper tail of the z-distribution. Similarly, $ t_{\alpha/2} $ is the t-value that provides an area of $\alpha/2$ in the upper tail of the t-distribution. If $\sigma$ is known and we're using the z distribution, it is useful to calculate the area to the left since that is what the z-table gives us. The t-table gives us the upper tail area but the particular t-distribution depends on the degrees of freedom, which is simply one less than the sample size (degrees of freedom = n - 1). Note that if you want to enter your data you can click on the switch symbol.


Finally, we can put the point estimate and margin of error together to make the confidence interval. The confidence interval is created by adding and subtracting the margin of error from the point estimate. If $\sigma$ is known, the confidence interval will be given by $\bar{x} \pm z_{\alpha/2} \frac{\sigma}{\sqrt{n}}$. If $\sigma$ is unknown, the confidence interval will be given by $\bar{x} \pm t_{\alpha/2} \frac{s}{\sqrt{n}}$. The confidence interval gives a range of values the population parameter is likely to be in. The likeliness that the interval contains the parameter is determined by the confidence level.

If we're constructing a confidence interval of the population proportion, we use the sample proportion. The confidence interval is created by adding and subtracting the margin of error from the point estimate. Since the sample mean and sample proportion are easy to calculate, the focus will be on finding the margin of error. To switch from confidence intervals about the population mean to the population proportion, click on $\boxed{\bar{x}}$ and select $\boxed{\bar{p}}$.

Population Proportion
Margin of Error $ z_{\alpha/2} \sqrt{\dfrac{\bar{p}(1-\bar{p})}{n}} $

Sometimes, when dealing with confidence intervals, we are interested in achieving a certain margin of error. In order to achieve the margin of error that we want, we can adjusted the sample size. The formula for this can be easily derived from the margin of error formula and is shown below. In the formula, $E$ is the desired margin of error. If the population standard deviation is unknown, a planning value is used for $\sigma$.

Sample Size
$ n = \dfrac{(z_{\alpha/2})^2 \sigma ^2}{E^2} $

The sample size needed to achieve the desired margin of error can also be found for confidence intervals about the population proportion. Again, the formula for this can be easily derived from the margin of error formula and is shown below. In the formula, $E$ is the desired margin of error and $p^*$ is the planning value.

Sample Size
$ n = \dfrac{(z_{\alpha/2})^2 p^* (1-p^*)}{E^2} $

Confidence intervals is closely related to the statistical area of hypothesis testing. If the hypothesized value of the population mean is outside of the confidence interval, we can reject the null hypothesis. Hypothesis teting can be done using the Hypothesis Testing Calculator. The calculator on this page solves confidence intervals for one population mean. Sometimes we're interest in confidnece intervals about two population means. These can be solved using the Two Population Calculator.