Confidence Interval Calculator

Lower bound—
Upper bound—
Margin of error—

How Confidence Interval Calculator is calculated: CI = mean ± z × (SD ÷ √n), with z = 1.645 (90%), 1.96 (95%) or 2.576 (99%)

What a confidence interval actually tells you

A confidence interval is a range that probably contains the true value. A survey finds an average of 100 with a 95% confidence interval of 95.10 to 104.90. That does not mean there is a 95% chance the truth sits in that exact range. It means the method produces ranges that catch the truth about 95 times out of 100, across many samples. Your one range is either right or wrong — but the method behind it is sound 95% of the time.

The width of the range is the useful part. A narrow interval means your estimate is precise; a wide one means it is a rough guess. The width is set by three things: how spread out the data is, how many observations you have, and how confident you want to be. More spread or more confidence widens it; more data narrows it.

This calculator takes a sample mean, a standard deviation, a sample size and a confidence level, and returns the lower bound, the upper bound and the margin of error. Everything runs in your browser, so your numbers never leave your device.

How a confidence interval is worked out

The steps are short. First, find the standard error: divide the standard deviation by the square root of the sample size. For a standard deviation of 15 and a sample of 36, the standard error is 15 ÷ 6 = 2.5. The standard error is the typical wobble of the sample mean from sample to sample — it is not the spread of the data itself, which is what the standard deviation measures.

Second, multiply the standard error by the z-value for your confidence level: 1.645 for 90%, 1.96 for 95%, 2.576 for 99%. At 95%, that gives 1.96 × 2.5 = 4.90. That number is the margin of error — how far the interval reaches on each side of the mean. Third, add and subtract it: 100 − 4.90 = 95.10 and 100 + 4.90 = 104.90. The 95% confidence interval is 95.10 to 104.90.

The formula in one line is: mean ± z × (SD ÷ √n). Every input pulls in a clear direction. A bigger standard deviation widens the interval, a bigger sample narrows it, and a higher confidence level widens it because the z-value grows. If any one of those surprises you, check that input first — a mistyped sample size is the usual cause of an interval that looks wrong.

The margin of error, explained

The margin of error is the half-width of the interval, and it is the number most people actually quote. Saying the average score is 100 with a margin of error of 4.90 is the same as saying the interval is 95.10 to 104.90, just shorter. News reports quote it this way: a poll result of 52% with a margin of error of 3 points means the interval is 49% to 55%.

The margin shrinks with the square root of the sample size, which is the key fact about precision. Quadrupling the sample from 36 to 144 halves the margin; to halve it again you need 576. Each extra point of precision costs more observations than the last. That is why surveys stop at a few hundred responses instead of a few thousand — the gains past that point are small and the cost is not.

Confidence also costs width. With the same mean of 50, standard deviation of 10 and sample of 25, the margin is 3.29 at 90% confidence, 3.92 at 95% and 5.15 at 99%. The intervals are 46.71 to 53.29, 46.08 to 53.92 and 44.85 to 55.15. You buy certainty with width, and the calculator shows the price of each level side by side when you switch the dropdown.

A worked example: mean 100, standard deviation 15, n = 36

Take the default numbers on this page. The sample mean is 100, the standard deviation is 15 and the sample size is 36, at 95% confidence. The square root of 36 is 6, so the standard error is 15 ÷ 6 = 2.5. Multiply by the z-value for 95%, which is 1.96: the margin of error is 1.96 × 2.5 = 4.90. Subtract and add: the lower bound is 100 − 4.90 = 95.10 and the upper bound is 100 + 4.90 = 104.90.

Now change the sample size and watch the interval tighten. With 144 observations instead of 36, the standard error falls to 15 ÷ 12 = 1.25, the margin becomes 1.96 × 1.25 = 2.45, and the interval is 97.55 to 102.45 — half as wide. With only 9 observations, the standard error is 15 ÷ 3 = 5, the margin is 9.80, and the interval sprawls from 90.20 to 109.80. Same mean, same spread, very different precision.

A second full example shows the 99% level. Mean 50, standard deviation 10, sample 25: the standard error is 10 ÷ 5 = 2, the z-value is 2.576, so the margin is 5.15 and the interval is 44.85 to 55.15. At 95% the same data gives a margin of 3.92 and an interval of 46.08 to 53.92. The 99% interval is wider because it has to catch the truth more often — certainty is paid for in width.

Where confidence intervals do real work

In medicine, a trial reports the average drop in blood pressure with its interval, not just the average. A drop of 8 points with an interval of 6 to 10 is a solid finding; a drop of 8 with an interval of −2 to 18 is a shrug, because the truth could be zero or even negative. Doctors read the interval first and the headline number second, and a result whose interval crosses zero is treated as no proven effect.

