Skip to content

Confidence Interval Calculator

Estimate a population mean or proportion from a sample. Choose the mean interval that matches your standard deviation, or enter a success count for a Wilson proportion interval.

Free, no sign-up · Last updated

Estimate

Use the sample standard deviation.

US defaults ·

95% confidence interval

45.8722029 to 54.1277971

Sample estimate
50
Margin of error
4.1277971
Critical value2.0638986
Standard error2
Degrees of freedom24

The two-sided interval assumes an independent, representative sample. For small t samples, check that the population is approximately normal.

Definition

What a confidence interval means

A confidence interval is a range calculated from sample data to estimate an unknown population quantity. At a stated confidence level, the method would produce intervals containing the true quantity that proportion of the time over repeated samples, under its assumptions.

For a mean
Use the sample mean, spread and count
For a proportion
Use successes and total observations
Higher confidence
Widens the interval for the same sample

Decide what you are estimating

For a quantitative measurement such as setup time, a mean interval expresses uncertainty about the population’s average time. It needs a sample mean, spread and observation count. For an outcome such as whether a part fails inspection, a proportion interval starts from the number of recorded successes and the total observed.

Treat the unit of observation consistently. If one person is measured several times, entering every result as though it came from a separate randomly chosen person can make uncertainty appear smaller. Clustered data and weighted samples generally need an interval designed for their sampling structure.

Compare the t and z mean calculations

Both methods scale the standard deviation by the square root of the sample size to obtain a standard error. They then multiply it by a critical value that depends on the confidence level. For t, the critical value also depends on degrees of freedom. At small sample sizes it can be much larger than its normal counterpart.

Use a two-sided level that matches the question. The calculation places the remaining probability equally in the two tails. Raising the confidence level increases the critical value and generally widens the range, with the same inputs.

Understand the Wilson proportion result

The Wilson score method bases the interval on a binomial sampling model. It uses the sample size and share of successes together, and keeps the endpoints within the range of possible proportions. Near an endpoint, read both bounds rather than assuming the sample share is centered between them.

A percentage point is an absolute difference between percentages. When a Wilson interval has an adjusted midpoint, the displayed half-width in percentage points describes the spread on either side of that midpoint. Use the reported endpoints if you need distances from the observed sample proportion.

Check the limits of the interpretation

An interval measures sampling uncertainty under its assumed model. It does not correct selection bias, measurement error, or responses that are systematically missing. A narrow interval can still surround a poor estimate if the data were not representative of the population you want to describe.

For a small mean sample, check whether the data are reasonably compatible with the approximate normality that the t procedure needs. A severe outlier or long tail can make a short summary hide important features. Report the method, confidence level and sample count along with the bounds.

Step-by-step example

Use a two-sided 95% Student’s t interval for a sample of 25 with mean 50 and sample standard deviation 10.

StepResult
Standard error2
Critical t value2.0639
Margin of error4.1278
Lower bound45.8722
Upper bound54.1278

Formulas used

Two-sided interval for a mean

Standard error = standard deviation ÷ √n.

Margin = critical value × standard error.

Interval = mean ± margin. Use the normal critical value for z and Student’s t with n − 1 degrees of freedom for t.

n
number of observations
z
standard normal critical value
t
Student’s t critical value

Example: A sample mean of 50, sample standard deviation 10 and n = 25 at 95% confidence give t ≈ 2.0639 and a margin of 4.1278. The bounds are 45.8722 and 54.1278.

Wilson score interval

Let p = successes ÷ n, z be the normal critical value and w = z²/n.

Center = (p + w/2) ÷ (1 + w).

Half-width = z × √[(p(1 − p) + w/4) ÷ n] ÷ (1 + w).

p
observed proportion of successes
n
number of observations
z
standard normal critical value
w
adjustment equal to z² divided by n

Example: For 40 successes in 100 observations at 95% confidence, the Wilson interval is 30.9401% to 49.7997%.

When the answer can mislead

  • A confidence interval for a mean can be much narrower than the spread of individual observations.
  • A narrow interval can still miss the true value when the sampling method is biased.
  • A two-sided 95% interval and a one-sided 95% bound use different critical values.

Questions

What does a 95% confidence interval mean?

If you repeatedly drew samples the same way and constructed intervals with the same method, about 95% of the resulting intervals would capture the fixed population parameter under the model. A single computed interval gives the range from your observed sample, and its interpretation depends on how the data were collected.

When should I choose t instead of z?

Choose t when you estimate the population spread with the sample standard deviation. The t multiplier accounts for that extra uncertainty and uses one fewer degree of freedom than the sample size. Choose z when you have the actual population standard deviation for the mean calculation.

Why is the proportion interval asymmetric?

The Wilson method adjusts the center of the interval toward one-half. This helps the endpoints behave near zero and one, where a symmetric interval centered on the observed proportion can extend outside the possible range. The reported half-width is measured from the adjusted center.

What happens when there are zero successes?

A sample with zero successes produces a point estimate of zero. Its Wilson upper bound can still be positive, because a population with some successes can produce a sample with none. Reporting the full interval communicates uncertainty that the observed proportion alone cannot show.

Is this the range where individual observations will fall?

A confidence interval for a mean concerns the population’s average, which can be estimated fairly precisely even when individual observations vary widely. To describe individual future observations, use a prediction interval fitted to the relevant model. To describe the observed variation, look at the raw data and spread statistics.

Sources

  1. NIST: Confidence intervals for a population mean
  2. NIST: Wilson confidence intervals for proportions
Last updated How we check
Embed this calculator
Cite this calculator

Confidence Interval Calculator. CalculatorLab. https://calculatorlab.site/calculators/confidence-interval-calculator/. Last updated .