Confidence interval calculator

Build a confidence interval at any level for a ratio measure, a mean difference, or a single proportion, with the critical value, standard error, and margin shown.

A confidence interval is the range of values consistent with your data at a chosen level, and it shows how precise an estimate is. This calculator builds an interval for a ratio measure (odds, risk, or hazard ratio) on the log scale, for a mean difference on the original scale, and for a single proportion using the Wilson score method, at whatever confidence level you set.

95% confidence interval

1.1179 to 2.0127

Built on the log scale and exponentiated back.

Working

Point estimate (ratio)1.5000
Log estimate ln(est)0.4055
Standard error of the log0.1500
Critical value (z)1.9600

Report-ready text

The estimate was 1.50 (95% CI 1.12 to 2.01).

What a confidence interval tells you, and what it does not

A confidence interval answers a practical question: given the data in front of you, what range of true values is compatible with what you observed? The point estimate, whether an odds ratio, a mean difference, or a proportion, is the single best guess. The interval around it is the honest admission that a sample is not the whole population. Report the estimate without an interval and you hide the uncertainty; report the interval and a reader can see at a glance whether the evidence is sharp or vague.

The standard reading of a 95% interval is a statement about a procedure, not about this one number. If you repeated the study many times and built an interval each time, about 95% of those intervals would bracket the true value. It is tempting, but wrong, to say there is a 95% probability that the true value sits inside this particular interval. That distinction matters when you write up a result, because the interval describes how precisely you have pinned down the effect, not the odds on a single guess. For the deeper logic, our guide to choosing and reporting effect sizes walks through how intervals attach to each measure.

When to lean on the interval rather than the p-value

In a systematic review the interval is more useful than a bare significance test because it shows both direction and magnitude. An effect can be statistically significant yet trivially small, or non-significant yet clinically interesting with a wide interval that simply reflects a small sample. Use the interval when you need to judge whether an effect is large enough to matter, when you compare studies that disagree, and whenever you pool results in a meta-analysis, where each study’s interval feeds the inverse-variance weight. Do not use a single interval as a verdict on a whole body of evidence; that is the job of the pooled estimate you can build with our meta-analysis pooling calculator.

Reading the limits, with a worked example

Interpretation starts with the null value for the measure. For a ratio measure the null is 1: if the interval crosses 1, the data are compatible with no effect. For a difference the null is 0. Suppose a trial reports a risk ratio of 0.74 with a 95% interval of 0.61 to 0.90. The whole interval sits below 1, so the treatment plausibly reduces risk, and by a meaningful amount; the best estimate is a 26% relative reduction, and even the least favourable end of the interval still shows a 10% reduction. Now compare a second trial reporting 0.74 with an interval of 0.48 to 1.14. Same point estimate, but the interval straddles 1, so you cannot rule out no effect or even a small harm. The two results look identical until you read the intervals.

Notice that the interval for a ratio is not symmetric: 0.61 and 0.90 are not the same distance from 0.74. That is because ratio measures are built on the log scale, where the sampling distribution is roughly normal, then exponentiated back. The same applies when you compare an odds ratio against a risk ratio, both of which this tool handles on the log scale. For a single proportion the calculator uses the Wilson score method, which keeps the limits inside the valid range of 0 to 1 even when the count is tiny. If you are working with one prevalence figure, the dedicated single proportion interval calculator also gives you the Clopper-Pearson exact interval for comparison.

Common mistakes researchers make

Three errors recur. First, treating “the interval crosses the null” as proof of no effect; absence of significance is not evidence of absence, especially with a wide interval. Second, reading overlapping intervals between two groups as proof the groups do not differ; intervals can overlap while a direct test of the difference is still significant, so judge the difference on its own interval. Third, using the normal approximation for a proportion near 0 or 1, which can push a limit below 0 or above 1 and undercover the true value. The interval is a tool for honest reporting, and feeds straight into how you present a pooled result and how reviewers grade certainty under the GRADE framework, where imprecision, judged largely by interval width, is one of the domains that can downgrade confidence in the evidence.

How it works

The critical value comes from the standard normal distribution at the confidence level you choose, taking the two-sided tail on each side.

z = normalQuantile(1 - (1 - level/100) / 2)

A ratio measure is built on the log scale and exponentiated back:

CI = exp( ln(est) +/- z * SE )

A mean difference uses the plain normal interval:

CI = est +/- z * SE

A single proportion uses the Wilson score interval:

p = x / n; denom = 1 + z^2/n

centre = (p + z^2/(2n)) / denom

half = (z/denom) * sqrt( p*(1-p)/n + z^2/(4n^2) )

CI = [centre - half, centre + half] clamped to [0, 1]

Frequently asked questions

What does a 95% confidence interval actually mean?
It is the range of values consistent with your data at the chosen level of confidence. If you repeated the study many times and built a 95 percent interval each time, about 95 percent of those intervals would contain the true value. It is not the probability that the true value sits in this one interval, but it does show how precise the estimate is.
Why is the interval for an odds ratio not symmetric?
Ratio measures such as odds ratios, risk ratios, and hazard ratios are built on the log scale, where the sampling distribution is roughly normal. The interval is formed around the log estimate and then exponentiated back to the ratio scale, which makes the lower and upper limits unequal distances from the point estimate.
When should I use the Wilson score interval for a proportion?
The Wilson score interval is the recommended default for a single proportion or prevalence, especially when the count of events is small or the proportion is near zero or one. The simple normal approximation can fall outside the range zero to one and undercover in those cases, while the Wilson interval stays inside the valid range and behaves well.
How do I get the standard error to enter here?
For a ratio measure, the standard error on the log scale is the width of a reported interval divided by twice the critical value, taken on the log of the limits. For a mean difference, statistical software reports the standard error directly. For a single proportion you only need the events and the sample size, since the interval is computed from those.
Is a wider confidence interval always worse?
A wider interval means a less precise estimate, usually because the sample is small or the outcome is rare. It is not wrong, it simply carries more uncertainty. Two studies can report the same point estimate yet differ greatly in usefulness because one interval is tight and one is wide, so the interval, not the point estimate alone, should drive how confidently you read a result.
Why does a 99% confidence interval get wider than a 95% one?
Raising the confidence level raises the critical value, so the margin of error grows and the interval widens. A 99 percent interval has to capture the true value more often across repeated samples, and the price of that extra assurance is a less precise range. Reviewers report 95 percent intervals by convention, which balances coverage against precision.