A poll comes out. "52% support the measure, margin of error 3 points, 95% confidence."
Most people read that as: there's a 95% chance the true number is between 49% and 55%. That sounds right. It's also not quite what's going on.
The true number isn't random. It's just one fixed thing we don't know. What's actually random is the interval itself, the 49-to-55 part. Different polls, different intervals. The 95% describes how often that process lands on the truth, not the odds for this one poll sitting in front of you.
That distinction sounds small. It changes how you should read every "margin of error" you'll ever see. Let's build a confidence interval from scratch and watch exactly where the 95% comes from.
A single number is never enough
Say you want to know the average commute time in a city. You can't ask everyone, so you survey a sample of commuters and average their answers. Call that average .
Here's the problem: if you asked a different sample of commuters tomorrow, you'd get a different . Maybe 48 minutes today, 51 minutes tomorrow. Neither one is "wrong." They're just two different samples bouncing around the same true average.
A single number, , hides that bounce. It looks precise. It isn't. What you actually need is a range that owns up to the uncertainty. That range is the confidence interval.
Your sample mean bounces around, and that bounce has a shape
Before we can build the range, we need to know how much actually bounces. Turns out that bounce isn't random noise, it follows a very specific, very predictable shape.
Imagine the true average commute time in the city is 50 minutes, with individual commutes varying by about 10 minutes (that's the population standard deviation, ). If you take a sample of commuters and average them, that average lands close to 50, but not exactly on it. Take many samples, plot all their averages, and you get a bell curve centered on 50.
The size of that bell curve is what matters. A small sample bounces around a lot. A big sample barely bounces at all. Watch what happens as you increase :
Drag n. The gold curve is the spread of sample means, not individual commute times, and it tightens fast.
Notice the gold curve gets taller and narrower as grows, while the population itself (the dashed curve) never moves. More commuters in your sample means your average is less likely to be a fluke.
We measure that narrowing with a number called the standard error:
Small gives you a big SE, meaning could be almost anywhere. Big gives you a small SE, meaning is pinned close to the truth. This one formula is the entire engine behind confidence intervals. Everything from here is just built on top of it.
So what is a confidence interval, really?
Now we have the piece we were missing. We know bounces around the true mean in a bell-curve pattern, and we know exactly how wide that bell curve is, the standard error.
A confidence interval just uses that bell curve to build a range around wide enough to typically catch the truth. We write it as:
The here is a multiplier that controls how many standard errors wide you go. For 95% confidence, . We'll see exactly where that number comes from in a moment.
So if your sample of 30 commuters averages 52.4 minutes, and , your 95% interval is:
That's the range. But we still haven't answered the real question: what does "95%" mean here?
The 95% isn't about this one interval. It's about the method that built it.
Picture a ring toss. There's a stake in the ground. It doesn't move. You don't know exactly where it is, but you get to toss rings at it, over and over, using a method that's pretty good at landing around it.
Each toss is one sample. Each ring is one confidence interval. The stake is the true average commute time, fixed and unknown. Some rings land around the stake. Some don't. A "95% confidence" method is one where, if you tossed forever, 95% of your rings would land around the stake.
Here's the part that trips people up: once a ring is on the ground, it either contains the stake or it doesn't. There's no more randomness left in that one ring. The 95% was a property of the tossing process, before you threw. It's not a live probability attached to the ring sitting there afterward.
Let's simulate the tosses. Each row below is one sample, its own 95% interval, checked against the true mean. Run a bunch, and watch the running capture rate settle in near 95%, not because any single interval "has a 95% chance," but because that's the long-run hit rate of the method itself.
Every row is one fresh sample and its 95% interval. Green captured the true mean, red missed it.
Run enough trials and you'll see it: green intervals mostly outnumber red ones by about 19 to 1. But some intervals do miss entirely, clean and total misses. That's expected. A method that's right 95% of the time is still wrong 5% of the time, and there's no way to tell, from a single interval alone, which kind you got.
Want more confidence? You pay for it in width
If 95% intervals miss 1 time in 20, why not just demand 99% confidence, or 99.9%? You can. But the interval gets wider every time you ask for more certainty.
Here's why. The multiplier comes directly from the bell curve of . To be 95% confident, you need to cover 95% of the area under that curve, leaving 2.5% cut off in each tail. To be 99% confident, you need to cover more area, which means pushing further out into the tails, which means a bigger , which means a wider interval.
Drag the confidence level below and watch both things happen together: the bar on top widens, and the tail area on the curve below shrinks by the same amount.
Drag the confidence level up. The bar widens because you now need more curve area, so the cutoff moves into the tails.
There's no way around this trade. More confidence always costs you precision. A 99.9% interval is almost guaranteed to contain the truth, but it might be so wide it's useless for making a decision. A narrow interval is more useful, but it takes more risk of missing.
More data narrows the interval, but with diminishing returns
We've fixed confidence and sample size so far and just changed one or the other. What if you want a tighter interval without lowering your confidence level? The only lever left is , your sample size.
Go back to the standard error formula: . The interval's half-width (called the margin of error) is , so it shrinks as grows too:
But notice that square root. It means doubling your sample size doesn't halve your margin of error. You have to quadruple to cut the margin in half, because .
Drag the dot along the curve. Quadrupling n only halves the margin of error, it never scales one-to-one.
Drag the dot from a small toward a large one and watch the curve flatten out. The first few hundred survey responses buy you a lot of precision. The next few thousand buy you much less. This is why national polls plateau around 1,000 to 2,000 respondents. Going from 1,000 to 4,000 only tightens the margin by about half, and it costs four times as much to collect.
The short version
A confidence interval is a range built from your sample mean, plus or minus a multiplier times the standard error. The 95% doesn't describe the odds that the true value sits inside any one interval you calculated. It describes how often the method itself, repeated over and over, would produce an interval that contains the truth.
Raise your confidence level and the interval gets wider, because you're demanding more area under the curve. Grow your sample size and the interval gets narrower, but only by the square root of how much data you add.
So the next time you see "52%, margin of error 3 points, 95% confidence," read it as: if this poll were run over and over with fresh samples, about 95% of the resulting ranges would contain the true number. This one poll gave you one ring. It's a good ring. It's just not a guarantee.
All visualizations are interactive React components running entirely in your browser. The coverage simulator draws fresh random samples from a true population on every trial using a Box-Muller transform. No libraries beyond React.