Confidence interval calculator

This confidence interval calculator gives the range that is likely to contain the true value behind your sample. Enter raw data, or a mean with its standard deviation and sample size, or a count out of a total, and get the confidence interval (80% to 99.9%) with its margin of error and the method used.

Your numbers are calculated in your browser. Nothing you enter is sent or stored.

Confidence interval calculatorOr describe it in Studio →

95% confidence interval

3.213 to 6.787

Mean
5
Margin of error
± 1.7875
Standard error
0.7559
Method
t distribution, t = 2.365 on 7 df

To report

M = 5.00, 95% CI [3.21, 6.79]

Check your result: a mean’s interval is centred on the mean (5 ± 1.79 runs from 3.21 to 6.79), a proportion’s interval stays between 0% and 100%, and a higher level is always wider: 99% gives 2.35 to 7.65 for the same eight values.
six confidence levels
80–99.9%
six confidence levels
t for 95% with eight values
2.365
t for 95% with eight values
Wilson 95% CI for 15 out of 50
19.1–43.8%
Wilson 95% CI for 15 out of 50
  • Mean: from data or mean, SD, n
  • Proportion: Wilson score
  • 80% to 99.9% confidence
  • Uses t, not 1.96, for means
  • Runs in your browser, free

01

How to calculate a confidence interval

  1. Choose what you have: a list of measurements, summary statistics, or a count of “yes” outcomes.
  2. Enter the numbers and pick the confidence level.
  3. Read the interval and copy the formatted line into your results.
−1.960+1.962.5%2.5%95%test statistic (z or t)
What a two-tailed p value measures. The curve is what the test statistic would look like if there were no real effect. The p value is the shaded area: the chance of a result at least as far from the centre as yours, in either direction. Here the cut-offs sit at ±1.96, which leaves 5% in the two tails together.

02

Confidence interval for a mean

mean ± t × s ÷ √n
t = critical value of the t distribution on n − 1 degrees of freedom

Example: eight measurements with mean 5 and SD 2.14. The standard error is 2.14 ÷ √8 = 0.756 and t for 95% on 7 degrees of freedom is 2.365, so the interval is 5 ± 1.79: from 3.21 to 6.79.

nt for 95%Compared with z = 1.96
52.77642% wider
102.26215% wider
302.0454% wider
1001.9841% wider

Using 1.96 for a small sample makes the interval too narrow. The calculator always uses t for means.

03

Confidence interval for a proportion

For a count x out of n, the calculator uses the Wilson score interval (Wilson, 1927), with p̂ = x ÷ n:

centre = (p̂ + z²/2n) ÷ (1 + z²/n)
half-width = z × √( p̂(1 − p̂)/n + z²/4n² ) ÷ (1 + z²/n)

Example: 15 of 50 (30%) gives a 95% interval of 19.1% to 43.8%. The simpler “Wald” formula p̂ ± z√(p̂(1 − p̂)/n) gives 17.3% to 42.7% here, and can produce limits below 0% or above 100% when the proportion is near either end or the sample is small. Wilson’s interval stays within 0 to 100% and is not centred on p̂.

04

What a 95% confidence interval means

If you repeated the study many times and computed an interval each time, about 95% of those intervals would contain the true value. It is a statement about the method, not a 95% probability that the true value lies in this particular interval.

A narrow interval means a precise estimate. Larger samples and less variable data narrow it; asking for 99% instead of 95% widens it.

05

Confidence interval, SD and SEM

The standard deviation describes the spread of individual values. The standard error and the confidence interval describe the precision of the mean. Error bars can show any of the three, so always say which. The standard deviation calculator reports all of them from one list of numbers.

06

Common mistakes with confidence intervals

  • Using 1.96 for a small sample. For the eight values in the example, 1.96 gives a margin of 1.48 instead of 1.79, an interval 17% too narrow.
  • Using the SD where the standard error belongs. 5 ± 2.365 × 2.14 runs from −0.06 to 10.06: that range describes individual values, not the mean.
  • The Wald formula for a rare outcome. For 1 out of 20 it gives −4.6% to 14.6%; Wilson’s interval is 0.9% to 23.6%.
  • Reading overlapping intervals as “no difference”. Means of 10 and 13, each with a standard error of 1, have 95% intervals of 8.04 to 11.96 and 11.04 to 14.96, which overlap, yet the difference is significant: z = 2.12, p = .034.

Trust

How this page is checked

  • The calculation runs on code with automated tests against worked reference values. Every number in the examples on this page was produced by that same code, not typed by hand.
  • The formulas and conventions used are stated on the page, so you can reproduce the result yourself or compare it with your own software.
  • Last reviewed by the Sciloom team, Zebra Nine Studio Inc. It is a tool for research and teaching, not a substitute for a statistician, a validated lab method or medical advice.

Cite this page

Sciloom. (2026). Confidence interval calculator. Zebra Nine Studio Inc. https://sciloom.si/confidence-interval-calculator

Read the full methodology · Who makes Sciloom

Frequently asked questions

How do I calculate a 95% confidence interval?

For a mean: take the mean plus and minus the t critical value times the standard error (SD ÷ √n). The calculator does this from raw data or from the mean, SD and n.

When do I use t instead of z?

Use t whenever the standard deviation is estimated from the sample, which is nearly always. The two agree for large samples; for small ones z gives an interval that is too narrow.

What is the margin of error?

Half the width of the confidence interval: the amount added to and subtracted from the estimate.

Why is the proportion interval not symmetric?

The Wilson interval is pulled slightly toward 50%, which keeps it inside 0 to 100% and makes it more accurate for small samples and extreme proportions.

Showing the interval as error bars? Say so in the legend: the figure legend generator has a line for it.
Free to start, no sign-up.
Back to the tool ↑

More research tools