How to Calculate a Confidence Interval (Mean, Proportion)

By Jude Wallis · Published

Every confidence interval follows one form: statistic plus or minus (critical value)(standard error). Use a z critical value for a proportion and a t critical value with n - 1 degrees of freedom for a mean. Check conditions, pick the critical value for your confidence level, then compute.

AP Statistics: Unit 3 (topics 3.3 Constructing a Confidence Interval for a Population Proportion, 3.4 Justifying a Claim Based on a Confidence Interval for a Population Proportion, 4.2 Constructing a Confidence Interval for a Population Mean or Population Mean Difference). This guide covers Unit 3 topics 3.3 to 3.4 (proportion intervals) and Unit 4 topic 4.2 (mean intervals) in the Fall 2026 AP Statistics course.

The one formula behind every confidence interval

Every confidence interval you build in AP Statistics uses the same structure from the official formula sheet:

confidence interval=statistic±(critical value)(standard error)\text{confidence interval} = \text{statistic} \pm (\text{critical value})(\text{standard error})

The statistic is your point estimate from the sample. That is the sample proportion p^\hat{p} (p-hat) when you study a categorical variable, or the sample mean xˉ\bar{x} (x-bar) when you study a quantitative variable. Throughout, nn is the sample size.

The critical value sets how confident you want to be. A larger critical value gives a wider interval and higher confidence. You read it from a zz table for a proportion or a tt table for a mean.

The standard error measures how much the statistic moves from one random sample to the next. The product (critical value)(standard error) is the margin of error, the plus-or-minus part that you add and subtract.

Once you have those three pieces, every interval is the same short job: find the statistic, look up the critical value, compute the standard error, then add and subtract the margin of error. The two recipes below differ only in which standard error formula and which table you use.

How to calculate a confidence interval for a proportion

Use this when your data is counts or percentages, such as the share of voters who back a measure. Call the true population proportion pp and the sample proportion p^\hat{p}, found by dividing the number of successes by the sample size nn. A success just means the outcome you are counting, like a voter who says yes.

The recipe:

  1. Confirm the conditions (random, 10% condition, large counts). See the conditions section below.
  2. Compute p^=successesn\hat{p} = \frac{\text{successes}}{n}.
  3. Find the critical value zz^* for your confidence level from the table below.
  4. Compute the standard error SE=p^(1p^)nSE = \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}.
  5. Build the interval: p^±zSE\hat{p} \pm z^* \cdot SE.

For a proportion the standard deviation of the sampling distribution depends only on pp, and under the large-counts condition the distribution of p^\hat{p} is approximately normal, so you use a zz critical value. The College Board calls this a one-sample z-interval for a population proportion, and you should name it that way on the exam.

How to calculate a confidence interval for a mean

Use this when your data is measurements, such as reaction times or battery life. Call the true population mean μ\mu (mu) and estimate it with the sample mean xˉ\bar{x}.

The recipe:

  1. Confirm the conditions (random, 10% condition, normal or large sample). See the conditions section below.
  2. Compute xˉ\bar{x} and the sample standard deviation ss.
  3. Find the critical value tt^* using degrees of freedom df=n1df = n - 1 for your confidence level.
  4. Compute the standard error SE=snSE = \frac{s}{\sqrt{n}}.
  5. Build the interval: xˉ±tSE\bar{x} \pm t^* \cdot SE.

You use tt, not zz, because you estimate the unknown population standard deviation with the sample value ss. That extra uncertainty makes the tt distribution wider than zz, and the gap shrinks as nn grows. The degrees of freedom df=n1df = n - 1 tell you which row of the tt table to read.

This is a one-sample t-interval for a population mean. The same recipe works on the differences when you have paired data.

Critical values for 90, 95, and 99 percent confidence

For a proportion the critical value zz^* depends only on the confidence level:

Confidence levelz*
90%1.645
95%1.960
99%2.576

A 95 percent confidence interval for a proportion therefore uses z=1.960z^* = 1.960. You can confirm any of these values on the z table.

For a mean the critical value tt^* depends on both the confidence level and the degrees of freedom, so there is no single number. At 95% confidence, for example, t=2.776t^* = 2.776 when df=4df = 4 but t=2.262t^* = 2.262 when df=9df = 9. Always look up tt^* on the t table using df=n1df = n - 1. As nn grows large, tt^* moves toward the matching zz^*, which is why the two procedures agree for big samples.

Conditions you must check first

An interval is valid only if the sampling distribution of your statistic is roughly normal and the standard error formula holds. The AP course lists three conditions to verify before you compute.

Random. The data must come from a random sample or a randomized experiment. Without randomness the interval does not estimate the population.

10% condition. When you sample without replacement, the population must be at least 10 times the sample size, so n0.10Nn \leq 0.10 N, where NN is the population size. This keeps the standard error formula accurate.

Large counts or normal. For a proportion, check that the number of successes and the number of failures are both at least 10, that is np^10n\hat{p} \geq 10 and n(1p^)10n(1 - \hat{p}) \geq 10, so the sampling distribution is roughly normal. For a mean, the sampling distribution is roughly normal if the sample size is large (a common guideline is n30n \geq 30) or if the population is roughly normal with no strong skew or outliers when nn is small. State each check in the context of the problem rather than just writing the symbols.

How to read the interval you get

Report the interval as two numbers and interpret it in context. For a 95% interval, write: you are 95% confident that the true population value lies between the lower bound and the upper bound.

