Confidence Interval Calculator
Build a confidence interval around a sample mean, with the margin of error and standard error shown.
Details
A whole number of 2 or more.
95% confidence interval
95.1 – 104.9
x̄ ± margin of error
This works out a confidence interval around a sample mean: the range your true value is likely to sit within.
Enter the sample mean, standard deviation, sample size and confidence level, and it returns the interval and the margin of error either side.
What a confidence interval is
A confidence interval is a range rather than a single number. Instead of claiming the average is exactly 50, it says the true average is probably somewhere between 48.04 and 51.96.
That honesty is the point. You measured a sample, not everyone, so the sample mean is an estimate. The interval says how much wobble that estimate carries.
Two things narrow it: a larger sample and less variable data. Sample size helps by the square root, so quadrupling your sample halves the interval, not the other way round.
Dividing by the square root of the sample size is what makes bigger samples help. Going from 100 to 400 responses halves the margin, from ±1.96 to ±0.98.
What to enter
- Sample mean (x̄)
- The average of the data you actually collected.
- Sample standard deviation (s)
- How spread out your sample is. The standard deviation calculator will work it out from raw numbers.
- Sample size (n)
- How many observations you have. This drives the width of the interval more than anything else you control.
- Confidence level
- Usually 95%. Higher confidence produces a wider interval, because being more certain means claiming less precision.
What changes the width
- Larger sample
- Narrows it, by the square root. Four times the data halves the margin.
- More variable data
- Widens it. A noisy measurement gives a vaguer estimate.
- Higher confidence
- Widens it. 99% confidence needs a bigger net than 95%.
- z = 1.96
- The multiplier for 95% confidence. For 99% it is 2.576, and for 90% it is 1.645.
What this assumes
The sample is genuinely random. A biased sample produces a confident interval around the wrong number.
For small samples the t-distribution is more appropriate than z, and it gives a slightly wider interval.
How to calculate a confidence interval
Work out the standard error, scale it by the confidence multiplier, then add and subtract from the mean.
- s ÷ √n
- The standard error: how much the sample mean itself wobbles
- z
- 1.96 for 95% confidence
Find the standard error. Divide the standard deviation by the square root of the sample size. 10 ÷ √100 = 1.
Multiply by the confidence multiplier. 1 × 1.96 = 1.96. That is your margin of error.
Add and subtract from the mean. 50 − 1.96 and 50 + 1.96 gives 48.04 to 51.96.
Report the range, not just the middle. The interval is the finding. Quoting only the mean throws away the information about how reliable it is.
See a worked example: a sample of 100 with a mean of 50
- Sample mean
- 50
- Standard deviation
- 10
- Sample size
- 100
- Confidence
- 95%
Standard error: 10 ÷ √100 = 10 ÷ 10 = 1.
Margin of error: 1.96 × 1 = 1.96.
Interval: 50 ± 1.96, so 48.04 to 51.96.
Collecting 400 observations instead would halve the margin to ±0.98, giving 49.02 to 50.98.
48.04 to 51.96
Frequently asked questions
It refers to the method, not to your particular interval. If you repeated the whole study many times, about 95% of the intervals you built this way would contain the true value.
It does not mean there is a 95% chance the true value is inside this specific range. The true value is a fixed number; it is either in your interval or it is not. This distinction is subtle and it is the most commonly misstated idea in introductory statistics.
Collect more data. It is the only lever fully in your control, and it works by the square root: four times the sample halves the interval.
You can also lower the confidence level, but that is not really an improvement. A narrower 90% interval is not more precise, it is just less cautious.
Use t when the sample is small, roughly under 30, and you are estimating the standard deviation from that sample. Use z when the sample is large or the population standard deviation is genuinely known.
The t-distribution is slightly wider to reflect the extra uncertainty. Above 30 observations the two are close enough that it rarely changes a conclusion.
Overlapping intervals suggest the difference may not be meaningful, but it is a rough test rather than a proper one.
Two intervals can overlap slightly and still represent a statistically significant difference. For a real answer, test the difference directly rather than eyeballing the overlap.
Either the sample is small or the data is highly variable, and usually both. Both feed straight into the standard error.
A wide interval is not a failure of the method; it is an honest report that your data cannot pin the answer down further. Narrowing it requires more or cleaner data, not a different formula.
Problems people actually run into
Saying there is a 95% chance the true value is in this range
This is the classic misstatement, and it appears constantly in write-ups and news reports. The confidence belongs to the procedure, not to the one interval you happen to have produced.
The safe phrasing is: 'we are 95% confident the true value lies between X and Y', which describes the method's long-run reliability rather than claiming a probability about a fixed number.
Reporting the mean without the interval
A headline of 'average satisfaction was 7.2' hides whether that came from 12 people or 12,000, and whether the honest range was 6.9 to 7.5 or 4.1 to 10.
The interval is what tells a reader how much weight the number can carry. Dropping it makes a shaky estimate look identical to a solid one.
Results are estimates for general information only and are not professional financial, medical, or legal advice. Read our full disclaimer.
Last updated: September 4, 2026