Confidence Interval Calculator
Get a confidence interval for a single average, or for the gap between two groups measured as means or proportions, in absolute or relative terms. Choose your confidence level and read both the two-sided and one-sided bounds.
Related calculators
Created by the Reeliy Editorial Team. Last updated: Oct 19, 2026
How to use the calculator
Start by choosing the kind of interval under Confidence interval.
- Single group: enter the standard deviation, the sample size and the sample mean. You get an interval around the mean.
- Difference between groups, proportions: enter the sample size of group A and group B and the outcome for each, as a proportion (0.05), a rate in percent (5) or a number of events (50). Group A is the baseline, and the difference is reported as B − A.
- Difference between groups, means: choose raw data and paste the observations of each group, or choose summary data and enter each group's size, mean and standard deviation.
For two groups you also choose whether the inference is about the absolute difference (B − A) or the relative difference ((B − A) ÷ A, a percent change). Finally set the confidence level, 95% by default.
The output has the point estimate, the two-sided confidence interval, a right-sided and a left-sided interval, the estimate with its margin, a one-sided p-value and the Z score (for proportions) or T score (for means). Raw-data mode also lists the sample sizes and means it computed. The "Left-Sided" and "Right-Sided" labels refer to which end of the scale is unbounded for the two-group modes: the right-sided interval has a finite lower bound and runs up to +∞. In single-group mode the labels are the other way round.
In single-group mode the "Value ±" row uses the one-sided multiplier, so its margin matches the one-sided bounds rather than the two-sided interval. In the two-group modes it matches the two-sided interval.
What is a confidence interval?
Computed from sample data, a confidence interval is a range built to contain the true value of a parameter, such as a population mean, in a stated share of repeated studies. At a 95% level, 95 out of 100 intervals produced by the same procedure on fresh samples would cover the true value. A wide interval signals an imprecise estimate, while a narrow one signals that the data pin the value down closely.
Asking for more confidence stretches the interval, whereas collecting more data tightens it. Read an interval as the set of effect sizes the data do not rule out: a value outside it can be rejected at the matching significance level, while a value inside it cannot. The p-value calculator answers the related question of how surprising the data are under one specific null value.
Confidence interval formulas
Every interval has the shape estimate ± multiplier × standard error. The multiplier z comes from the normal distribution and depends only on the confidence level.
single mean: x̄ ± z × s ÷ √n
difference of means: (x̄₂ − x̄₁) ± z × √(s₁² ÷ n₁ + s₂² ÷ n₂)
difference of proportions: (p₂ − p₁) ± z × √[ p̄(1 − p̄)(1 ÷ n₁ + 1 ÷ n₂) ]p̄ is the pooled proportion, (events₁ + events₂) ÷ (n₁ + n₂).
For a relative difference the baseline value in the denominator is itself uncertain, which adds variance, so the absolute interval cannot simply be divided by A. The calculator uses a ratio method based on Fieller's theorem in the form given by Kohavi and colleagues, which uses the coefficient of variation of each group's mean. The resulting interval is not symmetric around the observed relative change and is typically wider on the upside.
The one-sided bounds use the multiplier for twice the error rate, so a 95% one-sided bound uses the same z as a 90% two-sided interval.
| Confidence level | z |
|---|---|
| 80% | 1.2816 |
| 90% | 1.6449 |
| 95% | 1.9600 |
| 97.5% | 2.2414 |
| 98% | 2.3263 |
| 99% | 2.5758 |
| 99.9% | 3.2905 |
Worked examples
One mean. A sample of 36 has a mean of 72.4 and a standard deviation of 9.1. The standard error is 9.1 ÷ √36 = 1.5167. At 95%, the margin is 1.96 × 1.5167 = 2.973, so the interval is 69.427 to 75.373. At 99% the multiplier rises to 2.5758 and the interval widens to 68.493 to 76.307.
Two proportions. Group A had 56 conversions out of 800 (7%) and group B had 80 out of 800 (10%), a difference of 0.03 or 3 percentage points. The pooled proportion is 136 ÷ 1,600 = 0.085, the standard error is √(0.085 × 0.915 × 2 ÷ 800) = 0.01394, and the 95% margin is 1.96 × 0.01394 = 0.0273. The interval for B − A is 0.0027 to 0.0573. The Z score is 0.03 ÷ 0.01394 = 2.15 with a one-sided p-value of about 0.016.
Two means. Group A has 40 observations with a mean of 250 and a standard deviation of 30; group B has 40 with a mean of 262 and a standard deviation of 34. The standard error of the difference is √(900 ÷ 40 + 1,156 ÷ 40) = 7.169, so the 95% interval for 12 is 12 ± 14.05, from −2.05 to 26.05. The interval includes zero, which matches the T score of 1.67 and a one-sided p-value just under 0.05 that would not clear a two-sided 5% test.
Relative change. For the same two conversion rates the relative lift is (10% − 7%) ÷ 7% = 42.86%. The 95% interval for the relative difference runs from about −0.02% to 95.34%: the observed lift is large, but the data are also compatible with essentially no lift at the lower end.
One-sided and two-sided intervals
A two-sided interval has a lower and an upper bound. A one-sided interval has only one finite bound; the other end is infinite. Use a one-sided bound when you only care about one direction, for example "is the new version at least this much better?", and decide that before seeing the data. A two-sided 90% interval is two 95% one-sided intervals joined together, which is why the 90% two-sided multiplier, 1.6449, is also the 95% one-sided one.
Reading an interval correctly
- A 95% interval is not a 95% probability that the true value is inside this particular interval. The 95% describes the long-run behaviour of the procedure, not the one interval you computed.
- It does not predict where 95% of future estimates will land. Future studies fall inside any given interval less often than its nominal level.
- Overlapping intervals do not mean no difference. Compare groups through the interval for their difference.
The calculator assumes independent observations and a normal sampling distribution of the estimate, which is reasonable for moderate to large samples. It is not suitable for comparing more than two groups, for several outcome metrics at once, or for data that are monitored repeatedly with the option to stop early. For the spread of a single data set see the standard deviation calculator, and for probabilities under a normal curve the normal distribution calculator.
Frequently asked questions
What does a 95% confidence interval mean?
It means the method used to build the interval captures the true value in 95% of repeated samples. For one computed interval the true value either lies inside it or does not; the 95% is a property of the procedure.
How do I get a narrower confidence interval?
Collect more observations, which shrinks the standard error in proportion to the square root of the sample size, reduce the variability in the data, or accept a lower confidence level. Quadrupling the sample size roughly halves the width.
Should I use the absolute or the relative difference?
Use the absolute difference when you care about the raw gap, such as 3 percentage points or 12 units. Use the relative difference when the effect is naturally a percent change, but do not convert one interval into the other by simple division, because the baseline is also uncertain.
Why does the interval for a difference sometimes include zero while the p-value is below 0.05?
The p-value in the output is one-sided, while the interval is two-sided. A one-sided p-value of 0.049 corresponds to a two-sided value of about 0.098, which does not clear a two-sided 5% test, so the 95% two-sided interval still contains zero.
References
- Greenland, S. et al. (2016). Statistical tests, P values, confidence intervals, and power: a guide to misinterpretations. European Journal of Epidemiology, 31, 337-350. doi:10.1007/s10654-016-0149-3
- Kohavi, R., Longbotham, R., Sommerfield, D. and Henne, R.M. (2009). Controlled experiments on the web: survey and practical guide. Data Mining and Knowledge Discovery, 18, 140-181
- Fieller, E.C. (1954). Some problems in interval estimation. Journal of the Royal Statistical Society, Series B, 16(2), 175-185
Cite this calculator and page
If you use this page in your work, you can cite it as:
Reeliy Editorial Team. (2026). Confidence Interval Calculator. Reeliy. https://reeliy.com/calculators/confidence-interval-calculator“Confidence Interval Calculator.” Reeliy, 2026, https://reeliy.com/calculators/confidence-interval-calculator.