In quality control, a factory measures a sample of parts and reports the average length with an interval. If the whole interval sits inside the allowed tolerance, the batch passes. If the interval straddles the limit, more parts must be measured before anyone signs off. The interval turns a sample into a decision rule with a known error rate.

In surveys and A/B tests, the interval is what stops people from celebrating noise. A website change that lifts conversion from 4.0% to 4.4% looks like a win until the interval shows the true lift could be anywhere from −0.2% to +1.0%. A average calculator gives you the point estimate; the interval tells you how much to trust it.

Confidence interval vs margin of error vs p-value

These three numbers describe the same uncertainty from different angles, and mixing them up causes confident-sounding errors. The confidence interval is a range of plausible values for the true mean. The margin of error is half that range — the distance from the centre to either end. The p-value is something else entirely: the probability of seeing data this far from a stated value if that value were true.

A 95% interval that excludes a value is the same statement as a two-tailed p-value below 0.05 for that value, but the interval says more. A p-value of 0.04 tells you the result is unlikely under the null; the interval tells you the effect is plausibly between, say, 0.5 and 9.5 — which is the information a decision actually needs. A tiny effect can be statistically significant with a huge sample, and the interval is what reveals that it is tiny.

The practical rule is to report the interval and let the p-value stay in the background. When two intervals overlap heavily, do not rush to say the groups are the same — overlapping intervals can still hide a real difference. A standard deviation calculator helps you see the spread that feeds the interval, and a probability calculator helps you think about the chances behind the p-value.

Common confidence interval mistakes

The first mistake is the most common: reading a 95% interval as a 95% probability that the truth is inside this particular range. That is not what it means. The 95% belongs to the method, not to your one interval. Once the data is in, the interval either contains the truth or it does not. The honest reading is that ranges built this way catch the truth 95 times out of 100.

The second mistake is using the standard deviation where the standard error belongs. The interval is built from SD ÷ √n, not from SD alone. With a standard deviation of 15 and a sample of 36, the margin is 4.90; if you forget the division by √n and use 15 directly, the margin becomes 29.40 and the interval is six times too wide. Check that your margin is much smaller than your standard deviation — if it is not, the square root step is missing.

The third mistake is treating a narrow interval as proof the estimate is right. A narrow interval means the estimate is precise, not that it is unbiased. If the sample was drawn badly — only happy customers, only one city, only one week — the interval will be narrow and wrong, centred on the wrong value. Precision and accuracy are different things, and no interval can fix a biased sample.

The fourth mistake is comparing two groups by checking whether their intervals overlap. Two intervals can overlap and the difference can still be real, because the comparison uses the standard error of the difference, which is smaller than the sum of the two widths. If you need to compare groups, use a proper two-sample test instead of eyeballing overlaps.

How to use this confidence interval calculator

Type in the sample mean — the average your data actually gave. Then the standard deviation of the sample, and the sample size n. Pick the confidence level: 95% is the standard, 90% when you want a tighter range, 99% when the stakes are high. The lower bound, upper bound and margin of error update live as you type.

Read the interval as the range of values still plausible for the true mean. If the whole interval sits on one side of a value you care about — above a target, below a limit — you have a clear finding. If the interval straddles that value, the data has not settled the question yet and you need more observations.

Everything runs in your browser. No account, no upload, no data sent anywhere. Use it alongside the variance calculator when you want to check the spread feeding your interval, and remember the fine print: this calculator uses the z-value, which fits samples of about 30 or more. For very small samples, a t-based interval is slightly wider and more honest.

Frequently Asked Questions

The standard error is 15 ÷ √36 = 15 ÷ 6 = 2.5. At 95% confidence the z-value is 1.96, so the margin of error is 1.96 × 2.5 = 4.90. The interval is 100 − 4.90 = 95.10 to 100 + 4.90 = 104.90.

No. A 95% confidence interval means the method produces ranges that contain the true value about 95 times out of 100. Your one interval either contains the truth or it does not. The 95% describes the long-run behaviour of the method, not the probability for a single interval.

Quadruple it. The margin of error shrinks with the square root of n, so halving the margin needs four times the sample. Going from 36 to 144 observations halves the margin from 4.90 to 2.45 in the example above. Each extra point of precision costs more than the last.

A z-interval is fine for samples of about 30 or more, where the normal curve is a good fit. For small samples, the t-distribution is wider and more honest, because the sample standard deviation is itself uncertain. With fewer than 30 observations, prefer a t-based interval.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.