1. Home
  2. Calculators
  3. Confidence Interval Calculator

Confidence Interval Calculator

For reports, surveys and lab data: the interval, the margin of error and the critical value, with the method shown.

Free, no sign-up. Runs in your browser: nothing is uploaded.

Free workspace included. Docs, spreadsheets, notes and tasks that save on your device. No sign-up.Take a look

How to use Confidence Interval Calculator

  1. Enter your numbers, or press a sample to see an example.
  2. Read the results and the table under them.
  3. Copy the results or download the table as a CSV file.

Features

  • Mean interval from summary values or pasted data
  • t or z critical value
  • Proportion interval by Wilson, Clopper-Pearson, Agresti-Coull or Wald
  • A table of the same data at 80 to 99.9% confidence
  • Warnings when an approximation is unreliable

Supported formats

Input

  • Summary numbers
  • Pasted data values

You get

  • On-screen results
  • Copyable text
  • CSV table

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Confidence Interval Calculator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • The mean interval assumes roughly normal data or a large sample.
  • A confidence interval does not account for bias or a poor sampling method.

Guide

Confidence intervals for a mean and for a proportion, and how the methods differ

A sample mean or a sample proportion is only an estimate of the real value. A confidence interval puts a range around the estimate that reflects how precisely the sample pins it down, and the margin of error is half the width of that range. Poll results, laboratory averages and quality checks all report them. This calculator builds the interval for a mean from summary numbers or pasted data, or for a proportion with four recognised methods.

The interval for a mean

For a mean the interval is m ± t*·s/√n, where s/√n is the standard error and t* is the critical value of the t distribution with n − 1 degrees of freedom at your confidence level. With mean 50, standard deviation 10 and n = 25, the standard error is 2, t* is 2.0638986 and the 95% interval is 45.872203 to 54.127797, a margin of ±4.1277971. Choose z instead of t only when the population deviation is known or n is large.

Using the tool

Under Interval for, choose A mean (from mean, SD and n), A mean (from raw data) or A proportion, then the Confidence level from 80% to 99.9%. For raw data, paste the values separated by spaces, commas or lines; eight values of 12.1 14.3 13.8 15.2 12.9 14.7 13.3 15.0 give mean 13.9125, standard deviation 1.0894789 and a 95% interval of 13.001673 to 14.823327 with t* = 2.3646243 on 7 degrees of freedom. A table shows the same data at all five levels.

The interval for a proportion

For x successes in n trials the sample proportion is x/n. The Wald interval, p ± z√(p(1 − p)/n), is the textbook formula but fails for small counts and for proportions near 0 or 1. The Wilson score interval fixes this, the Agresti-Coull interval adds pseudo-observations, and the Clopper-Pearson interval is exact, based on the binomial distribution, and guarantees coverage of at least the stated level. The default Wilson interval is a good everyday choice.

Worked examples

A poll with 45 of 100 respondents in favour gives a proportion of 0.45 and a Wilson 95% interval of 0.356145 to 0.547554, that is 35.61% to 54.76%, a margin of ±9.57%. The exact interval is 0.35032 to 0.55272 and Agresti-Coull gives 0.356128 to 0.547571. For 3 successes in 10 trials the exact interval is 0.0667395 to 0.652453 while Wilson gives 0.107791 to 0.603222, showing how methods spread apart when counts are small. A warning appears if there are fewer than ten successes or failures.

Choosing the confidence level

Higher confidence costs width. For the default data the margins at 80%, 90%, 95% and 99% are ±2.63567, ±3.42176, ±4.1278 and ±5.59388: going from 95% to 99% widens the interval by about a third. A 95% level is the usual convention, 99% is chosen when a wrong conclusion is costly, and 90% is common in exploratory work. State the level whenever you quote an interval.

Margin of error and sample size

The margin of error shrinks with the square root of the sample size: quadrupling the sample halves it. If an interval is too wide to be useful, the cure is more data, or less variable data, rather than a lower confidence level. The sample size calculator works backwards from the margin you want. Remember that the margin reflects random sampling error only, not bias from who answered or how the question was worded.

Limits

The mean interval assumes the data are roughly normal or the sample is large enough for the central limit theorem to help; strongly skewed small samples need another method. Proportion intervals assume independent trials with the same chance of success. The tool does not build intervals for medians, differences between groups or regression coefficients, though the t-test and regression tools report the last two.

Checked against the current version of the Confidence Interval Calculator on .

Frequently asked questions

What exactly does 95% confidence mean?

It describes the procedure, not the single interval: if you repeated the study many times and built an interval each time with this method, about 95% of those intervals would contain the true value. Once calculated, a particular interval either does contain it or does not. The width reflects uncertainty from the sample size and the spread of the data.

Why does the interval from 3 successes in 10 look so different between methods?

With so few trials the normal approximation behind Wald and even Wilson is rough. For 3 of 10 the exact Clopper-Pearson interval is 0.0667 to 0.6525, much wider than the Wilson interval of 0.1078 to 0.6032. Clopper-Pearson guarantees at least 95% coverage but is conservative, and the table on the page puts all four side by side.

Should I use t or z?

Use t when the population standard deviation is unknown, which is almost always. The two agree closely once n is above about 30.

Which proportion method is best?

Wilson is a good default and Clopper-Pearson is the cautious exact choice. Wald fails for small counts or proportions near 0 or 1.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.