TapCub is live — analytics, insights and live chat, free on one platform

Free tool Confidence interval calculator and formula

A rate or an average from a sample is an estimate. The confidence interval shows how far off it could reasonably be. Enter successes and sample size for a rate, or the mean, standard deviation and sample size for an average.

  • Proportions: Wilson interval
  • Means: Student t interval
  • Runs locally
Calculator

Choose what you are measuring

A proportion is a share: converted visitors, yes answers. A mean is an average of a quantity: order value, minutes on page.

Proportion for a rate or share; mean for an average.

Conversions, yes answers or any count of hits in the sample. Cannot exceed the sample size.

Visitors, respondents or orders in the sample. A mean needs at least 2.

95% is the usual choice. 99% gives a wider interval, 90% a narrower one.

Observed rate

21.17%

Successes ÷ sample size.

Lower bound19.58%
Upper bound22.85%
Margin of error (±)Half the interval width. Wilson intervals lean toward 50%, so the bounds are not exactly the rate ± this.1.63%
Wilson score interval: it stays within 0–100% and holds up with small samples and rates near the edges.
Runs entirely in your browser. Nothing you type here is uploaded or stored by TapCub.

Share these inputs: the values go after the # in the link, so they never reach a server.

Version v1.0Updated Update history

Read the result

What the interval says

The point estimate is a single guess. The interval is the honest version: every value inside it is reasonably consistent with your data.

Observed rate or mean

What the sample shows. 508 conversions from 2,400 visitors is 21.17%. On its own it hides how many people it is based on.

Lower and upper bound

The plausible range for the true value: 19.58% to 22.85% in the example. If a target or a competitor’s figure sits inside the range, your data cannot tell them apart.

Margin of error

Half the width of the interval, ±1.63 percentage points here. This is the "±3 points" figure surveys quote. It shrinks with the square root of the sample: four times the sample, half the margin.

Confidence level

How often the method captures the true value over many samples. 99% intervals are wider than 95%, which are wider than 90%: 19.10%–23.39% against 19.83%–22.57% for the same data.

The interval only covers sampling error. It says nothing about bots in the data, a tracking gap or a badly defined conversion; those shift the whole interval.

How to use it

Three choices, then read the range

The same calculator handles a rate and an average. Pick the mode first; the fields change with it.

  1. 1

    Pick the mode

    Proportion for anything counted as yes or no per person: converted, clicked, answered yes. Mean for a measured amount: revenue per order, session length.

  2. 2

    Enter the sample

    For a proportion, successes and sample size. For a mean, the mean, the standard deviation and the sample size, all from the same data.

  3. 3

    Choose the level

    95% unless you have a reason. Report the interval with the level, for example "21.2% (95% CI 19.6%–22.8%)".

Formula

Wilson for proportions, t for means

The familiar "rate ± 1.96 × standard error" (the Wald interval) breaks down for small samples and for rates near 0% or 100%: it can go below zero, above 100%, or shrink to nothing. The Wilson interval fixes this at no extra cost, so the calculator uses it for proportions. For means it uses the Student t distribution.

  • z is 1.645 at 90%, 1.960 at 95% and 2.576 at 99%
  • Wilson centres the interval slightly toward 50%, so it is not symmetric around the observed rate
  • For large samples away from the edges, Wilson and Wald agree closely
  • The t interval uses n − 1 degrees of freedom and the sample standard deviation

Wilson interval (proportion)

( p̂ + z²/2n ± z × √( p̂(1 − p̂)/n + z²/4n² ) ) ÷ (1 + z²/n), p̂ = successes ÷ n

508 of 2,400 at 95%: p̂ = 21.17% → 19.58% to 22.85%

Wald interval, for comparison

p̂ ± z × √( p̂(1 − p̂) ÷ n )

Same data: 19.53% to 22.80%. At 1 of 50: −1.88% to 5.88%

t interval (mean)

x̄ ± t(n − 1) × s ÷ √n

Order value $74, s = $38, n = 120: $74 ± 1.980 × $38 ÷ √120 = $74 ± $6.87 → $67.13 to $80.87

Worked example

Wilson against the simple Wald interval

Five samples, both methods at 95%. With plenty of data they agree; with small samples or rates near the edges, Wald produces ranges that cannot be right.

