Skip to main content
The best never guessGet 60 days unlimited Dovetail
Canva
GuidesResearch methods

How to calculate the confidence interval formula


The confidence interval formula is CI = x̄ ± z (s / √n): the sample mean, plus or minus the z-value for your chosen confidence level multiplied by the standard error (the sample standard deviation divided by the square root of the sample size). The result is a range of values that’s likely to contain the true value for the wider population.

Confidence intervals matter because they express how accurate an estimate is. Deriving insight from a small sample and applying it accurately at a much broader scale is what makes market trustworthy at scale.

When you apply the statistical average of a small to a larger population, accuracy varies with sample size and variability. The confidence interval formula quantifies that accuracy so you can state it precisely.

[Embed: 1QRx4m3axKbEtdiGslIn1K]

What exactly is a confidence interval?

Uncertainty is a fact of life, but it isn’t completely random. You can predict, with statistical accuracy, the likelihood of certain events by measuring them in a smaller sample first. Of course, that information will only be accurate to a certain degree when applied to a larger group—the confidence interval expresses the estimate’s accuracy.

A confidence interval is a range, expressed as an upper and lower limit, that’s likely to contain the true population value. The confidence level attached to it—typically 90%, 95%, or 99%—tells you how reliable the method is: if you drew many samples and calculated an interval for each, that percentage of intervals would contain the true value.

The final result is an estimated mean, plus or minus a certain amount, creating a wider or narrower range of expected values. Higher confidence levels produce wider ranges; narrower ranges are more precise but come with less confidence. Depending on the confidence level (or the allowable margin of error), the following elements change:

  • the predicted value range in a new, often larger, sample
  • the confidence you can have in that range

When do you use confidence intervals?

If you have a key decision to make that impacts your revenue, you need to know how likely it is that your estimates are correct. Confidence intervals tell you this. The confidence interval formula is useful whenever you want to make decisions within a certain threshold of certainty.

In business, confidence intervals help predict KPIs and demographic measurements that profits often depend on.

Here are some specific examples of when confidence intervals come in handy:

  • Marketers wanting to know how likely the results of a small ad campaign would result in a similar percentage of lead conversions when scaled up.
  • Revenue teams interested in learning how accurately profits after investing resources in one market segment might translate to the same ROI in all other market segments.
  • Product designers seeing promising UX statistics in a suggesting a new feature is a hit, but they aren’t sure if those results will translate to the wider population.

Why is the confidence interval formula important?

The confidence interval formula gives researchers accurate predictions within a specified margin of error. It takes statistical analysis outside the bounds of small, time-limited samples, letting statisticians apply known patterns to new, larger populations.

Use the confidence interval formula to take the average of a random sample and predict how accurately those conclusions apply to a larger group. There are other variables to be aware of (such as standard deviation), so let’s pick apart and apply the confidence interval formula.

What is the confidence interval formula?

The confidence interval formula takes the sample mean (x̄), then adds and subtracts the product of the z-value for the confidence level (z) and the sample standard deviation (s) divided by the square root of the sample size (√n):

CI = x̄ ± z (s / √n)

  • CI = confidence interval, which will result in an upper and lower value range
  • x̄ = sample mean, derived from the original sample
  • z = the z-value for your chosen confidence level—the number of standard errors that corresponds to that level of confidence (for example, 1.96 for 95%)
  • s = sample standard deviation, a single figure showing how spread out the values in the original sample are
  • n = sample size of the original sample

How to calculate the confidence interval

  1. Find the sample mean (x̄). Average the scores of all participants in the original sample. This is the figure the confidence interval (CI) is centered on.
  2. Calculate the sample standard deviation (s). Subtract the sample mean (x̄) from each individual score, square each difference, add the squares together, divide by n − 1, then take the square root of the result.
  3. Find the z-value for the preferred confidence level. The confidence level is typically 90% to 99%. Common z-values are 1.645 for 90%, 1.96 for 95%, and 2.576 for 99%.
  4. Use these results in the formula. Place each figure into the formula to discover the confidence interval (CI) range.
  5. Interpret your results. This is the range where the true population value is likely to fall, with the level of certainty set by your confidence level.

Remember that the higher the confidence level, the wider the interval. A wide interval is more likely to contain the true value but less precise; a narrow interval is more precise but carries less confidence.

If the confidence interval is too wide, it may not be useful. Choose an for your purposes.

Examples of confidence interval calculations

You can work through these examples by hand or in a spreadsheet.

Confidence interval formula—example #1

  1. Use the test scores 80, 75, 90, 80, 75, 75, 85, 80, 75, and 90 as the sample data. Add these numbers together and divide by 10 to get an average score, or sample mean, of 80.5.
  2. Calculate the sample standard deviation. Subtract the sample mean from each score and square each difference: (80 − 80.5)² + (75 − 80.5)², and so on. The squared differences sum to 322.5. Divide by n − 1 (here, 9) to get 35.83, then take the square root: s ≈ 5.99.
  3. Decide on a confidence level (typically 90% to 99%—we’ll use 90%, so z = 1.645), then plug all these values into the confidence interval formula, as follows: CI = x̄ ± z (s ÷ √n) = 80.5 ± 1.645 (5.99 / √10) = 80.5 ± 3.12
  4. In plain English, the answer could be stated as: “With 90% confidence, the interval is between 77.4 and 83.6.”

Confidence interval formula—example #2

  1. Input the ages 20, 25, 30, 35, and 40 into your data set. This results in a mean of 30.
  2. Calculate the sample standard deviation as described above: [(20 − 30)² + (25 − 30)² + (30 − 30)² + (35 − 30)² + (40 − 30)²] / (5 − 1) = 62.5, and √62.5 ≈ 7.906
  3. Choose your confidence level—we’ll select 95%, so z = 1.96—and run these figures through the formula: CI = x̄ ± z (s ÷ √n) = 30 ± 1.96 (7.906 / √5) = 30 ± 6.93
  4. “With 95% confidence, the interval is between 23.1 and 36.9.”

One technical note: with samples this small, statisticians would normally use a t-value instead of z, which produces a slightly wider interval. The z-version keeps the arithmetic simple, and the difference shrinks as your sample grows.

Should you be using a customer insights hub?

Do you want to discover previous research faster?

Do you share your research findings with others?

Do you analyze research data?

Start for free today, add your research, and get to key insights faster

Try Dovetail free

Related topics


[Customer research][Design thinking][Employee experience][Enterprise][Market research][Patient experience][Product development][Product management][Research methods][Surveys][User experience (UX)]

Editor's picks↘

What is inductive reasoning?11 June 2026
What are focus groups?19 January 2023

Latest articles↘

Turn customer feedback into product innovation

Contact salesTry Dovetail free

Platform

  • AI Analysis
  • AI Chat and search
  • AI Dashboardsbeta
  • AI Docsbeta
  • AI Agentsbeta
  • Deploy
  • Enterprise
  • Customers
  • Pricing

Use Cases

Log inTry Dovetail free
© 2026 Dovetail Research Pty. Ltd.
Legal & Privacy
FOLLOW US