Confidence Interval Calculator - Mean & Proportion

Calculate a confidence interval for a mean or proportion. The Confidence Interval Calculator uses t when sigma is unknown and shows every step.

01 calculator

Results update as you type. No submit button.

Result

    Show the working

      The Confidence Interval Calculator builds a confidence interval for a population mean or a population proportion from sample summary figures. Enter the sample mean (or proportion), the standard deviation or count of successes, the sample size and the confidence level; the calculator returns the lower and upper bounds with the critical value and standard error shown.

      When σ is unknown, the default uses the t distribution. That choice keeps small-sample intervals from becoming falsely narrow, a common failure mode in tools that always use z.

      Calculate a confidence interval for a mean

      Histogram of 7 bins with the mean markedmean
      Calculate a confidence interval for a mean.

      A mean confidence interval estimates a range for the population mean from one sample's summary figures. Required inputs are the sample mean, the sample size, a standard deviation, and a confidence level such as 90, 95 or 99 percent.

      The output is a lower bound and an upper bound; wider intervals reflect smaller n, larger spread or a higher confidence level.

      The output is (lower, upper). Wider intervals reflect more uncertainty: smaller n, larger s, or higher confidence level all widen the band.

      Choose between the t and z distributions

      Histogram of 7 bins with the mean markedmean
      Choose between the t and z distributions.

      Use z when the population standard deviation σ is known (rare outside textbook setups) or when n is very large and a normal approximation is accepted. Use t when σ is unknown and you estimate it with s. Degrees of freedom = n − 1.

      Always-on z intervals from tools that ignore this choice are too narrow on small samples. On n equals 10 with unknown sigma the t critical value at 95 percent is about 2.262 rather than 1.96, roughly a 15 percent wider margin before any other factor changes. That gap is a correctness issue, not a cosmetic preference.

      The t distribution has heavier tails than z, so critical values are larger at the same confidence level, especially below n ≈ 30. Always-on z intervals understate uncertainty on small samples. This calculator defaults to t whenever you enter s rather than σ.

      Apply the confidence interval formula

      Formula result = f(inputs), with variables: in is inputs, f is formula, out is resultresult = f(inputs)ininputsfformulaoutresult
      Apply the confidence interval formula.

      The mean interval is the sample mean plus or minus a critical value times the standard error. With known sigma the critical value is z; with unknown sigma it is t with n minus 1 degrees of freedom.

      The product of critical value and standard error is the margin of error, subtracted for the lower bound and added for the upper bound.

      x̄ ± z(α/2) × (σ / √n)

      Mean with unknown σ:

      x̄ ± t(α/2, n−1) × (s / √n)

      The product of critical value and standard error is the margin of error. Subtract it from x̄ for the lower bound; add it for the upper bound.

      Calculate a 95 percent interval for a mean of 20.6

      Histogram of 7 bins with the mean markedmean
      Calculate a 95 percent interval for a mean of 20.6.

      Given mean 20.6, sample standard deviation 3.2 and n of 50 at 95 percent confidence, sigma is unknown so t with 49 degrees of freedom applies. Standard error is 3.2 over square root of 50, about 0.4525. Critical t is about 2.010, so the margin of error is about 0.910 and the interval runs from about 19.69 to 21.51.

      1. Standard error. SE = 3.2 / √50 = 3.2 / 7.071 ≈ 0.4525.

      2. Critical t. t(0.025, 49) ≈ 2.010.

      3. Margin of error. E = 2.010 × 0.4525 ≈ 0.910.

      4. Interval. 20.6 − 0.910 = 19.69, and 20.6 + 0.910 = 21.51.

      A z-based interval with 1.96 would be slightly narrower (about 19.71 to 21.49). On n = 50 the gap is small; on n = 10 it would matter more.

      Calculate a confidence interval for a proportion

      Concept diagram: Inputs leads to a confidence interval for a… leads to ResultInputsa confidence intervalfor a…Result
      Calculate a confidence interval for a proportion.

      For a sample proportion, the large-sample interval is p-hat plus or minus z times the square root of p-hat times one minus p-hat over n. Forty-two successes in 100 trials give p-hat 0.42; at 95 percent the margin is about 0.097 and the interval about 0.323 to 0.517.

      The calculator warns when np-hat or n times one minus p-hat falls below 5.

      p̂ ± z(α/2) × √(p̂(1 − p̂) / n)

      Example: 42 successes in 100 trials → p̂ = 0.42. At 95%, z = 1.96. SE = √(0.42 × 0.58 / 100) = √0.002436 ≈ 0.0494. E ≈ 1.96 × 0.0494 ≈ 0.0967. Interval ≈ (0.323, 0.517).

      This large-sample (Wald) form weakens when n is small or p̂ is near 0 or 1. The calculator warns when np̂ or n(1−p̂) is below 5.

      Interpret a confidence interval correctly

      Concept diagram: Inputs leads to Interpret a confidence interval… leads to ResultInputsInterpret a confidenceinterval…Result
      Interpret a confidence interval correctly.

      A 95% confidence level means that if the same sampling process were repeated many times, about 95% of the intervals constructed that way would contain the true parameter. It does not mean "there is a 95% probability that this particular interval contains the parameter" in the everyday sense people often intend.

      After the data are fixed, the realised interval either covers the true parameter or it does not. Speaking as if there is still a 95 percent chance attached to that one interval mixes frequentist coverage with a Bayesian probability claim. Keep the language tied to the method's long-run success rate.

      After the data are fixed, the interval either covers the true value or it does not. The 95% attaches to the method's long-run success rate, not to a posterior probability for one realised interval. Misreading that sentence is one of the most common interpretation errors in applied work.

      Change the confidence level

      Concept diagram: Inputs leads to Change confidence level leads to ResultInputsChange confidence levelResult
      Change the confidence level.

      Raising the confidence level widens the interval for the same data because the critical value grows. At two-sided normal levels, z is 1.645 for 90 percent, 1.960 for 95 percent and 2.576 for 99 percent.

      You cannot demand both higher confidence and tighter precision without collecting more observations; the Sample Size Calculator turns that tradeoff into an n. |---|---|---| | 90% | 1.645 | Narrower | | 95% | 1.960 | Standard choice | | 99% | 2.576 | Wider |

      Higher confidence demands a wider interval for the same data. You cannot have arbitrarily high confidence and arbitrarily tight precision without more samples. The Sample Size Calculator turns that tradeoff into an n before you collect data.

      Intervals beside tests

      Concept diagram: Inputs leads to Intervals beside tests leads to ResultInputsIntervals beside testsResult
      Intervals beside tests.

      A confidence interval and a two-sided test at matching alpha are closely related: a 95 percent interval for a mean excludes the null value roughly when a two-sided test at 0.05 rejects. The interval still adds magnitude.

      Knowing that zero is excluded is less useful than knowing the plausible range runs from 1.2 to 1.8 rather than from 0.05 to 4.0.

      For planning studies, work backwards from a desired margin of error using the Sample Size Calculator rather than discovering after the fact that the interval is too wide to decide anything.

      Display precision and rounding

      Number line from 0 to 100 with the value 23 marked025507510023
      Display precision and rounding.

      Report bounds at a precision that matches the data and the standard error. A mean measured to one decimal with SE near 0.45 does not need six decimals on the bounds. Round the final interval for display after computing with fuller precision, the same habit used for the worked example that ends at 19.69 to 21.51.

      Frequently asked questions

      What is a confidence interval?

      A confidence interval is a range computed from sample data that, under repeated sampling at the stated confidence level, covers the true parameter in that percentage of repetitions. It estimates a population mean or proportion with an explicit margin of error.

      Why use t instead of z for a mean?

      When σ is unknown and estimated by s, t accounts for that extra uncertainty. Critical t values exceed z for finite df, widening the interval appropriately.

      What does 95% confidence mean?

      About 95% of intervals produced by the same method in repeated samples would contain the true parameter. It is a property of the procedure, not a probability claim about one fixed interval after seeing the data.

      How do I shrink an interval?

      Increase n, accept a lower confidence level, or reduce variability in the measurements. Sample size is usually the controllable lever.

      Can I use this for a proportion?

      Yes. Enter successes and n (or p̂ and n). The calculator uses the normal approximation and warns when counts are too small for that approximation.

      What is the margin of error?

      The margin of error is the critical value times the standard error. It is the ± quantity added to and subtracted from the point estimate.

      Does a 95% interval mean 95% of the data lie inside it?

      No. That describes a different idea (prediction or tolerance intervals). A confidence interval targets a parameter such as a mean, not individual observations.

      Where do the critical z values come from?

      They are standard normal quantiles: 1.645, 1.960 and 2.576 for two-sided 90%, 95% and 99%. The shared stats reference file stores the same constants used across related calculators.

      Summary

      The Confidence Interval Calculator returns mean or proportion intervals with critical value, standard error and margin of error shown. Means with unknown σ use t by default; proportions use z with a sample-size warning when the normal approximation is weak.

      A 95% interval for mean 20.6 with s = 3.2 and n = 50 runs about 19.69 to 21.51. Interpret the confidence level as a long-run coverage rate of the method, raise confidence only if you accept a wider band, and use the Sample Size Calculator when planning n before you sample.