Free confidence interval calculator
Get a confidence interval for a mean or for a proportion. Enter the sample size, mean and standard deviation, paste raw numbers, or enter successes and sample size. See each step. No signup. All processing is in your browser.
The number of values, for example the number of responses to a rating question.
The average of your values, for example 3.8.
A number that is more than 0, for example 1.1.
If you calculated the standard deviation from the same responses, select the sample standard deviation.
Put one number on each line, or separate the numbers with commas, semicolons, tabs or spaces. Use a point as the decimal mark. A comma always separates two numbers: 4,5 is 4 and 5. Up to 100,000 numbers. The calculator uses a t-interval.
The number of responses with the answer that you count, for example the people who selected “Yes”.
The total number of responses to the question.
95% is the most common confidence level.
Correct this input, then calculate again:
Your confidence interval
Calculation steps
For your next survey, you can build the form in Tickbox. Tickbox is a form builder with voice and video. People can answer in text, audio or video, and AI analyzes the responses, so they are easy to read. AI analysis is on all plans, including Free.
What is a confidence interval?
You survey a sample of people, not the full group, so your result is an estimate. A confidence interval gives a range of values for the full group, around your estimate. For example, 100 people give a score from 0 to 100, and the mean score is 50. The standard deviation of the population is known, and it is 20. At 95% confidence, the interval for the mean of the full group is 46.08 to 53.92.
This calculator gives a confidence interval from three types of input. For a mean, it gives a t-interval when the standard deviation comes from your sample, and a z-interval when you know the standard deviation of the population. You can enter the summary values or paste the raw numbers. For a proportion, such as the percentage of people who answered “Yes”, it gives the Wilson score interval. Each result shows the calculation steps, so you can check them by hand. Your numbers stay in your browser.
A narrow interval needs more responses. When you collect the responses, you can use Tickbox, a free form builder with voice and video. AI analyzes the audio, video and text answers on all plans, including Free.
Formulas
Mean, standard deviation known (z-interval)
Mean ± z × σ ÷ √n
Mean, standard deviation from the sample (t-interval)
Mean ± t × s ÷ √n, with n − 1 degrees of freedom
For raw numbers, the calculator first finds the mean and the sample standard deviation:
s = √(Σ(x − mean)² ÷ (n − 1))
Proportion (Wilson score interval)
(p̂ + z² ÷ (2n) ± z × √(p̂(1 − p̂) ÷ n + z² ÷ (4n²))) ÷ (1 + z² ÷ n)
In these formulas:
- n is the sample size.
- σ is the known standard deviation of the population, and s is the standard deviation of the sample.
- p̂ is the sample proportion: successes ÷ n.
- z and t are the critical values for the confidence level. The table gives some of them. The calculator computes t for each number of degrees of freedom.
| Degrees of freedom | 80% | 90% | 95% | 98% | 99% |
|---|---|---|---|---|---|
| 1 | 3.078 | 6.314 | 12.706 | 31.821 | 63.657 |
| 2 | 1.886 | 2.920 | 4.303 | 6.965 | 9.925 |
| 4 | 1.533 | 2.132 | 2.776 | 3.747 | 4.604 |
| 9 | 1.383 | 1.833 | 2.262 | 2.821 | 3.250 |
| 19 | 1.328 | 1.729 | 2.093 | 2.539 | 2.861 |
| 29 | 1.311 | 1.699 | 2.045 | 2.462 | 2.756 |
| 99 | 1.290 | 1.660 | 1.984 | 2.365 | 2.626 |
| z (very large) | 1.282 | 1.645 | 1.960 | 2.326 | 2.576 |
Worked examples
z-interval: n = 100, mean = 50, σ = 20, 95% confidence
- z = 1.960
- Standard error: 20 ÷ √100 = 2
- Margin of error: 1.960 × 2 = 3.920
- Interval: 50 ± 3.920 = 46.08 to 53.92
t-interval: n = 10, mean = 50, s = 8, 95% confidence
- Degrees of freedom: 10 − 1 = 9, so t = 2.262
- Standard error: 8 ÷ √10 = 2.530
- Margin of error: 2.262 × 2.530 = 5.723
- Interval: 50 ± 5.723 = 44.28 to 55.72
Wilson interval: 40 of 100, 95% confidence
- p̂ = 40 ÷ 100 = 0.4, z = 1.960, z² = 3.841
- Denominator: 1 + 3.841 ÷ 100 = 1.038
- Center: (0.4 + 3.841 ÷ 200) ÷ 1.038 = 0.4037
- Half-width: 1.960 × √(0.4 × 0.6 ÷ 100 + 3.841 ÷ 40,000) ÷ 1.038 = 0.0943
- Interval: 0.4037 ± 0.0943 = 30.94% to 49.80%
How to use the calculator
- Select the tab that matches your data: Mean from n, mean and SD, Mean from raw numbers, or Proportion.
- Enter your values. For the first tab, select the type of standard deviation.
- Select the confidence level.
- Select Calculate confidence interval. Read the interval and the calculation steps. If an entry is not valid, a message tells you what to correct.
Confidence interval FAQ
Should I use a z-interval or a t-interval?
Use a t-interval when the standard deviation comes from your sample. This is almost always the case with survey data. Use a z-interval only when you know the standard deviation of the full population from a different source. For large samples, the two intervals are almost the same: at 95% confidence, t is 2.262 for 10 values, 2.045 for 30 values, 1.984 for 100 values, and z is 1.960.
Why does the calculator use the Wilson interval for a proportion?
The simple interval p̂ ± z × √(p̂(1 − p̂) ÷ n), also called the Wald interval, is often too narrow, especially for small samples or for proportions near 0% or 100%. It can also go below 0% or above 100%. The Wilson score interval does not have these problems, and its coverage is closer to the confidence level that you select.
Can I use this for a rating question, such as a 1 to 5 scale?
Yes. Use the raw numbers tab and paste the ratings, or enter the count, the mean and the standard deviation from your survey report. The result is an interval for the mean rating. For the percentage of people who gave a top rating, for example 4 or 5, count them and use the proportion tab.
What does 95% confidence mean?
If you repeat the survey many times with new random samples, and you calculate an interval each time, about 95% of the intervals contain the true value for the full population. It does not mean that there is a 95% probability that the true value is in the one interval that you have.
How is this different from the margin of error calculator?
The margin of error calculator gives the ± value for a proportion before or after a survey, with the normal approximation and an optional population size. This calculator gives the lower and upper limits of the interval, for a mean or for a proportion, from your results.
What does the interval not include?
It includes only the error that comes from a random sample. It does not include errors from unclear questions or from people who did not respond. If people chose to take part, for example from a link on a website, the sample is not random, and the interval can make the result seem more accurate than it is.
Is my data sent to a server?
No. The calculation runs in your browser, and this page does not send or save your numbers. The site uses Plausible analytics to count page visits. Plausible does not receive what you enter.
Do I need an account?
No. The calculator is free and needs no signup.