Find the range a true mean or rate most likely falls in, from raw data, a mean with its SD, or a count. Wilson, exact and Wald intervals side by side, one-sided bounds and a small-population correction.
What is the margin of error for a sample of 300?
Find the range a true mean or rate most likely falls in, from raw data, a mean with its SD, or a count. Wilson, exact and Wald intervals side by side, one-sided bounds and a small-population correction.
The calculator below is set to a poll or survey of 300 randomly chosen people, at a 95% confidence level and an expected share of 50%, the most cautious assumption and the one pollsters use to quote the margin of a whole survey. Press Calculate for the classic margin of error, z × √(p(1 - p) / n), and for the same sample at other sizes, confidence levels and shares. Add a population size if the group you sample from is small, or switch to successes out of a sample once the answers are in.
Parameters
Enter data for calculations
💡 Fill in all required fields to unlock the calculate button
Confidence intervals for a mean or a proportion, with four methods side by side
Two successes out of 20 is a rate of 10%, yet the 95% range for the true rate runs from 2.79% to 30.10%, and the textbook plus-or-minus formula would have cut it off at 23.15%. This confidence interval calculator works from raw measurements, from a mean with its standard deviation and sample size, or from a count of successes. Means get Student's t interval; proportions get the Wilson score interval as the headline, with the exact Clopper-Pearson, Agresti-Coull and Wald intervals printed underneath so you can see where they disagree. You can ask for a two-sided interval or a one-sided bound, choose from five confidence levels, and correct for a small population, such as a survey of 400 people out of 1,000.
Six choices before the interval appears
- What you have - raw measurements, a finished mean with its standard deviation and sample size (as printed in a report or a paper), or a count of successes out of a sample for a proportion. Before a poll, the sample size alone gives the margin of error it will report: ±9.80 points for 100 people, ±3.10 for 1,000.
- The data - paste the measurements separated by spaces, commas or new lines, with a dot for decimals; or type the mean, the sample standard deviation (the n - 1 kind) and n; or type the successes and the sample size.
- Population size (optional) - fill it in only when the sample is a noticeable share of a finite group, for example 400 employees surveyed out of 1,000. Left empty, the population is treated as unlimited.
- Confidence level - 80%, 90%, 95%, 98% or 99%. Nothing is preselected, because the level alone decides how wide the interval is.
- Kind of interval - two-sided, or a single lower or upper bound when only one direction matters, such as "the failure rate is at most".
- Read the result: the interval, the margin of error, the standard error and critical value, the method comparison for proportions, and the same data at all five confidence levels.
What a confidence interval does and does not promise
A confidence interval is an estimate with its uncertainty attached: a range of values for a population quantity, such as the average weight of a product or the share of voters who back a candidate, built from one random sample. The width comes from two things, the standard error of the estimate and a critical value that depends on the confidence level. For a mean that is x̄ ± t × s / √n; for a proportion the simplest version is p ± z × √(p(1 - p) / n).
The word confidence describes the method, not the one interval you are looking at. If you drew sample after sample and built a 95% interval each time, about 95% of those intervals would contain the true value. The interval from your sample either contains it or does not; you just cannot tell which. That is also why a 99% interval is wider than a 95% one from the same data: more coverage costs width, and the calculator prints all five levels so the trade is easy to see.
Two quiet assumptions sit under every row of the result. The sample has to be random and the observations independent. An online poll that only reaches people who choose to answer, or twenty measurements taken from the same batch, breaks the first or the second, and no formula repairs that. The margin of error covers sampling luck only.
Four ways to put an interval around a proportion
For proportions there is no single standard method, and the choice matters most when the count is small or the rate sits near 0% or 100%. The table lists the four the calculator prints, how each is built and where it goes wrong. The comparison follows Brown, Cai and DasGupta's review in Statistical Science, which recommends Wilson for small samples and warns against Wald.
| Method | How it is built | Behavior | Where you meet it |
|---|---|---|---|
| Wilson score | inverts the z-test, so the center shifts toward 50% | coverage close to the nominal level, never outside 0-100% | the headline here; R prop.test prints it with a continuity correction |
| Clopper-Pearson | exact binomial tails, solved with the beta distribution | never undercovers, but is the widest of the four | R binom.test, regulatory and quality reports |
| Agresti-Coull | adds z²/2 successes and z²/2 failures, then uses the plain formula | close to Wilson, a little wider near the edges | introductory courses, the "add two and two" rule |
| Wald | p ± z × √(p(1 - p) / n) | collapses to a point at 0 or n successes, undercovers small samples | most textbooks and the margin of error quoted in news polls |
Critical values of t and z at 90%, 95% and 99%
For a mean, the critical value comes from Student's t with n - 1 degrees of freedom, because the standard deviation is estimated from the same sample. The table shows how quickly t shrinks toward the normal value as the sample grows. These are two-sided values; a one-sided 95% bound uses the 90% column.
| Degrees of freedom | 90% | 95% | 99% |
|---|---|---|---|
| 1 | 6.314 | 12.706 | 63.657 |
| 2 | 2.920 | 4.303 | 9.925 |
| 5 | 2.015 | 2.571 | 4.032 |
| 10 | 1.812 | 2.228 | 3.169 |
| 20 | 1.725 | 2.086 | 2.845 |
| 30 | 1.697 | 2.042 | 2.750 |
| 60 | 1.671 | 2.000 | 2.660 |
| 120 | 1.658 | 1.980 | 2.617 |
| normal (z) | 1.645 | 1.960 | 2.576 |
Seven samples and the intervals they produce
Interval: 12.04 to 15.96, margin ±1.96.
Interval: 98.068 to 98.682 °F, margin ±0.307.
Interval: 3,252 to 3,648, margin ±198.
Wilson: 27.24% to 32.91%, margin ±2.84 points.
Wilson: 2.79% to 30.10%.
Wilson with the correction: 46.21% to 53.79%, margin ±3.79 instead of ±4.88.
Wilson, two-sided 95%: 0.00% to 16.11%.
Four regularities behind every interval
Reading the result you get
| What you see | What it means |
|---|---|
| A narrow interval | the sample pins the value down, provided it was random |
| A wide interval | more data needed before reading much into the estimate |
| A reference value outside the interval | a two-sided test at the matching level would reject it |
| Two groups whose intervals overlap | not proof of no difference; compare them with a two-sample test instead |
| Wald very different from Wilson | the count is too small for the plus-or-minus formula; trust Wilson or the exact row |
The intervals describe sampling error in a random sample. They say nothing about measurement bias, non-response or a badly worded question.
Confidence interval questions, with the numbers
Related tools
Standard Error Calculator
The standard error behind every interval, and the standard deviation recovered from a published interval - See calculator
Grouped Data Quartile Calculator
Quartiles, the median and percentiles when the data come as a frequency table - See calculator
Sample Size Calculator
Works backward from the margin of error you want to the number of responses you need - See calculator
One-Sample T-Test Calculator
Tests a mean against a fixed value using the same standard error and t distribution - See calculator
Z-Test Calculator
Compares two conversion rates or a rate with a benchmark, with a p-value and the traffic needed - See calculator
Two-Sample T-Test Calculator
The right tool when two intervals overlap and you want to know whether the means really differ - See calculator
P-Value Calculator
Turns a z, t, chi-square or F statistic into an exact p-value, with critical values at the usual alpha levels - See calculator
Standard Deviation Calculator
Computes the sample and population standard deviation that feeds the interval for a mean - See calculator
Calculator verified by the LiczGrupa.pl team
Content, formulas and results have been reviewed for accuracy and relevance by our team of specialists.

Reviewed by: Natalia Skrzek