Math

Confidence Interval Calculator

Find the confidence interval and margin of error for a mean or a proportion from your sample.

Rules last checked 25 October 2026Every step shown

Your numbers are saved in this browser.

95% confidence interval

69.8135 to 75.1865

Margin of error
2.6865
t value
2.0227 (39 degrees of freedom)

The true mean is likely between 69.814 and 75.186 (95% confidence, n = 40).

How it's worked out

  1. Margin of errort × s ÷ √n = 2.023 × 8.4 ÷ √402.6865

The formulas

Mean: x̄ ± t × s ÷ √n · Proportion: p̂ ± z × √(p̂(1 − p̂) ÷ n)

With fewer than 10 yes or no answers in the sample, that proportion formula breaks down (at 0% or 100% it gives an interval with no width), so the calculator switches to the Wilson interval.

Worked example

40 students with a mean mark of 72.5 and a standard deviation of 8.4: t (39 degrees of freedom) is 2.023, so the margin is 2.023 × 8.4 ÷ √40 = 2.69, and the 95% interval runs from 69.81 to 75.19.

Questions people ask

What does a 95% confidence interval mean?

If you repeated the sampling many times, about 95% of the intervals worked out this way would contain the true value.

When is a t value used instead of z?

For a mean estimated from the sample's own standard deviation, especially with small samples. The calculator uses t with n − 1 degrees of freedom.

How do I make the interval narrower?

Use a bigger sample: the margin of error shrinks with the square root of the sample size.

About this calculator

Formula and rules last checked 25 October 2026Written and tested by the CalculatorDex teamReport a problem