Skip to content

Confidence interval calculator

Paste raw data or enter summary values; see the confidence interval, the margin of error and the critical value for a mean, a proportion and the difference of two means. Compare the Wilson interval with the Wald interval side by side to see why Wald falls short, and follow the interval in the chart.

Free tool · Data analytics
Interval for what?

The mean of one group. t is used when the population standard deviation is unknown, z when it is known.

Data input

Separate values with new lines, spaces, tabs or semicolons (a column copied from Excel works). Use a point or a comma as the decimal mark; do not type thousands separators. Parts that are not numbers are skipped.

The calculation runs in your browser; the data you paste is not sent anywhere.

Enter it if you drew the sample without replacement from a limited population and n exceeds 5% of N; if left empty the population is treated as infinite.

Enter data or load the sample.

Would you like to report your survey, quality sampling or experiment results with reliable intervals? Let us look at it together.

Request a call

01

How to use

  1. A

    Choose what the interval is for (a mean, a proportion or the difference of two means); paste raw data or enter summary values.

  2. B

    Choose the confidence level (90%, 95%, 99% or custom); enter N if the population is limited, and σ if σ is known for a mean.

  3. C

    Read the interval, the margin of error and the critical value; for a proportion compare Wilson and Wald, check the position of the interval in the chart and copy the result.

02

What does a confidence interval say, and what does it not?

A confidence interval is a band of plausible values for an unknown (a mean, a proportion, a difference) estimated from a sample. 95% confidence means the method, in the long run, produces intervals that contain the true value 95% of the time. For the single interval in your hands, saying "the true value is here with 95% probability" is a wrong reading; the true value is fixed, while the interval changes from sample to sample.

The width of the interval measures uncertainty. More observations shrink the standard error: to halve the interval you need roughly four times the sample. Raising the confidence level (99% instead of 95%) widens the interval; being surer costs a less precise interval.

03

Mean and difference: t or z?

If you do not know the population's standard deviation (almost always the case), the sample standard deviation is used and the critical value comes from the Student t distribution with n − 1 degrees of freedom. In small samples the t distribution gives a wider interval than z; this accounts for the fact that the standard deviation is estimated too. As n grows t and z approach each other.

If σ is truly known (for example the documented spread of a calibrated measuring instrument) the z interval is used. For the difference of two independent means Welch is the default; it does not assume equal variances and finds the degrees of freedom with the Welch–Satterthwaite formula. If the interval does not contain zero, the difference is significant at the same level.

04

Proportion: Wilson and the weakness of Wald

The Wald interval p̂ ± z·√(p̂(1−p̂)/n) is common in textbooks because it is simple, but it is not reliable. With a small n or when p̂ is near 0 or 1 its true coverage can fall well below the stated level; at p̂ = 0 the interval collapses to a single point ("no defects" does not mean no uncertainty) and its ends can run outside 0–1.

The Wilson (score) interval gives much more accurate coverage from the same input, stays within 0–1 and yields a meaningful upper bound even at p̂ = 0: with n = 10 and no defects the 95% upper bound is about 27.8%. That is why the tool shows both side by side and recommends Wilson. With a very small n or extreme proportions an exact (Clopper–Pearson) interval is safer still; this tool does not compute it.

FAQ

Does a 95% confidence interval mean the true value lies in it with 95% probability?
No, that is a very common misreading. The 95% is the long-run success rate of the method that produced the interval: if we repeated the procedure many times, about 95% of the intervals would contain the true value. For the single interval in your hands the true value is either inside or not; the probability belongs to the method, not to the interval.
What should I do to narrow the interval?
Increase the sample size or make the data less variable (better measurement). The width falls roughly with 1/√n: halving it takes four times the observations. Lowering the confidence level also narrows the interval but is deceptive, because you have only agreed to be less sure.
Should I use Wilson or Wald for a proportion?
Wilson. Wald gives reasonable results only for a large n and a middling p̂ (both n·p̂ and n·(1−p̂) at least 10); in a small sample or at extreme proportions its true confidence level falls below the stated one. Wald is shown so you can compare with sources.
When should I choose between t and z?
Use t if you do not know σ, which is the case for nearly all real data. z is correct only when the population standard deviation is known reliably from outside. Beyond n = 30 the two give very close results.
When is the finite population correction needed?
If you drew the sample without replacement from a limited population (for example a customer list of 800) and n is larger than about 5% of N. The standard error then shrinks by √((N−n)/(N−1)) because you have already seen a sizeable part of the population. With a very large or unknown population no correction is made.
If two intervals overlap, is the difference insignificant?
Not always. Two separate confidence intervals overlapping slightly does not rule out a significant difference; the right way is to look at the confidence interval of the difference itself. The "Difference of two means" mode in this tool gives that directly: if the interval does not contain zero, the difference is significant at that level.

Let us report your results with reliable intervals

Let us work out together how uncertain the means and proportions in your production, sales or field data are, and what precision you reach with which sample size.