Guides  /  confidence interval

Confidence intervals: a complete guide

A confidence interval tells you what your data can and cannot rule out — which is almost always more useful than a p-value. This guide explains what the interval genuinely means (and the interpretation that costs marks), calculates one by hand for a mean and for a proportion, shows how sample size drives precision, and sets out how to report intervals in APA style.

Hafiz Ahmad Tariq Written and reviewed by Hafiz Ahmad Tariq, Senior Biostatistician
Updated 17 August 202618 min read
What is a confidence interval?

A confidence interval is a range of plausible values for an unknown population parameter, calculated from sample data. A 95% confidence interval is constructed by a procedure that captures the true population value in 95% of repeated samples. It expresses the precision of an estimate: a narrow interval means the data pin the value down closely, a wide interval means they do not.

Definition

What a confidence interval is

A confidence interval is a range of plausible values for something you cannot observe directly. You measured a sample; you want to say something about the population. The sample mean is your best single guess, but it is certainly a little wrong. The interval quantifies how wrong it might plausibly be.

Reporting a mean of 24.8 says nothing about precision. Reporting 24.8, 95% CI [22.1, 27.5] says the data are consistent with a population mean anywhere from about 22 to about 27.5 — and are not consistent with 30. That second sentence is a finding. The first is a number.

The interval is about the estimate, not the people

A 95% CI of [22.1, 27.5] does not mean 95% of your participants scored between 22.1 and 27.5. That would be a reference range, and it is far wider. The confidence interval describes how precisely you have located the average.

Why examiners care about it

A p-value answers one narrow question: could this result have arisen by chance if the null were true? A confidence interval answers the question you actually had — how big is the effect, and how sure are we? Journals in medicine, psychology and education increasingly require intervals precisely because a p-value alone hides the difference between a precisely estimated null result and a study that was simply too small to tell.

Interpretation

What 95% confidence actually means

This is the part that is most often stated incorrectly, including in published work. The confidence is a property of the procedure, not of any single interval you happen to have calculated.

true population mean μ = 100 misses μ 20 samples from the same population, each with its own 95% interval. 19 capture the true mean; 1 does not. That is what “95% confident” means.
Twenty samples drawn from the same population, each with its own 95% interval. Nineteen capture the true mean; one misses it. You never know which kind you have.

Imagine repeating your study 100 times, each time drawing a fresh sample and computing a 95% interval. About 95 of those intervals would contain the true population value and about 5 would not. Your study produced one of them. You cannot tell which.

Correct interpretations

  • “We are 95% confident the population mean lies between 22.1 and 27.5”
  • “Values outside this range are relatively implausible given our data”
  • “The procedure used captures the true value 95% of the time”
  • “Our data cannot rule out an effect as small as 22.1 or as large as 27.5”

Incorrect interpretations

  • “There is a 95% probability the true mean is in this interval” — the true mean is fixed, not random
  • “95% of participants scored in this range” — that is a reference range
  • “95% of future sample means will land in this interval” — that is a prediction interval
  • “The interval excludes zero, so the effect is important” — significance is not importance
The distinction that gets marked

Once you have calculated a specific interval, the true value either is or is not inside it — there is no probability left. This is why careful writing says “we are 95% confident” rather than “there is a 95% probability”. Examiners in statistics-literate departments do check this sentence.

Calculation

The formula, and where each piece comes from

Almost every confidence interval has the same three-part shape: an estimate, plus and minus a critical value multiplied by a standard error.

CI = estimate ± (critical value × standard error)

PieceWhat it isWhere it comes from
EstimateYour best single guessThe sample mean, proportion, difference or coefficient
Critical valueHow many standard errors wide to goThe t or z distribution, set by your confidence level
Standard errorHow much the estimate bounces between samplesThe sample SD divided by √n

Choosing the critical value

Confidence levelz (large samples)Interpretation
90%1.645Narrower, but wrong 1 time in 10
95%1.96The convention in most fields
99%2.576Wider, but wrong only 1 time in 100

