TOOL | Eval statistics
Wilson and Clopper-Pearson Pass-Rate Confidence Interval Calculator
Turn an eval pass rate (k of n) into a defensible confidence interval: Wilson score, Clopper-Pearson exact, and Wald normal bounds side by side.
A pass rate is a proportion; its run count sets the interval width. Our hub on which eval number needs which test says why.
It assumes independent items, so duplicate rows narrow it and one pooled rate hides uneven slices. More golden-set items narrow it honestly; the drop worth catching sizes the runs. Answer coverage shows what share returned a scoreable result. Compare: paired McNemar or a two-proportion test. This page bounds measured rates; the chain calculator composes assumed steps.
Showing your last valid result. Update the inputs above to recompute.
Wilson score interval
21.9% to 39.6%
95% two-sided. Observed rate 30.0% (30 of 100), interval width 17.7 pts.
All three methods, same inputs
| Method | Lower | Upper | Width |
|---|---|---|---|
| Wilson score | 21.9% | 39.6% | 17.7 pts |
| Clopper-Pearson (exact) | 21.2% | 40.0% | 18.8 pts |
| Wald (normal) | 21.0% | 39.0% | 18.0 pts |
The example has 12 failures in 400 runs against a 5% bar. These figures are the worked example.
Which method fits
For an estimate, report the Wilson score interval; Jeffreys beside it is a Bayesian alternative, and Wald is what a spreadsheet returns. Wilson stays inside 0% and 100%. Wilson score, 95%, two-sided, not paired.
Jeffreys interval (Bayesian alternative) 21.7% to 39.5%
This panel computes an interval and compares it with a bar. Sizing a new eval for a target change is on the sample-size page.
How often each method's range holds the true rate
| Method | Coverage at your observed rate | Lowest coverage across true rates |
|---|
Grouped or clustered runs
Wilson at effective n
Jeffreys at effective n
Showing your last valid result. Update the inputs above to recompute.
Envelope on Wilson bounds
--
Enter the counts and compute.
Answer coverage
Each convention, its assumption and its interval
| Convention | Assumes | Rate | Wilson | Clopper-Pearson |
|---|
Unscored runs by class
| Unscored class | Runs |
|---|
The page's own example: 200 of 200 clean runs at a 99% floor with 1% as the failure rate worth catching.
ISTQB CT-AI syllabus section 6.1.3, version 2.0: 601 test cases, at least 589 to pass, 98% plus or minus 4% at 95% two-sided. The authors and the ISTQB acknowledged as the source and copyright owners.
Showing your last valid result. Update the inputs above to recompute.
Floor these runs demonstrate
--
Fill both observed-run fields to read this.
Clean runs needed
--
Enter a floor and compute.
Wilson one-sided floor (alternative)
Risks and what runs prove
One rule passes systems at or just below the bar while the other fails them there. Making both risks small takes more runs, which the golden-set planner's Check a claim panel sizes.
Making the observed-rate risk small takes more runs, which the golden-set planner's Check a claim panel sizes.
How often each rule passes a system at each true pass rate (exact binomial)
| True pass rate | Passes on the observed rate | Passes on the one-sided floor |
|---|
Rows whose true pass rate would be at or below 0% are left out.
Chance at least one failure shows, by failure rate (exact binomial)
| Failure rate | Chance at least one failure shows | Clean runs to likely see one |
|---|
The result bounds the failure rate on runs like these only and says nothing about cases the suite does not cover. Runs that share a prompt family or source count as fewer independent runs, which the Interval panel's "Grouped or clustered runs" fold explains.
Runs needed at each failure budget
| Failures budgeted | Runs needed | Floor demonstrated |
|---|
Assumes independent runs at one fixed reliability, the same binomial model this page uses for every interval.
This panel sizes clean runs for a floor and reads runs you already have. The acceptance criteria builder sets the bar. The golden-set planner sizes a set from a margin. A plan for a hand-checked batch is the Batch audit plan on this page.
You need to sign off a batch before a release; type the batch size and both failure rates, the one you would ship and the one you must not.
Size a plan for one batch of outputs checked by hand before a release. A test suite's pass rate belongs in the Interval and Runs for a claim panels.
The figures are the returns-desk example: batch of 2,400 checked by prompt template, 10 outputs from each, similarity 0.2. The templates are the families here.
Showing your last valid result. Update the inputs above to recompute.
The plan
--
Enter the two failure rates and the batch size.
The two risks hold only for a plan fixed before the count was made. A plan changed after counting carries no stated risk.
Chance the plan accepts at each failure rate
| True failure rate | Chance plan accepts |
|---|
Outputs drawn at random across the batch in an order fixed before checking. Each failure judged correctly by the checker. Where the plan meets its condition on each side, the binomial risk is at or above the exact figure for this batch. A zero-acceptance plan prints the producer's risk as the exact figure.
The plan was fixed before the count. The verdict is about this batch.
This mode sizes and reads one pre-release batch check. The acceptance criteria builder sets the bar and the review sample drawer draws the sample. What a clean sample proves is in Runs for a claim.
Wilson: (p̂ + z²/2n ± z·√(p̂(1−p̂)/n + z²/4n²)) / (1 + z²/n)How?
How this is calculated
This tool reports a Wilson score interval by default: the range that brackets the true pass rate p behind an observed c passes in n independent runs, at the confidence level you pick. It also shows the Clopper-Pearson exact interval and the Wald normal approximation on the same inputs, so you can see where they agree and where they part.
Every method assumes each run is an independent Bernoulli trial at one fixed pass probability. That is the binomial model behind an eval confidence interval. The point estimate c/n is one draw from that distribution; the interval is the width around it that the evidence supports.
Wilson score interval (the default). With z the two-sided normal quantile for your confidence level, the interval centers and margins are:
center = (p̂ + z²/2n) / (1 + z²/n)
margin = (z / (1 + z²/n)) · √(p̂(1−p̂)/n + z²/4n²)
Worked example, c = 30, n = 100, 95% (z ≈ 1.9600, p̂ = 0.30, z² = 3.8415): center = (0.30 + 3.8415/200) / (1 + 3.8415/100) = 0.31921 / 1.03841 = 0.3074; margin = (1.9600 / 1.03841) · √(0.30·0.70/100 + 3.8415/40000) = 1.8875 · √0.0021960 = 1.8875 · 0.046862 = 0.0884. The interval is 0.3074 ± 0.0884, or 21.9% to 39.6%. Wilson stays inside 0% and 100% and returns a real width even at a 0% or 100% observed rate, which is why it is the default here.
Clopper-Pearson exact interval. The bounds are Beta quantiles, so the interval has at least the nominal coverage (it errs wide rather than narrow):
lower = BetaInv(α/2; c, n−c+1), upper = BetaInv(1−α/2; c+1, n−c), α = 1 − confidence
For the same c = 30, n = 100, 95% case: lower = BetaInv(0.025; 30, 71) = 0.2124, upper = BetaInv(0.975; 31, 70) = 0.3998, or 21.2% to 40.0%. Report this when you need a guaranteed-coverage bound and can accept a wider interval.
Wald normal approximation. The textbook bound is
p̂ ± z·√(p̂(1−p̂)/n), which for c = 30, n = 100, 95% gives
0.30 ± 0.0898, or 21.0% to 39.0%. It is shown for contrast and carries a guard.
The Wald interval collapses to a single point at a 0% or 100% observed rate, and
it can fall outside 0% to 100%. This tool flags it as unreliable when either the
observed passes or the observed failures fall below 10, the success-failure count
condition. That floor of 10 is a common convention; Brown, Cai and DasGupta (2001)
show Wald coverage stays erratic even at large n for rates near 0 or 1, so treat
the floor as a minimum rather than a guarantee.
The Jeffreys interval uses a Beta(c + 1/2, n - c + 1/2) posterior with the Jeffreys prior. Its bounds are the alpha/2 and 1 - alpha/2 quantiles of that distribution. At c = 0 the lower bound is set to 0 and at c = n the upper bound is set to 1, following the modification in Brown, Cai and DasGupta (2001). Both Wilson and Jeffreys are reasonable choices for an estimate, and at moderate sample sizes they return similar intervals. On the example's 12 failures in 400, the Jeffreys failure rate interval is 1.65% to 5.02%.
For an estimate, Wilson is the default, and Jeffreys is printed beside it at every sample size as an equally defensible alternative. For a bound claim, the page recommends Clopper-Pearson one-sided, whose coverage holds at every true rate, and names Wilson one-sided as the narrower alternative. A bound claim routes to the Runs for a claim panel, which prints the one-sided readout.
Coverage at a given true rate p is the probability that the method's interval contains p. For each method and for p on a grid from 0.005 to 0.995 in steps of 0.005, the page sums 1[L(c) <= p <= U(c)] Bin(c; n, p) over c = 0 to n. Coverage above 5,000 runs is not drawn because all four methods converge on that grid. At 100 runs and 95%, the lowest coverage on the grid is 91.0% for Wilson, 95.4% for Clopper-Pearson, 88.1% for Jeffreys and 39.4% for Wald.
Grouped or clustered runs inflate the variance of the point estimate (Miller, 2024). With m runs per group and within-group correlation rho, the design effect is 1 + (m - 1) rho, and the effective number of runs is n divided by that factor. The page computes the interval at the effective count. On the example with groups of 5 and rho 0.15, the design effect is 1.6 and the effective count is 250 runs. When the effective-n adjustment reverses a bound claim that held under independence, the page says so and shows both floors.
The relation between the two panels: a two-sided interval answers "where does the rate plausibly sit?" and a one-sided bound answers "can I defend a floor of at least 95%?" The two-sided upper edge sits farther from the observed rate than the one-sided bound at the same nominal level, so a bar that sits inside the two-sided interval can still clear the one-sided bound. That is why the page routes a bound claim to the Runs for a claim panel.
What the confidence level means, and what it assumes. A 95% two-sided interval is a frequentist statement about the procedure: across many repeated suites, about 95% of the intervals it builds would contain the true rate. It is not a 95% probability that this one interval holds the true rate. The binomial model also assumes runs are independent and identically distributed. Correlated seeds, a shared prompt, or a heterogeneous task mix break that assumption, and the real uncertainty is then wider than any bound here. Add the run-to-run spread from independent seeds on top of the task-set width this tool computes.
Runs that never got a score. A harness that drops a timed-out, refused or unparseable run before computing the rate answers a narrower question than the report implies. The unscored-runs panel prints answer coverage beside every rate, both counts showing, so the reader can see how much of the sample the rate rests on. With U the runs that came back without a score, S = c + f the answers returned and N = S + U the requests sent, the same counts support three readings:
scored only = c / S
all attempted = c / N (U counted as failures)
bound pair = [c / N, (c + U) / N] (the upper edge counts U as passes)
Each reading carries the same Wilson and Clopper-Pearson bounds as the default panel, and the envelope is the Wilson pair: the lower bound of the all-attempted reading to the upper bound of the upper edge. At S = 0 the scored-only rate is suppressed rather than published as 0%, because an empty denominator carries no rate, which is the cost of conditioning on the answered subset. Runs the model declined are one of the four classes counted here, beside timeouts, early stops and unparseable output. Counting unparseable runs here tells you how much of the sample they consumed. Measuring and pricing the structured-output failure rate is a different job.
How many clean runs a floor needs. The runs-for-a-claim panel
solves the same exact bound for the run count. With C the ONE-SIDED
confidence and alpha = 1 - C, the lower bound is:
R_L(0, n, C) = 0; R_L(k, n, C) = BetaInv(alpha; k, n-k+1); R_L(n, n, C) = alpha^(1/n)
zero-failure count: n = ceil( ln(1 - C) / ln(R) )
With failures budgeted there is no closed form, so the count is searched by doubling and bisection on the same bound, which rises with n at a fixed failure count. A 95% one-sided floor is the lower edge of a 90% two-sided interval, so the two directions on this page are not interchangeable: 299 clean runs demonstrate a 99% floor at 95% one-sided confidence, where reading the same level two-sided asks for 367. That is why the claim panel labels its confidence one-sided, and why it prints the two-sided Clopper-Pearson lower bound on the same data beside its own.
What a clean result proves. The highest failure rate n clean runs still allow is one minus the one-sided Clopper-Pearson floor: 1 minus the nth root of the significance level. The chance n runs at rate q show at least one failure is 1 minus (1 minus q) to the n. Clean runs for a C chance to see one: ceiling of ln(1 minus C) divided by ln(1 minus q). On the 200-of-200 example, 200 clean runs at 95% one-sided still allow up to 1.4867%. At 1% they show a failure 86.6% of the time. A 95% chance takes 299 runs. The rule of three approximates it as 3 divided by n: 1.5% at 200, against 1.4867%.
Both risks of a pass rule. A rule "at most c failures in n runs" passes a system at true failure rate q with the sum, j from 0 to c, of the binomial probability at j, computed through the regularized incomplete beta. The point-estimate rule takes c as n minus the ceiling of R times n. The one-sided floor rule takes the largest c whose one-sided Clopper-Pearson floor still reaches R, so it passes a system at exactly R with chance at most one minus the confidence level. The table shows exact binomial chances at true failure rates of 1.5, 1.25, 1, 0.75, 0.5 and 0.25 times the target's complement. On the 589-of-601 example at 98%: the point-estimate rule (at least 589 of 601) passes a true-98% system 57.4% of the time, the one-sided floor rule (at most 6 failures) 4.4%. In acceptance sampling these are called operating characteristics.
A plan checks n outputs and accepts the batch if at most c fail. The chance of acceptance at a true failure rate p is the sum, from j equals 0 to c, of the binomial probability at j. This is the method of NIST/SEMATECH e-Handbook section 6.2, applied to a batch of model outputs.
The smallest plan is the one with the fewest checks whose two risks both stay at or under the maxima you set. The page prints a line whenever a risk lands above its maximum. Under a random draw, where the plan meets its condition (allowed failures at or above the expected count at the good rate, at or below it at the bad rate), the binomial risk is at or above the exact figure for this batch. A zero-acceptance plan prints the producer's risk as the exact figure.
A random draw across the batch gives the binomial formula above: prompt families do not matter because each output is drawn independently of its family. Under a family draw, the number of failures from each drawn family follows a beta-binomial distribution with the similarity entered (m outputs checked per family), and the total is the sum over the families drawn. Applying the lot method to a batch of model outputs and pairing it with a family-draw model is our synthesis. The figures hold under that model at the similarity entered.
On the returns-desk example, a random draw across the batch needs 65 checks with at most 2 failures. Checking ten outputs per template at similarity 0.2 needs 171 checks with at most 6 failures. The same 65-check plan, if checked by template, passes an 8% batch about a quarter of the time. With similarity unknown, the plan is sized as if each drawn family fails or passes whole: 641 checks with at most 20 failures, and the printed risks are their largest values over the similarity.
ISO 2859-1 and ANSI/ASQ Z1.4 index plans by the good-batch failure rate (AQL) for a stream of lots with switching rules. This mode sizes one batch from two stated rates.
The verdict is the rule the plan set before checking. The two risks hold only for a plan fixed before the count was made. The early reject holds when the checking order was fixed before checking began: once more than c outputs have failed, the outputs left cannot change the outcome.
Formula: Wilson: (p̂ + z²/2n ± z·√(p̂(1−p̂)/n + z²/4n²)) / (1 + z²/n)
Questions
Which interval should I report?
Report the Wilson score interval as the default. It behaves well at small run counts and at rates near 0% or 100%, the regime where eval pass rates often sit. Use the Clopper-Pearson exact interval when you need coverage that is guaranteed to meet the nominal level and can accept a wider bound. Read the Wald column as a teaching contrast at large n away from the edges, and heed the guard when it appears.
What does 95% confidence actually mean?
It describes the procedure, not this single interval. If you re-ran the whole evaluation many times and built a 95% interval each time, about 95% of those intervals would contain the true pass rate. The one interval in front of you either contains it or does not. Reporting the interval next to the rate keeps a headline number honest about how much evidence stands behind it.
When is the Wald (normal) interval safe to use?
Only when both the observed passes and the observed failures clear a count of about 10, and the rate sits away from 0% and 100%. At a 0% or 100% observed rate the Wald interval collapses to zero width and reports no uncertainty exactly where the rate is most extreme, so this tool steers you to Wilson or Clopper-Pearson there.
My bar is 5% failures and the two-sided edge says 5.2%. Do I need a one-sided test?
The two-sided edge is the upper bound of a 95% two-sided interval, and a one-sided bound at the same data and level is narrower because the one-sided test spends the whole error allowance on one side. A failure rate that misses the two-sided bar can still clear the one-sided bound. Use the "Bound the rate against a bar" setting and check the one-sided floor in Runs for a claim. On the example's 12 failures in 400, the two-sided Wilson upper edge on the failure rate is 5.17%, which misses 5%, while the one-sided Wilson bound at the same 95% is 4.75%, which clears it; the recommended one-sided Clopper-Pearson bound is 4.82%.
What is the Jeffreys interval, and when should I use it?
The Jeffreys interval is a Bayesian range: it starts from a standard default prior for a proportion and reads the interval off the result. On the example's 12 failures in 400 it gives 1.65% to 5.02% for the failure rate, a little narrower than Wilson (1.72% to 5.17%) and Clopper-Pearson (1.56% to 5.18%). Use it for an estimate, as an alternative to Wilson; at moderate sample sizes the two closely agree. For a bound against a bar, use Clopper-Pearson one-sided in Runs for a claim. At zero or full passes it keeps a real width, following Brown, Cai and DasGupta (2001), where the Wald interval collapses to a single point.
Our exit criterion says 98% plus or minus 4% at 95%, and 589 of 601 test cases passed. Does that prove 98%?
The figures are the worked example in section 6.1.3 of the ISTQB Certified Tester AI Testing syllabus, version 2.0 (the authors and the ISTQB acknowledged as the source and copyright owners). The syllabus's 95% is a two-sided margin level. This page reads the result at 95% one-sided. The margin sizes the count: the golden-set planner sizes a set from a margin. 589 of 601 proves a floor of 96.7850% at 95% one-sided, clearing 94% and missing 98%. The rule "at least 589 of 601" passes a system at exactly 98% 57.4% of the time and at 97.5% only 26.2%. A rule on the one-sided floor (at most 6 failures, requiring 595 of 601) passes a 98% system 4.4% and a 99% system 60.5% of the time. Naming both risks shows where each rule puts the risk. Press "Load the CT-AI criterion" in Runs for a claim to see the table.
We checked 200 outputs and none failed. Are we good?
Two hundred clean runs bound the failure rate below 1.4867% at 95% one-sided confidence (Clopper-Pearson), so a 1% true failure rate is still possible. At 1%, a sample of 200 comes back clean 13.4% of the time. At 0.5%, it comes back clean 36.7% of the time. A 99% floor at 95% one-sided confidence takes 299 clean runs. The "Failure rate worth catching" field takes the rate you care about, and on an all-clean result it adds that rate's row to the detection table. The bound covers runs like these only and says nothing about cases the suite does not cover. Runs that share a prompt family count as fewer independent runs, which the Interval panel's "Grouped or clustered runs" fold explains.
Which batch is this for?
This mode sizes one pre-release batch of outputs. A test suite's pass rate belongs in the Interval and Runs for a claim panels. A standing production review belongs in a monitoring plan.
What do prompt families do to the plan?
They do nothing when outputs are drawn at random across the batch. They add to the plan when outputs are checked several to a family: on the returns-desk example, 171 checks with at most 6 failures against 65 with at most 2 for a random draw. With similarity unknown, checking by family needs 641 checks with at most 20 failures. The random draw keeps the plan small.
Sources
- Probable Inference, the Law of Succession, and Statistical Inference (Wilson score interval)
- The Use of Confidence or Fiducial Limits Illustrated in the Case of the Binomial (Clopper-Pearson interval)
- Interval Estimation for a Binomial Proportion (Wilson vs Wald coverage)
- NIST/SEMATECH e-Handbook of Statistical Methods: Confidence Limits for a Proportion
- Miller (2024), Adding Error Bars to Evals: A Statistical Approach to Language Model Evaluations, section 2.2
- NIST/SEMATECH e-Handbook: Test Product for Acceptability: Lot Acceptance Sampling