Skip to content
School

Confidence Interval Calculator

Confidence interval calculator. Enter a sample mean and its spread, or successes out of a sample, plus the sample size and confidence level. The interval and margin of error update as you type.

Interval

A mean uses the standard deviation. A proportion uses the number of successes. The math stays in your browser.

90%, 95%, and 99% are the usual choices. Custom accepts 50 to 99.9.

The average of the observations.

Use the sample standard deviation unless the population value is known.

A t interval needs at least 2 observations. A z interval needs at least 1.

Sample standard deviation uses t with n − 1 degrees of freedom. Population uses z.

Confidence interval

Lower bound
45.8722
Upper bound
54.1278
Sample mean
50
Margin of error
4.1278
Standard error
2
t critical value
2.0639
Sample size
25
Degrees of freedom
24

95% t interval with 24 degrees of freedom. Standard error = 10 / √25 = 2, using the sample standard deviation. Critical value = 2.0639. Margin of error = 4.1278. The interval runs from 45.8722 to 54.1278.

The interval is the mean plus or minus the critical value times the standard error. A sample standard deviation uses t. A known population standard deviation uses z. The math stays in your browser.

How to use

  1. Choose a mean or a proportion, and pick 90%, 95%, 99%, or a custom level from 50 to 99.9.
  2. For a mean, enter the sample mean, the standard deviation, and the sample size.
  3. Say whether that standard deviation is from the sample (t) or the population (z).
  4. For a proportion, enter the successes and the sample size, then read the interval, critical value, and margin of error.

Formula

For a mean, the interval is the sample mean ± critical value × (standard deviation / √n). Use a t critical value with n − 1 degrees of freedom when the standard deviation is from the sample, and a z critical value when the population standard deviation is known. For a proportion, the Wald interval is p ± z × √(p(1 − p) / n), where p is successes divided by n. The critical value is the two-sided point for the confidence level you choose.

Example. A mean of 50, a sample standard deviation of 10, and n = 25 gives a 95% t interval with 24 degrees of freedom. The critical value is 2.0639, the standard error is 2, and the margin of error is 4.1278. The interval runs from 45.8722 to 54.1278.

Example. A mean of 100, a population standard deviation of 15, and n = 36 gives a 95% z interval. The critical value is 1.9600, the margin of error is 4.8999, and the interval runs from 95.1001 to 104.8999.

Example. 86 successes out of 200 is a sample proportion of 0.43. The 95% Wald interval has a standard error of 0.0350 and a margin of error of 0.0686, so it runs from 0.3614 to 0.4986 (36.14% to 49.86%).

A range, not a p-value

The interval estimates the mean or the proportion. It does not return a p-value, and a Wald proportion interval can fall outside 0 and 1. The math stays in your browser.

Frequently asked questions

How do you calculate a confidence interval for a mean?

The interval is the mean plus or minus the critical value times the standard deviation divided by the square root of n. For a mean of 50, a sample standard deviation of 10, and n = 25, the 95% t critical value with 24 degrees of freedom is 2.0639. The standard error is 2 and the margin of error is 4.1278, so the interval runs from 45.8722 to 54.1278.

When do you use t instead of z?

Use t when the standard deviation comes from the sample. Use z when the population standard deviation is known. A mean of 100, a population standard deviation of 15, and n = 36 has a 95% z critical value of 1.9600, a margin of error of 4.8999, and an interval from 95.1001 to 104.8999.

How do you calculate a confidence interval for a proportion?

The Wald interval is the sample proportion plus or minus z times the square root of p(1 − p) / n. With 86 successes out of 200, the sample proportion is 0.43. At 95%, the critical value is 1.9600, the standard error is 0.0350, and the margin of error is 0.0686. The interval runs from 0.3614 to 0.4986, or 36.14% to 49.86%.

What confidence level should I use?

90%, 95%, and 99% are the usual choices. A higher level uses a larger critical value and a wider interval. This page accepts any level from 50 to 99.9 percent.

Does a confidence interval test a hypothesis?

No. The interval is a range for the mean or the proportion. It does not return a p-value. For a p-value from a test statistic, use the p-value calculator. The math stays in your browser.