There is a genuine trade-off here and it is not free. A 99% interval is more likely to contain the true value, but it is wider — so it rules out less. Raising your confidence level buys certainty with precision. Use 95% unless your field or your registered protocol says otherwise.

t or z?

Use t when you estimated the standard deviation from your sample, which is nearly always. Use z only when the population SD is genuinely known. With n above about 100 the two are close enough not to matter; below n = 30 the difference is substantial, and using z will make your interval too narrow.

Not sure which interval your design needs?

Send the summary statistics you already have. A named statistician confirms the right interval, computes it, and writes the reporting sentence you can paste into your results chapter.

Get a fixed quote

Worked example

Worked example: a confidence interval for a mean

A study measures wellbeing scores in 50 participants. The sample mean is 24.8 and the sample standard deviation is 9.6. We want a 95% confidence interval for the population mean.

Step 1 — the standard error

SE = s / √n = 9.6 / √50 = 9.6 / 7.071 = 1.358

The standard error is the standard deviation of the sample mean across hypothetical repeated samples. It is much smaller than the SD of the raw scores, because averaging cancels out individual variation.

Step 2 — the critical value

We estimated the SD from the sample, so we use t with df = n − 1 = 49. For a 95% interval, t = 2.010.

Step 3 — the margin of error

margin = t × SE = 2.010 × 1.358 = 2.73

Step 4 — the interval

CI = 24.8 ± 2.73 = [22.07, 27.53]

QuantityValue
Sample mean24.8
Sample SD9.6
n50
Standard error1.358
t (df = 49)2.010
Margin of error2.73
95% CI[22.07, 27.53]
Writing it up

“Mean wellbeing was 24.8 (SD = 9.6, 95% CI [22.07, 27.53]).” If a benchmark value of 30 had been proposed, this interval excludes it, so the data are inconsistent with that benchmark.

Worked example

Worked example: a confidence interval for a proportion

Proportions need different arithmetic because the standard error depends on the proportion itself. Suppose 38 of 120 respondents agreed with a statement, so p̂ = 38/120 = 0.317.

The standard approach (Wald)

SE = √(p̂(1 − p̂) / n) = √(0.317 × 0.683 / 120) = √0.001804 = 0.0425

CI = 0.317 ± 1.96 × 0.0425 = [0.234, 0.400] — that is 23.4% to 40.0%.

The Wald interval misbehaves at the edges

When the proportion is near 0 or 1, or the sample is small, the Wald interval can extend below 0 or above 1 — impossible values. It also under-covers: a nominal 95% Wald interval often captures the truth barely 90% of the time. Use the Wilson score interval instead, which is what our calculator computes.

When to use Wilson instead

Small samples — below about n = 40, always
Proportions near 0 or 1 — below 0.1 or above 0.9
Any count below 5 — if successes or failures are fewer than 5, Wald is unreliable
When you want an interval that cannot leave [0, 1] — Wilson is bounded by construction
Compute it without the arithmetic

Our confidence interval calculator handles means and proportions, uses the Wilson score method for proportions, and gives you the interval with the reporting sentence already formatted.

Use the calculator

Precision

What makes an interval narrow or wide

Three things, and only one of them is usually under your control.

sample size increases from 25 to 1000"> mean n = 25n = 50n = 100 n = 400n = 1000 ±13.6±8.0±4.8 ±2.6±1.4 Precision improves with the square root of n — quadrupling the sample halves the interval.
With the same variability, precision improves with the square root of n. Getting twice as precise costs four times the sample.
FactorEffect on widthUnder your control?
Sample size (n)Larger n → narrower, by √nYes — at the design stage
Variability (SD)More spread → widerPartly — better measurement reduces it
Confidence levelHigher confidence → widerYes, but 95% is conventional

The square-root relationship is the one that surprises people. Halving the width of your interval requires quadrupling the sample, not doubling it. This is why post-hoc requests to “just collect a few more” rarely rescue an imprecise study, and why the sample size should be settled before data collection begins.