The confidence level describes the long-run method, not one particular interval. If you repeated the sampling and built an interval each time, about 95% of those intervals would capture the true parameter. For the exact wording graders reward, see what 95 percent confidence means.

To check your arithmetic on either recipe, use the confidence interval calculator. Enter the count and sample size for a proportion, or the summary statistics for a mean, and confirm the bounds match your hand calculation.

Common mistakes when building a confidence interval

**Using zz for a mean.** When you estimate the population standard deviation with the sample value ss, use tt, not zz. Reaching for zz makes the interval too narrow.

Skipping the conditions. An interval with no condition check may not be valid and loses credit on the exam. State random, the 10% condition, and large counts or normality every time.

Plugging in the wrong count. For a proportion, divide successes by nn to get p^\hat{p} first. Do not put the raw number of successes into the standard error formula.

Rounding the critical value too early. Keep zz^* or tt^* to at least three decimals until the final step, or your bounds can drift.

Reading the interval as a probability. A 95% interval does not mean there is a 95% chance the parameter is inside it. The parameter is fixed, and the confidence describes the method across many samples.

95% confidence interval for a proportion

In a random sample of 200 registered voters, 120 say they support a new transit measure. Build a 95% confidence interval for the true proportion of all registered voters who support it. Assume the 200 voters are fewer than 10% of all registered voters.

  1. Find the sample proportion: p^=120200=0.6\hat{p} = \frac{120}{200} = 0.6 (this is p-hat, the proportion from the sample).

  2. Check conditions. Random and the 10% condition are given. Large counts: np^=200(0.6)=12010n\hat{p} = 200(0.6) = 120 \geq 10 and n(1p^)=200(0.4)=8010n(1 - \hat{p}) = 200(0.4) = 80 \geq 10. All three conditions hold.

  3. Critical value for 95% confidence: z=1.960z^* = 1.960.

  4. Standard error: SE=0.6(0.4)200=0.24200=0.0012=0.03464SE = \sqrt{\frac{0.6(0.4)}{200}} = \sqrt{\frac{0.24}{200}} = \sqrt{0.0012} = 0.03464.

  5. Margin of error: zSE=1.960×0.03464=0.06789z^* \cdot SE = 1.960 \times 0.03464 = 0.06789.

  6. Build the interval: 0.6±0.0679=(0.5321, 0.6679)0.6 \pm 0.0679 = (0.5321,\ 0.6679).

The 95% confidence interval is about (0.532, 0.668). You are 95% confident that between 53.2% and 66.8% of all registered voters support the transit measure.

95% confidence interval for a mean

A random sample of 5 phone batteries lasts 6, 8, 10, 12, and 14 hours on a standard test. Battery life is assumed to be roughly normal. Build a 95% confidence interval for the true mean battery life.

  1. Sample mean: xˉ=6+8+10+12+145=505=10\bar{x} = \frac{6 + 8 + 10 + 12 + 14}{5} = \frac{50}{5} = 10 hours (this is x-bar).

  2. Deviations from the mean: 4,2,0,2,4-4, -2, 0, 2, 4. Squared: 16,4,0,4,1616, 4, 0, 4, 16, which sum to 4040.

  3. Sample standard deviation: s=4051=404=10=3.1623s = \sqrt{\frac{40}{5 - 1}} = \sqrt{\frac{40}{4}} = \sqrt{10} = 3.1623 hours.

  4. Check conditions: the sample is random, the population is assumed roughly normal, and 5 batteries is well under 10% of all such batteries.

  5. Critical value for 95% confidence with df=51=4df = 5 - 1 = 4: t=2.776t^* = 2.776.

  6. Standard error: SE=sn=3.16235=3.16232.2361=1.4142SE = \frac{s}{\sqrt{n}} = \frac{3.1623}{\sqrt{5}} = \frac{3.1623}{2.2361} = 1.4142 hours.

  7. Margin of error: tSE=2.776×1.4142=3.926t^* \cdot SE = 2.776 \times 1.4142 = 3.926 hours.

  8. Build the interval: 10±3.926=(6.074, 13.926)10 \pm 3.926 = (6.074,\ 13.926).

The 95% confidence interval is about (6.07, 13.93) hours. You are 95% confident that the true mean battery life is between 6.07 and 13.93 hours. The interval is wide because the sample is small.

Frequently asked questions

When do I use z and when do I use t for a confidence interval?

Use a z critical value for a proportion, because the standard error is built from the sample proportion. Use a t critical value for a mean, because you estimate the population standard deviation with the sample value s. The t interval uses degrees of freedom equal to n - 1.

What is the z* for a 95 percent confidence interval?

For a proportion, a 95 percent confidence interval uses z = 1.960. A 90% interval uses 1.645 and a 99% interval uses 2.576. For a mean you use a t value instead, which also depends on the degrees of freedom.

Why is my confidence interval so wide?

An interval widens when the sample is small, the data varies a lot, or the confidence level is high. Increasing the sample size shrinks the standard error and narrows the interval. Lowering from 99% to 90% confidence also narrows it, but you accept a higher chance of missing the true value.

How do I find the margin of error from a confidence interval?

The margin of error is the critical value times the standard error, the plus-or-minus part of the interval. You can also read it off a finished interval by subtracting the lower bound from the upper bound and dividing by 2. That value is half the total width.