Key takeaways
- Margin of error: ME = z × (σ ÷ √n).
- Confidence interval: from mean − ME to mean + ME.
- Use z = 1.645 for 90%, 1.96 for 95% and 2.576 for 99%.
- Divide σ by √n, not by n. Four times the sample halves the margin of error.
In this guide
What is a confidence interval?
You cannot weigh every apple on a farm, so you weigh 36 of them. Their average is your best guess for all the apples, but it will not be perfect. A confidence interval adds a safety margin: 'the true average is probably between this and that'.
The margin of error is how far that range reaches on each side of your sample mean.
Why do confidence intervals matter?
A single number like 'average apple weight: 150 g' sounds exact, but it came from a sample and could be off. A confidence interval is honest about that uncertainty. Scientists, doctors and pollsters report intervals so readers know how much to trust the result.
A 95% confidence interval means: if you repeated the sampling many times, about 95% of the intervals you built would contain the true mean.
The formula
| Symbol | What it means | Example |
|---|---|---|
| ME | Margin of error | 3.92 g |
| mean | The sample mean | 150 g |
| σ (sigma) | The standard deviation | 12 g |
| n | Sample size | 36 apples |
| z | z value for the confidence level | 1.96 (95%) |
| σ ÷ √n | The standard error | 2 g |
The calculator's main result is the margin of error. The steps then show the full interval from mean − ME to mean + ME.
How to calculate a confidence interval step by step
- 1Find the sample mean and standard deviation. The standard deviation calculator can help.
- 2Find the standard error. Divide σ by √n:
12 ÷ √36 = 12 ÷ 6 = 2. - 3Find the margin of error. Multiply by z:
1.96 × 2 = 3.92. - 4Build the interval.
150 − 3.92 = 146.08and150 + 3.92 = 153.92.
Now enter your own mean, standard deviation, sample size and z value in the calculator below.
Try it yourself
Pre-filled with the example — change any value.
Common mistakes to avoid
- Using the wrong z value. 1.96 is for 95%. Higher confidence needs a bigger z and gives a wider interval.
- Using z for tiny samples. With a small sample and an unknown σ, statisticians usually use a t value instead of z.
- Saying there is a 95% chance the mean is in this one interval. Strictly, the 95% describes the method, not one particular interval.
- Forgetting the ±. The margin of error goes on both sides of the mean.
Tips and tricks
| Confidence level | z value |
|---|---|
| 90% | 1.645 |
| 95% | 1.96 |
| 99% | 2.576 |
- Quick 95% estimate: use z ≈ 2. Then ME ≈
2 × σ ÷ √n. - Where does 1.96 come from? It is the z-score that leaves 2.5% in each tail of the normal distribution.
Where you'll use it in real life
- Opinion polls: the ± figure reported with election surveys.
- Medicine: the likely range of a treatment's average effect.
- Factories: checking whether the average fill of bottles is on target.
- School projects: reporting the average of repeated measurements honestly.
Quick summary
A confidence interval is the sample mean plus or minus a margin of error, where ME = z × σ ÷ √n. Bigger samples give narrower intervals, and higher confidence gives wider ones. Use the calculator above to get the margin of error and the full interval with every step shown.
Worked example
A farmer weighs a sample of 36 apples. Their mean weight is 150 g and the standard deviation is 12 g. She wants a 95% confidence interval, so she uses z = 1.96.
- 01ME = z × (σ / √n)
- 02Standard error = 12 / √36 = 2
- 03ME = 1.96 × 2
- 04ME = 3.92
- 05Confidence interval = 146.08 to 153.92
These numbers are pre-filled in the calculator above.
Frequently asked questions
What z value should I use for a 95% confidence interval?
Use z = 1.96. For 90% use 1.645, and for 99% use 2.576.
How do I make the margin of error smaller?
Use a bigger sample. Because you divide by √n, taking four times as many measurements cuts the margin of error in half.
What is the difference between margin of error and confidence interval?
The margin of error is one number, the distance from the mean to each end. The confidence interval is the full range from mean − ME to mean + ME.
Why is a 99% interval wider than a 95% interval?
To be more confident that the range catches the true mean, you have to make the range bigger. The z value rises from 1.96 to 2.576, so the margin of error grows.