A wide interval is a finding, not a failure

If your interval runs from −2 to +14, say so. It means the study cannot distinguish a small harm from a large benefit — which is genuinely useful information for whoever designs the next one. Reporting it as “no significant difference” hides that entirely.

Inference

Why an interval beats a p-value

Both come from the same arithmetic, so they never contradict each other: if a 95% interval excludes the null value, the two-tailed p is below .05. But they carry very different amounts of information.

Resultp-value says95% CI says
Small effect, big samplep = .01 — significant[0.4, 1.8] — precisely estimated, and small
Large effect, small samplep = .09 — not significant[−0.9, 12.4] — could be large, cannot tell
No effect, big samplep = .62 — not significant[−0.3, 0.5] — genuinely near zero
No effect, small samplep = .61 — not significant[−8.2, 13.9] — uninformative

Rows two and four both produce a non-significant p-value, and reporting them the same way — “no significant difference” — is actively misleading. The interval separates them immediately: one study found a possibly large effect it could not pin down, the other found nothing much. Only the interval tells you which.

The most common reviewer comment

“The authors interpret a non-significant result as evidence of no effect.” Absence of evidence is not evidence of absence, and the confidence interval is how you tell the difference. If the interval is wide, the honest conclusion is that the study was underpowered.

Comparison

Intervals for differences, and why they matter more

Most research questions are about a comparison, not a single group. “Is the intervention better than the control?” is a question about a difference, and the interval you should report is the interval for that difference — not one interval per group.

Worked example: the difference between two means

An intervention group (n = 40) scores 28.4 (SD = 8.9). A control group (n = 38) scores 24.2 (SD = 9.4). The observed difference is 4.2 points.

First the pooled standard deviation, weighting each group by its degrees of freedom:

sₓ = √[((39 × 8.9²) + (37 × 9.4²)) / 76] = √[(3089.2 + 3269.3) / 76] = √83.7 = 9.15

Then the standard error of the difference:

SE = sₓ × √(1/n₁ + 1/n₂) = 9.15 × √(1/40 + 1/38) = 9.15 × 0.2265 = 2.073

With df = 76, t = 1.992, so the margin is 1.992 × 2.073 = 4.13:

95% CI for the difference = 4.2 ± 4.13 = [0.07, 8.33]

Read what that interval is telling you

It just barely excludes zero, so p is just below .05. But the honest interpretation is that the data are consistent with a difference anywhere from 0.07 points — effectively nothing — to 8.33 points, which would be substantial. Reporting this as “the intervention was effective” overstates it considerably. The study establishes a direction, not a magnitude.

Why two separate intervals mislead

Had you instead reported a 95% interval for each group — [25.6, 31.2] and [21.1, 27.3] — you would have seen them overlap and might have concluded there was no difference. That conclusion would be wrong. Overlap between separate intervals is not a significance test, and the arithmetic above shows exactly why: the standard error of a difference is not the sum of the two individual standard errors.

What you want to claimInterval to report
The mean of one groupCI for that mean
One group differs from anotherCI for the difference
The size of an effectCI for the effect size (d, g, OR, r)
A change from baselineCI for the paired difference

Intervals around effect sizes

An effect size without an interval is as incomplete as a mean without one. Cohen's d of 0.62 sounds like a medium effect; d = 0.62, 95% CI [0.19, 1.05] tells you the data are consistent with anything from a small to a large effect. That interval is what stops a single study being over-read, and it is what meta-analyses eventually pool.

A rule that will serve you well

Every number you interpret substantively should carry an interval. If you would draw a conclusion from it, you need to know how precisely you measured it.

Pitfalls

Six mistakes that cost marks

1. Saying there is a 95% probability the mean is in the interval

The population mean is a fixed number. Once the interval is calculated, it either contains it or does not. Write “we are 95% confident”.

2. Treating overlap between two intervals as a significance test

