Skip to main content
CalcMax

Confidence Interval Calculator

Minimum: 2

Minimum: 0

Range: 0 – 100

Result

47.6189

Lower bound

Upper bound
52.3811
Margin of error
2.3811
Standard error
1.2000
Critical value
1.9842

A confidence interval calculator turns a single sample into a range of plausible values for the quantity you are estimating, whether that is a population mean or a proportion. It prints both bounds, the margin of error that produced them, the standard error of the estimate, and the critical value it was multiplied by, so the interval can be taken apart rather than only quoted. Which critical value applies depends on what is being estimated: a mean uses the t distribution with n − 1 degrees of freedom, a proportion uses the normal distribution.

Formula

mean: x̄ ± t(α/2, n − 1) · s / √n proportion: p̂ ± z(α/2) · √( p̂ (1 − p̂) / n )

x̄
The sample mean — the number you measured, in whatever units the data is in. The interval is built around it, so the whole range shifts when it shifts
s
The sample standard deviation, the spread of the observations around their own mean. It is s rather than σ because a sample is all you have; dividing it by the square root of the sample size is what turns it into the standard error
n
How many observations the sample holds, at least 2. It enters the calculation twice: inside the standard error, and again through the degrees of freedom of the t quantile, which is n − 1
t(α/2, n − 1)
The critical value for a mean: the point on a t distribution with n − 1 degrees of freedom that leaves half of α in each tail. It is always a little larger than the normal critical value and much larger for small samples, which is the t distribution paying for the fact that s was estimated rather than known
p̂
The sample proportion, entered as a percentage. The whole proportion calculation stays in percentage points, so the bounds, the margin of error and the standard error all sit on the same scale as the number you typed
z(α/2)
The critical value for a proportion: 1.9600 at 95% confidence, and the same value at every sample size, because a proportion is judged against the normal distribution rather than the t. It appears twice in the proportion row, once outside the root and once inside through p̂

Use it when you have a sample and want to say how precise the estimate from it is — a mean from a handful of measurements, or a share from a survey. It is the honest way to report a single number: a mean of 50 with 100 observations is a different claim from a mean of 50 with 5, and the interval is the difference, because the sample size sits in the denominator of the standard error. Two settings decide everything else. Pick the mean branch when the quantity is a measurement — a length, a time, a score — and the proportion branch when it is a headcount out of a total, entered as a percentage. Then pick the confidence level: 95% is the convention, and the three levels offered cover almost every published figure. Note what the interval does not do — it does not say where the true value is, and it does not say what share of future observations will fall inside it. It is a statement about the estimating procedure, not about the data.

Worked examples

  1. A mean from a sample of 100 measurements

    1. Standard error: 12 / √100 = 12 / 10 = 1.2
    2. Degrees of freedom: n − 1 = 99, which gives a critical value of 1.9842 at 95% confidence
    3. Margin of error: 1.9842 × 1.2 = 2.3811
    4. Bounds: 50 − 2.3811 = 47.6189 and 50 + 2.3811 = 52.3811

    The critical value is the number worth noticing here: 1.9842 rather than the familiar 1.96. The gap is what the t distribution charges for estimating the spread from the same 100 observations, and it shrinks as the sample grows — at n = 1000 it has all but vanished. Also note that the proportion field still holds 60 and does nothing: the two input groups are both always on screen, and the select at the top decides which one the formula uses.

  2. A proportion from a poll of 1000 people

    1. Sample proportion 50% is 0.5 in decimal form, and 1 − p̂ = 0.5 as well
    2. Standard error: √( 0.5 × 0.5 / 1000 ) = 0.015811, which is 1.5811 percentage points
    3. Critical value: 1.96 at 95% confidence, the same at every sample size
    4. Margin of error: 1.96 × 1.5811 = 3.099 percentage points, giving the bounds 46.901% and 53.099%

    Every number in this example is in percentage points, not in proportions: the standard error is 1.58 points rather than 0.0158. That is the scale convention the page uses for a proportion, and it is why the standard error here looks large next to the one in the first example — it is measuring a different thing, a share rather than a measurement. The same calculation is the source of the familiar claim that a poll of about a thousand people carries a margin of error of roughly three points.

  3. The same 100 observations reported at 99% confidence

    1. The standard error is unchanged at 12 / √100 = 1.2, because nothing about the sample changed
    2. Only the critical value moves: 2.6264 instead of 1.9842
    3. Margin of error: 2.6264 × 1.2 = 3.1517
    4. Bounds: 50 ± 3.1517, so 46.8483 to 53.1517

    Comparing this with the first example isolates exactly what the confidence level buys: the same data, the same standard error, and an interval 32% wider. Nothing was learned by raising the level — the information in the sample did not change, only the claim made about it. That is why 95% is the convention, and why quoting a 99% interval without saying so is misleading rather than merely conservative.

