Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Confidence Interval Calculator

Enter a sample mean and standard deviation, or a count of successes, with the sample size and a confidence level such as 95. Get the interval, the margin of error and every step, including the exact t critical value for your degrees of freedom.

For a proportion, a whole number above 1 is read as a count of successes; a value from 0 to 1 as p̂.

Examples

About the Confidence Interval Calculator

A single sample average is almost never exactly equal to the population average it estimates. A confidence interval puts a range around the estimate that reflects how much it would vary from sample to sample, which is why surveys report results such as “54%, plus or minus 3 points”.

This calculator handles the three intervals taught in introductory statistics and AP-level courses: a z interval for a mean when the population standard deviation is known, a t interval when it is estimated from the sample, and a one-proportion z interval. The t critical values are computed for any degrees of freedom, not read from a short table.

What is a confidence interval?

A confidence interval is an estimate plus or minus a margin of error: estimate ± critical value × standard error. The standard error measures how much the estimate typically varies between samples. The critical value sets how many standard errors to go out on each side to reach the chosen confidence level.

The confidence level describes the method, not one particular interval. If many samples were taken and a 95% interval built from each, about 95% of those intervals would contain the true population value. Any single interval either contains it or does not; we just do not know which.

How to use the Confidence Interval Calculator

  1. Choose the interval type: mean with σ known, mean with s, or proportion.
  2. For a mean, enter the sample mean and the standard deviation.
  3. For a proportion, enter the number of successes or the sample proportion.
  4. Enter the sample size n and the confidence level as a percentage.
  5. Press Calculate interval and read the bounds and margin of error.

Formulas

z interval for a mean

xˉ±z∗σn\bar x \pm z^*\frac{\sigma}{\sqrt n}

t interval for a mean

xˉ±tn−1∗sn\bar x \pm t^*_{n-1}\frac{s}{\sqrt n}

Interval for a proportion

p^±z∗p^(1−p^)n\hat p \pm z^*\sqrt{\frac{\hat p(1-\hat p)}{n}}

Common z critical values

90%:1.645,95%:1.960,99%:2.57690\%: 1.645,\quad 95\%: 1.960,\quad 99\%: 2.576

Worked example: t interval: x̄ = 52.3, s = 6.1, n = 10, 95%

The worked example uses a sample of 10 with mean 52.3 and standard deviation 6.1. The standard error is 6.1/10≈1.9296.1 / \sqrt{10} \approx 1.929, and with 9 degrees of freedom the 95% critical value is t∗≈2.262t^* \approx 2.262.

The margin of error is 2.262×1.929≈4.3642.262 \times 1.929 \approx 4.364, so the 95% interval is about (47.94, 56.66)(47.94,\ 56.66). Had σ = 6.1 been known, the z value 1.960 would give a narrower interval of about (48.52, 56.08)(48.52,\ 56.08).

The solution below is generated by the same engine that powers the calculator above.

Final answer

(47.9363, 56.6637)(47.9363,\ 56.6637)

How we read your problem

Build a 95% confidence interval for the population mean μ.

95% CI for μ, xˉ=52.3, s=6.1, n=1095\%\ \text{CI for } \mu,\ \bar x = 52.3,\ s = 6.1,\ n = 10

Step-by-step solution

  1. Standard error of the mean

    SE=sn=6.110≈1.92899SE = \frac{s}{\sqrt n} = \frac{6.1}{\sqrt{10}} \approx 1.92899
  2. Critical value for 95% confidence

    The middle 95% leaves 2.5% in each tail. σ is estimated by s, so the critical value comes from the t distribution with 9 degrees of freedom.

    t9∗=2.26216t^*_{9} = 2.26216
  3. Margin of error

    E=t9∗×SE=2.26216×1.92899≈4.36368E = t^*_{9} \times SE = 2.26216 \times 1.92899 \approx 4.36368
  4. Interval: estimate ± margin

    52.3±4.36368=(47.9363, 56.6637)52.3 \pm 4.36368 = (47.9363,\ 56.6637)

Formulas used

  • t interval

    xˉ±tn−1∗ s/n\bar x \pm t^*_{n-1}\, s/\sqrt n

We are 95% confident that the population mean μ lies between 47.9363 and 56.6637. The confidence describes the method: about 95% of intervals built this way from repeated samples would capture the true value.

Verification

  • The interval is centred on the estimate: (47.9363 + 56.6637) / 2 = 52.3.

Detailed explanation

z or t?

Use z only when the population standard deviation σ is genuinely known, which is rare outside textbook exercises. When the spread is estimated by the sample standard deviation s, the extra uncertainty is accounted for by the t distribution, which has heavier tails and therefore larger critical values.

The difference matters most for small samples. With 4 degrees of freedom the 95% t value is about 2.776; with 29 it is 2.045; with 100 it is 1.984, already close to the z value of 1.960.

Conditions for a proportion interval

The proportion interval relies on a normal approximation that works when there are enough successes and failures. A common rule asks for at least 10 of each, so both np^n\hat p and n(1−p^)n(1-\hat p) should be 10 or more. The calculator checks this and warns you when it fails.

In a poll where 540 of 1000 people say yes, p^=0.54\hat p = 0.54, the standard error is about 0.0158, and the 95% interval is about (0.509, 0.571)(0.509,\ 0.571), or 54% ± 3.1 percentage points.

What changes the width

Three things control the margin of error. A higher confidence level widens the interval. More spread in the data widens it. A larger sample narrows it, but only with the square root of n: to halve the margin of error, you need four times as many observations.

This is why national polls often use samples of around 1000. Going to 4000 would cost four times as much and only shrink a 3-point margin to about 1.5 points.

Common mistakes

  • Saying there is a 95% probability that the true mean lies in this particular interval.
  • Using z when only the sample standard deviation is known.
  • Using n instead of n − 1 for the degrees of freedom.
  • Forgetting to take the square root of n in the standard error.
  • Using a proportion interval when there are fewer than 10 successes or failures.

Tips

  • Report the interval in context, with units, and the confidence level.
  • Check that the sample is random and the observations independent.
  • For small samples, look at the data for strong skew or outliers before using t.
  • Use the standard deviation calculator to get s from raw data first.
  • Use the z-score calculator to explore normal probabilities behind z*.

Frequently asked questions

How do I calculate a 95% confidence interval?

Take the estimate and add and subtract 1.96 standard errors for a z interval, or t* standard errors with n − 1 degrees of freedom for a t interval.

What does 95% confidence actually mean?

About 95% of intervals built by this method from repeated random samples would contain the true value; it is a property of the method.

When should I use a t interval instead of z?

Use t whenever the population standard deviation is unknown and estimated by the sample standard deviation s.

How many degrees of freedom does a one-sample t interval have?

It has n − 1 degrees of freedom, where n is the sample size.

How does sample size affect the margin of error?

The margin of error shrinks with the square root of n, so four times the sample size halves the margin.

Can I enter the number of successes for a proportion?

Yes. A whole number above 1 is read as a count and divided by n; a value from 0 to 1 is read as the sample proportion.

Why is a 99% interval wider than a 95% interval?

Higher confidence needs a larger critical value, 2.576 instead of 1.960 for z, so the interval stretches further to capture the true value more often.

Build a confidence interval

Choose the interval type above and enter your sample statistics to get the bounds with every step.

More math calculators