Two 95% intervals can overlap while the difference between the groups is still significant. If you want to test a difference, compute an interval for the difference, not two separate intervals and a visual comparison.

3. Using z when you estimated the SD

With n = 20, using 1.96 instead of t = 2.093 makes the interval about 7% too narrow. Use t unless the population SD is genuinely known.

4. Reporting the interval but interpreting only the p-value

Putting the CI in the table and then writing “the difference was significant” wastes it. Interpret the range: what does the lower bound mean in practice? What does the upper bound rule out?

5. Using Wald intervals for small or extreme proportions

It produces impossible bounds and under-covers. Use Wilson.

6. Computing intervals on skewed data without checking

The formula assumes the sampling distribution of the mean is roughly normal. With n above about 30 the central limit theorem usually handles this, but with small samples and severe skew, bootstrap the interval instead.

Reporting

Reporting intervals in APA style

APA 7 requires square brackets, a comma between bounds, and the confidence level stated on first use.

ContextHow to write it
A meanM = 24.8, SD = 9.6, 95% CI [22.07, 27.53]
A differenceThe groups differed by 4.2 points, 95% CI [1.1, 7.3]
A proportion31.7% agreed, 95% CI [23.4%, 40.0%]
An effect sized = 0.62, 95% CI [0.19, 1.05]
An odds ratioOR = 2.14, 95% CI [1.32, 3.47]
State the confidence level the first time, then “CI” alone is acceptable
Square brackets, comma separator — not parentheses, not a dash
Match the decimal places to the estimate itself
Give an interval for every effect size you report, not just the significant ones
Interpret the bounds in the text, do not leave them in the table alone
The sentence that earns marks

“Wellbeing was 4.2 points higher in the intervention group, 95% CI [1.1, 7.3]. The interval excludes zero, and its lower bound of 1.1 points remains above the 1-point threshold previously proposed as clinically meaningful, so the data are consistent with a benefit of at least minimal practical importance.” That paragraph interprets the bounds rather than restating them.

Have your intervals and reporting checked before submission

Send your results chapter. A named statistician verifies every interval, checks the interpretation against what the numbers support, and flags anything an examiner would query.

See results chapter review

Answers

Frequently asked questions

What does a 95% confidence interval actually mean?

It means the procedure used to build the interval captures the true population value in 95% of repeated samples. It does not mean there is a 95% probability that this particular interval contains the true value — once calculated, the interval either contains it or it does not.

Is a confidence interval better than a p-value?

For most purposes, yes. Both come from the same arithmetic, but the interval also tells you the size and precision of the effect. Critically, it distinguishes a precisely estimated null result from a study that was simply too small to detect anything — two situations a p-value reports identically.

Why is my confidence interval so wide?

Almost always small sample size, high variability, or both. Width shrinks with the square root of n, so quadrupling the sample halves the interval. A wide interval is a legitimate finding: report it and say the study could not distinguish between the values it spans.

Should I use t or z for my confidence interval?

Use t whenever you estimated the standard deviation from your sample, which is nearly always the case. Use z only if the population standard deviation is genuinely known. Above about n = 100 the difference is negligible; below n = 30 it matters a great deal.

Can two confidence intervals overlap and still be significantly different?

Yes. Overlapping 95% intervals do not imply a non-significant difference — the groups can still differ at p < .05. If you want to test the difference, compute a confidence interval for the difference itself rather than comparing two separate intervals by eye.

What is the difference between a confidence interval and a prediction interval?

A confidence interval estimates where the population mean lies. A prediction interval estimates where a single future observation will fall, and is always much wider because it carries individual variability as well as uncertainty about the mean.

How do I calculate a confidence interval for a percentage?

Use the Wilson score interval rather than the standard Wald formula, especially with small samples or percentages near 0 or 100. The Wald interval can produce impossible bounds below 0% or above 100% and tends to be too narrow.

Send the data. Get a fixed quote.

Attach your dataset or just describe the project. A named statistician replies with a price and a deadline, usually within one working day.