Confidence Interval Calculator

Build a confidence interval for a mean or a proportion, with the t distribution where it belongs, the Wilson interval for proportions, and the sample size you need.

When should I use t instead of z?

Whenever you estimated the standard deviation from the same sample, which is nearly always. Using z assumes you already know the population figure, and if you knew that you would probably know the mean too. The penalty for getting this wrong is largest exactly when your sample is smallest.

Does a 95% interval mean a 95% chance the answer is inside?

No, although almost everyone reads it that way. The true value is a fixed number and does not have a probability. What is random is the interval: repeat the study many times and 95% of the intervals built this way would contain the true value. This one either does or does not.

Why does this show two intervals for a proportion?

Because the textbook Wald interval is an approximation that breaks down near 0% or 100% and with small samples, sometimes producing bounds below zero or above one. The Wilson score interval is barely harder to compute, cannot leave the range, and is far more accurate. It is the one to quote.

How do I pick a sample size before I have any data?

You need an estimate of the variability, which usually comes from a pilot study or from earlier work. For a proportion, assuming 50% gives the largest and therefore safest sample size. Then decide what margin of error you could live with, and this page gives you the n.

What is the finite population correction?

When your sample is a serious fraction of the whole population, you need fewer people than the standard formula says. Surveying 369 out of a population of 500 is overkill; 213 does the same job. It only matters when the population is small, and it is ignored above a few tens of thousands.

What does this not account for?

Everything except sampling error. It assumes a simple random sample. It cannot see non-response bias, a badly worded question, a sampling frame that missed people, or clustering. In real surveys those usually move the answer more than the margin of error does, and no formula will tell you so.