Example 95% intervals for a proportion
SampleObserved rateWilson (this tool)WaldProblem with Wald
508 of 2,40021.17%19.58% – 22.85%19.53% – 22.80%None worth noting
12 of 4030.00%18.07% – 45.43%15.80% – 44.20%Ignores the skew of a small sample
1 of 502.00%0.35% – 10.50%−1.88% – 5.88%Lower bound below zero
0 of 500.00%0.00% – 7.13%0.00% – 0.00%Zero width: claims certainty
48 of 5096.00%86.54% – 98.90%90.57% – 101.43%Upper bound above 100%

The conversion rate calculator shows the simpler Wald interval, which is why its range for 508 of 2,400 (19.5%–22.8%) differs slightly from this one. Sample figures.

Common mistakes

How intervals get misused

The formula is standard. The inputs and the reading are where it goes wrong.

"95% chance the true value is inside"

The 95% describes the method across many samples. Any single interval either contains the true value or does not.

Page views as the sample

One person reloading five times is not five observations. Count people or sessions, whichever the rate is defined on.

Standard error in the SD box

The calculator divides by √n itself. Entering the standard error instead of the standard deviation gives an interval far too narrow.

Overlap as a significance test

Two intervals can overlap slightly and the difference can still be significant. Compare groups with a proper test.

FAQ

Confidence interval questions

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

What is the confidence interval formula?

Estimate ± critical value × standard error. For a mean: x̄ ± t × s ÷ √n, with t from the t distribution at n − 1 degrees of freedom. For a proportion, the textbook (Wald) formula is p̂ ± z × √(p̂(1 − p̂) ÷ n), with z = 1.645, 1.960 or 2.576 at 90%, 95% or 99%; this calculator uses the more accurate Wilson interval (see the next answers). The result is a range that, with a 95% method, contains the true value in 95% of samples.

How do I calculate a confidence interval for a proportion?

Divide successes by the sample size for the observed rate, then apply an interval formula. The Wilson interval used here is ( p̂ + z²/2n ± z√(p̂(1 − p̂)/n + z²/4n²) ) ÷ (1 + z²/n). For 508 of 2,400 at 95%, that is 19.58% to 22.85%.

How do I calculate a confidence interval for a mean?

Mean ± t × standard deviation ÷ √n, where t comes from the Student t distribution with n − 1 degrees of freedom. For an average order value of $74 with a standard deviation of $38 from 120 orders, the 95% interval is $67.13 to $80.87.

Why does the calculator use the Wilson interval?

The textbook Wald interval, rate ± z × standard error, can produce impossible ranges: below 0% or above 100%, or zero width when there are no successes. Wilson stays within 0–100% and keeps close to the stated confidence level with small samples. For large samples the two are almost identical.

What is the difference between margin of error and confidence interval?

The margin of error is half the width of the interval. A survey reporting "52% ± 3 points" is giving the interval 49% to 55%. For a Wilson interval the bounds are not exactly symmetric around the rate, but the margin is still half the width.

How can I make the interval narrower?

Collect more data, or accept a lower confidence level. Width shrinks with the square root of the sample: 30% from 150 visitors has a margin of ±7.26 points; from 600 visitors, ±3.66.

If two confidence intervals overlap, is there no significant difference?

Not necessarily. Two 95% intervals can overlap a little while the difference between them is still significant. To compare two rates, use a two-proportion test such as the one in the conversion rate calculator.

How do I calculate a confidence interval in Excel or Google Sheets?

For a mean, CONFIDENCE.T(0.05, sd, n) returns the 95% margin (t-based); the interval is mean ± that margin. CONFIDENCE.T(0.05, 38, 120) = 6.87, so $74 ± $6.87. CONFIDENCE.NORM uses z instead of t and is slightly narrower for small samples. There is no built-in function for the Wilson interval of a proportion; the Wald margin is NORM.S.INV(0.975)*SQRT(p*(1-p)/n).

Changelog

Update history

New features, fixes and data refreshes for this tool, newest first.

  1. · v1.0

    LaunchedFirst release.

Missing something or found an error? Tell us — requests that come up often go into the next update. All tool updates

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics