unspurious.calculators

Estimation · Interval estimates

Confidence Interval Calculator

A confidence interval for a mean, a proportion, or the difference between two groups — with the formula, the working, an honest reading of what the interval does and doesn't mean, and copyable R/Python code.

Result

In plain English

You measured a sample, but what you really care about is the whole population. A confidence interval is the range the true population value is plausibly in, given how much your sample could have wobbled by chance.

confidence interval
A plausible range for the true value. Narrower = more precise.
“95% confident”
If you repeated the study over and over, about 95% of the intervals you'd build this way would contain the true value. It is not a 95% chance the truth sits in this one particular interval.
point estimate
Your single best guess — the sample mean or proportion — which sits in the middle of the interval.
margin of error
The “give or take”: half the width of the interval.
mean vs proportion
A mean is the average of a number (e.g. average height). A proportion is a fraction or percentage (e.g. 54% said yes).

Frequently asked

What does a 95% confidence interval actually mean?

It describes the method, not this one interval: if you repeated the study many times, about 95% of the intervals built this way would contain the true value. It is not a 95% probability that the true value lies inside this particular interval — that interval either contains it or it doesn't.

Does a wider interval mean the result is wrong?

No — it means more uncertainty, usually from a small sample or high variability. A wide interval is honest: it tells you the estimate is imprecise, not incorrect.

When should I use the Wilson or Welch options?

Use the Wilson interval for proportions — it behaves far better than the textbook Wald interval, especially near 0% or 100% or with small n. Use Welch for the difference between two means when the groups have unequal variances or sizes, which is most of the time.

What is the difference between a confidence interval and a prediction interval?

A confidence interval estimates where a population parameter — such as the mean — is likely to lie. A prediction interval estimates where the next single observation will fall. The prediction interval is always wider, because an individual value scatters more than an average of many does. Confusing the two makes a forecast look far more precise than it really is.