Confidence interval calculator
For a mean or a proportion, from raw data or from summary statistics. No significance verdict at the top — the range of values your data support is the finding, not a footnote to one.
Enter your data to begin
An interval answers the question a p-value cannot: not whether an effect exists, but what range of values your data are actually compatible with.
Result
Confidence interval
Point estimate
Margin of error
What this means
What it does not mean
Report it (APA)
What "95% confident" is a claim about
It is a claim about the procedure, not about this interval. Build intervals this way from many samples and about 95% of them will contain the true value. That is the guarantee, and it is a real one.
What it is not is a 95% probability that the true value lies between the two numbers in front of you. The true value is fixed; the interval is what moves. Once you have computed a specific interval it either contains the value or it does not, and nothing in the frequentist framework assigns a probability to which. If you want the statement people instinctively reach for — "given this data, there is a 95% chance the value is in here" — that is a Bayesian credible interval, and it needs a prior.
In practice the two often land in similar places, which is why the misreading persists without doing much visible damage. It is still worth knowing which one you are holding.
What makes an interval wide
Three things, and only three:
- Variability. Noisier data, wider interval. Nothing to be done except measure more carefully.
- Sample size. Width scales with 1/√n, which is a harsher relationship than it looks: to halve the width you need four times the data, and to get one decimal place more precision you need a hundred times.
- Confidence level. Demanding 99% instead of 95% widens the interval by about 30%. That is the price of being wrong less often.
The √n relationship is the one that catches people planning studies. Going from 100 to 400 observations halves your interval; going from 400 to 800 barely narrows it at all. If you need a specific precision, work out the sample size before you start — the sample size calculator does that arithmetic.
Why proportions get the Wilson interval
Almost every textbook teaches the Wald interval for a proportion: p ± z√(p(1−p)/n). It is simple, it is memorable, and it is bad enough that statisticians have been arguing against it for decades.
The failures are concrete. Its actual coverage falls well below the nominal level when p is near 0 or 1, so a "95%" Wald interval can be right far less than 95% of the time. It happily produces limits below 0 or above 1, which are impossible values for a proportion. And when every observation falls on one side — 0 successes out of 20, say — it collapses to zero width, asserting perfect certainty from twenty observations.
The Wilson score interval fixes all three by inverting the score test rather than approximating with the observed proportion. It stays inside [0, 1] by construction, keeps close to its nominal coverage at extreme p, and gives a sensible answer at 0 out of 20: roughly 0% to 16%. That is what this calculator reports.
The interval says more than the p-value
For a difference, the two agree by construction: a 95% interval excluding zero means p < 0.05. But the interval carries information the p-value discards.
Consider two studies, both reporting p = 0.04. The first has an interval from 0.2 to 14.0; the second, from 5.8 to 6.2. The p-values are identical and the findings are not remotely the same — the first has detected something without measuring it, and the second has measured it precisely. Report only the p-value and that distinction disappears.
The same applies to null results, in the direction that matters more. A non-significant result whose interval runs from −0.05 to +0.06 genuinely supports "no meaningful effect." One running from −4 to +9 means the study could not tell. Both get written up as "no significant difference," and only one of them should be.
Frequently asked questions
How do I calculate a confidence interval?
For a mean: interval = mean ± t* × (SD / √n), where t* is the critical value of the t-distribution at your confidence level with n − 1 degrees of freedom. For a proportion this calculator uses the Wilson score interval rather than the textbook p ± z√(p(1−p)/n), because the textbook version misbehaves badly when the proportion is near 0 or 1. Paste your data or enter the summary statistics above.
What does a 95% confidence interval actually mean?
It means the procedure works 95% of the time: if you repeated the study many times and built an interval the same way each time, about 95% of those intervals would contain the true value. It does not mean there is a 95% probability that this particular interval contains it — the true value is fixed and it is the interval that varies from sample to sample.
Why is the interval so wide?
Because you do not have much data, or the data vary a lot, or both. Width scales with SD / √n, which has an uncomfortable consequence: halving the width requires four times the sample. A wide interval is not a defect in the calculation — it is an accurate report of how little the study pins down, and it is exactly the information a p-value hides.
What is the difference between a confidence interval and a margin of error?
The margin of error is half the width of the interval — the ± part. "52.3 with a margin of error of 3.1" and "an interval from 49.2 to 55.4" are the same statement. Poll reporting favours the margin of error because it is one number; it is less useful for proportions near 0 or 1, where the honest interval is not symmetric.
Why does this use the Wilson interval for proportions?
Because the textbook Wald interval is genuinely unreliable. Its real coverage drops well below the nominal level when the proportion is near 0 or 1, it can produce limits below 0 or above 1, and it collapses to zero width when every observation falls on one side — claiming perfect certainty from 20 observations. Wilson has none of those failure modes and needs no continuity correction. Statisticians have recommended it for decades; most calculators still ship Wald because it is the one people were taught.
Does a confidence interval that excludes zero mean the result is significant?
For a difference, yes — a 95% interval excluding zero and a p-value below 0.05 are the same statement made two ways. The interval carries more information, though, because it also tells you the range of differences your data support. That is why journals increasingly ask for the interval alongside the p-value rather than instead of it.