Home › Math & Science › Confidence Interval Calculator

Confidence Interval Calculator

Use this confidence interval calculator to find the margin of error and the confidence interval for a sample mean or a sample proportion. Pick 90%, 95% or 99% confidence, or enter a custom level, and the calculator shows the interval, the z-score, and the standard error.

The margin of error is the z-score times the standard error. A bigger sample gives a narrower interval.

95% CI: 48.04 to 51.96
Margin of error = 1.96 (z = 1.96, standard error = 1.00)

How it works

A confidence interval is a range of values that probably contains the true value for a whole population, based on what you measured in a sample. If you survey 100 people and their average test score is 50, the average for all people is probably near 50, but not exactly 50. A 95% confidence interval of 48.04 to 51.96 says the true average is plausibly anywhere in that range. It turns a single number into an honest statement about how much you actually know.

The interval is built from three ingredients: your sample result (the mean or the proportion), the standard error, which measures how much sample results bounce around from one sample to the next, and the z-score, which comes from your confidence level and sets how wide the interval must be.

Mean: CI = x̄ ± z × (s ÷ √n)  ·  Proportion: CI = p̂ ± z × √(p̂(1 − p̂) ÷ n)  ·  z = 1.645 (90%), 1.96 (95%), 2.576 (99%)

The standard error. For a mean, the standard error is the standard deviation divided by the square root of the sample size: SE = s ÷ √n. It shrinks as the sample grows, because bigger samples are steadier. With a standard deviation of 10 and a sample of 100, the standard error is 10 ÷ 10 = 1. For a proportion, the standard error is √(p̂(1 − p̂) ÷ n). A proportion of 0.6 from 400 people has a standard error of about 0.0245. A proportion's standard error is largest when p̂ is near 0.5 and shrinks as p̂ moves toward 0 or 1.

The z-score. The z-score tells you how many standard errors out from the centre you must go to capture your chosen share of the normal curve. For 90% confidence, z = 1.645; for 95%, z = 1.96; for 99%, z = 2.576. Higher confidence needs a bigger z, which makes a wider interval. The custom option uses the exact z-score for any level between 50% and 99.99%.

The margin of error is the z-score times the standard error, and it is half the width of the interval. Add it to the sample result for the upper bound and subtract it for the lower bound. That is the whole calculation. For a proportion, the calculator shows the interval as percentages too, because poll results are usually reported that way: a proportion of 0.6 with a margin of error of 0.048 is reported as 60% ± 4.8%, or 55.2% to 64.8%.

What the interval does not mean. The most common mistake is to say "there is a 95% chance the true value is in this interval." Once the interval is calculated, the true value is either in it or it is not. The 95% belongs to the method: if you drew 100 different samples and built 100 intervals this way, about 95 of them would contain the true value. It describes the reliability of the procedure, not a bet on one particular interval.

When the normal method fits. This calculator uses the normal approximation, which works well when the sample is reasonably large — usually at least 30 observations for a mean, and at least 10 successes and 10 failures for a proportion. With very small samples, or a proportion very close to 0 or 1, the approximation can give bounds below 0 or above 1, which are impossible for a proportion, and a different method such as the Wilson interval is better. For typical survey and classroom data, the normal method here is the standard approach.

Worked example

A class of 100 students takes a test. Their mean score is 50 and the standard deviation is 10. Find the 95% confidence interval for the true mean score.

Step 1: Find the standard error. SE = s ÷ √n = 10 ÷ √100 = 10 ÷ 10 = 1.
Step 2: Find the z-score for 95% confidence. From the normal curve, z = 1.96.
Step 3: Find the margin of error. ME = z × SE = 1.96 × 1 = 1.96.
Step 4: Build the interval. Lower bound = 50 − 1.96 = 48.04. Upper bound = 50 + 1.96 = 51.96.

Try it yourself: choose "Mean", keep the confidence level at 95%, enter a sample mean of 50, a standard deviation of 10, and a sample size of 100, then press Calculate. The tool gives exactly the same answer — a margin of error of 1.96 and a 95% confidence interval of 48.04 to 51.96. The diagram shades that range on the bell curve so you can see how narrow the interval is when the sample is this large.

FAQ

What does a 95% confidence interval actually mean?

It means that if you repeated the same sampling process many times, about 95 percent of the intervals you calculated would contain the true population value. It does not mean there is a 95 percent chance that this one particular interval contains the truth — the true value is either in it or it is not. The 95 percent describes the reliability of the method over many repeats, not a probability attached to a single interval.

What is the margin of error?

The margin of error is half the width of the confidence interval. It tells you how far the sample result could plausibly be from the true population value. For a sample mean, it equals the z-score for your confidence level multiplied by the standard error, which is the standard deviation divided by the square root of the sample size. A margin of error of 1.96 around a mean of 50 gives an interval from 48.04 to 51.96. Smaller margins mean more precise estimates.

How do I choose between 90%, 95% and 99% confidence?

It is a trade-off between confidence and precision. A 99% interval is wider than a 95% interval, which is wider than a 90% interval, because you need a bigger range to be more sure it catches the true value. 95% is the standard choice in most research and polling because it balances the two. Use 99% when being wrong is costly, such as in medical or safety decisions, and 90% when you need a tighter interval and can accept a bit more risk.

Does a bigger sample size make the interval narrower?

Yes, but with diminishing returns. The margin of error shrinks with the square root of the sample size, so quadrupling the sample only halves the margin of error. Going from 25 people to 100 people halves the interval width, but going from 100 to 400 halves it again, and each step costs four times as much data. This is why pollsters often stop around 1,000 respondents.

When should I use a proportion instead of a mean?

Use the mean mode when your data are numbers you can average, such as test scores, heights, or incomes. Use the proportion mode when your data are yes-or-no answers, such as the share of voters who support a candidate or the share of customers who would buy a product again. The proportion mode only needs the sample proportion and the sample size, because the standard error comes from the proportion itself. Both modes use the same z-score logic, but the standard error formula is different.