Skip to content
MasterMath

Confidence Interval Calculator

The confidence interval for the mean from your data, using Student's t, which is what applies when the population deviation is unknown — which is always.

Confidence interval

—

Confidence interval—
Sample mean—
Margin of error—
Standard error—
Critical value—
Number of values—
MeasureValue

How this was worked out

    The formula

    x̄ ± t · s / √n

    What it means

    A 95 % confidence interval does not say the real mean is inside it with 95 % probability: it says that if you repeated the study many times, 95 % of the intervals you built would contain the real mean. It sounds the same and it is not, and the difference matters as soon as someone reads it as a bet. The width depends on three things: how much the data vary, how many there are and how much confidence you ask for.

    How to work it out by hand

    1. Work out the mean and the standard deviation of the sample
    2. Work out the standard error: the deviation over the square root of n
    3. Look up the critical t value for n − 1 degrees of freedom and your confidence level
    4. Add and subtract the critical value times the standard error from the mean

    What is worth knowing

    Student's t is used rather than the normal because the real population deviation is unknown and gets estimated from the sample itself, which adds an uncertainty the t accounts for and the normal does not. With plenty of data the two nearly coincide; with fifteen values the difference already shows. And moving from 95 % to 99 % widens the interval by around thirty per cent: more confidence is always less precision, and there is no way to have both.

    Frequently asked questions

    What does the 95 % actually mean?

    That if you repeated the sampling many times, 95 % of the intervals built this way would contain the real mean. It is not the probability that this particular mean is inside.

    Why the t and not the normal?

    Because you do not know the population deviation: you estimate it from the sample. The t accounts for that extra uncertainty.

    How do I narrow the interval?

    More data, or accepting less confidence. Quadrupling the sample halves the width.

    Does it work with small samples?

    Yes, and that is where the t makes the difference. With fewer than thirty values the normal gives an interval that is too narrow.

    What if the data are not normal?

    With large samples the interval holds up rather well thanks to the central limit theorem. With few values and heavy skew, it does not.