Limitations

Both branches assume the observations are independent of one another. A sample of 500 readings from the same instrument, or of 500 students from 20 classrooms, carries less information than the arithmetic believes, and the interval comes out narrower than it should. Both also assume the estimate is roughly symmetric around the truth: the mean branch leans on the sample being approximately normal, or on n being large enough for the t distribution to be forgiving, and the proportion branch is the more fragile of the two — near 0% or 100% the formula is simply the wrong one, which is why the page refuses those two values rather than returning a confidently narrow interval around a proportion that cannot be estimated that way. Finite populations are not corrected here. If the sample is a large share of a small population, the sample size page applies the correction and will ask for fewer people than this one implies.

Frequently asked questions

What does a confidence interval actually mean?
It is a range built by a procedure that captures the true value in 95% of samples, at the 95% setting — not a 95% chance that this particular range contains it. The distinction matters because the true value is fixed and unknown: it is either inside the bounds you just computed or outside them, and no probability attaches to that. What the number describes is the reliability of the method. In practice the reading people use is that values near the middle of the interval are more plausible than values near the ends, and that a value outside the interval is in some tension with the data — which is the bridge to the hypothesis tests on the p-value page.
Why does a mean use t and a proportion use z?
Because with a mean you are estimating the spread as well as the centre, and with a proportion you are not. The standard error of a mean is s / √n, and s is itself computed from the same sample, so the interval has to allow for that extra uncertainty — which is exactly what the t distribution does, and why its critical value is 1.9842 at n = 100 rather than 1.96. A proportion has no such second estimate: the spread of the estimate follows from the proportion itself, through p̂(1 − p̂), so the normal distribution applies at every sample size. Both input groups are always visible on screen; the select at the top decides which one the calculation reads.
What is the difference between the margin of error and the standard error?
The standard error is one unit of uncertainty and the margin of error is how many units the interval reaches out. The margin of error is the standard error multiplied by the critical value, so at 95% confidence with a large sample it is about twice the standard error (1.96 times it) and at 99% it is about two and a half times (2.5758). Both rows are printed so the two-step structure is visible: if you want a narrower interval, the standard error row is the one to attack, because it is the only one that responds to collecting more data. The critical value moves only when you change the confidence level.
Can the interval run below 0% or above 100%?
Yes, and the page will print it rather than silently clipping it. At 50% with a sample of 2 the bounds are −19.3% and 119.3%, which is not a bug: with two observations there is genuinely almost no information about a proportion, and an interval that says so is more honest than one clamped to the range a proportion can actually take. Read it as "this sample cannot estimate anything useful here" and collect more data. What the page does refuse is a proportion entered as exactly 0% or 100%, because at those two points the formula divides by a zero-width spread and would return a zero-width interval — a claim of certainty the method cannot support.
Where is the table of critical values?
There is none on this page, and that is deliberate. Everything a critical-value table is used for here is already done: you choose a level, and the one value that level implies is printed in its own row. A table would also have to pick a confidence level to be built at, so a reader who switched to 99% would be looking at a table that contradicts the panel above it — the failure mode where a page disagrees with itself. The t distribution has a further problem, since its critical value depends on the degrees of freedom as well as the level, which would mean a whole grid rather than a table. The dedicated critical value tool, which takes the level and the degrees of freedom as inputs, is the place for that lookup.

References

Related calculators