LLM eval sample size calculator
For a pass rate near 80% and a margin of ±5 points at 95% confidence, you need about 246 examples: n = 1.96² × 0.8 × 0.2 / 0.05², rounded up. To compare two models, use the two-proportion formula below: telling 80% from 85% at a 5% significance level with 80% power takes about 906 examples per model.
Last updated
This free calculator answers three questions: how many examples one pass rate needs, what interval a result you already have gives, and how many examples it takes to tell two models apart. The math runs in your browser. The formulas, their assumptions and worked examples follow the calculator. For the background, read how many examples an LLM eval needs.
How many examples do I need?
Examples needed
Examples needed 246
n = z² × p × (1 − p) / E² = 1.960² × 0.800 × 0.200 / 0.050² = 245.85, rounded up to 246. z = 1.960 at 95% confidence.
Worst case, if you do not know the pass rate (50%): 385 examples.
Wilson check: if the pass rate comes out at 80.0% on 246 examples, the 95% Wilson interval is 0.746 to 0.845.
What interval does my result give?
Interval on the pass rate
Observed pass rate 0.750
95% Wilson interval 0.531 to 0.888
15 passes out of 20. Normal (Wald) interval for comparison: 0.560 to 0.940.
Detect a difference between two models
Examples per model
Examples per model 906
1,812 in total, to tell 80.0% from 85.0% at a 5% significance level with 80% power. This assumes two independent samples; on the same items, a paired test can need fewer.
With 500 examples per model, power is 54.8%: the chance this test detects a true difference of that size.
How it works
Each example is one independent item with a pass or a fail. The pass rate p is the share of items that pass. The margin E is half the width of the interval, so ±5 points is E = 0.05. The value z comes from the standard normal distribution: 1.645 for 90% confidence, 1.960 for 95% and 2.576 for 99%. For power, z is 0.842 at 80% and 1.282 at 90%. The calculator computes z with Acklam’s approximation to the inverse normal and one refinement step, not from a lookup table.
1. Examples for a margin on one pass rate
n = z² × p × (1 − p) / E², rounded up.
This is the normal-approximation sample size in the NIST/SEMATECH handbook (section 7.2.4.2). The product p × (1 − p) is largest at p = 0.5, so 50% is the worst case. When you have no estimate of the pass rate, plan with 50%; at ±5 points and 95% confidence that is 385 examples. A pass rate near 80% needs fewer, 246, because the spread is smaller. Halving the margin takes about four times the examples.
2. The interval on a result you have
With x passes out of n examples, the observed rate is p̂ = x / n. The Wilson interval is:
(p̂ + z²/(2n) ± z × √(p̂(1 − p̂)/n + z²/(4n²))) / (1 + z²/n)
The normal (Wald) interval, the one most often quoted, is:
p̂ ± z × √(p̂(1 − p̂)/n)
The handbook gives the Wilson formula in section 7.2.4.1, credits it to Wilson (1927), and notes that it is recommended for almost any sample size and proportion. Its lower limit cannot fall below 0 and its upper limit cannot pass 1. The Wald interval can do both, and it shrinks to zero width when every item passes or every item fails. The calculator clips the Wald interval to [0, 1] and warns when the set has fewer than 5 passes or 5 failures, the condition the handbook sets in section 7.2.4.
3. Examples per model to detect a difference
For a baseline pass rate p₁ and a new rate p₂, with p̄ = (p₁ + p₂) / 2, a two-sided significance level α and power 1 − β:
n = (z₁₋α/₂ × √(2p̄(1 − p̄)) + z₁₋β × √(p₁(1 − p₁) + p₂(1 − p₂)))² / (p₁ − p₂)² per model, rounded up.
This is the z-test for two independent proportions, with the pooled variance under the null hypothesis and the unpooled variance under the alternative. It matches the power function in statsmodels (power_proportions_2indep). The power check runs the formula the other way: for n examples per model, power is Φ((|p₁ − p₂| × √n − z₁₋α/₂ × √(2p̄(1 − p̄))) / √(p₁(1 − p₁) + p₂(1 − p₂))), where Φ is the standard normal distribution function.
Unpaired and paired. The formula assumes two independent samples: each model runs on its own random draw of items. Most teams run both models on the same items. Then a paired test such as McNemar’s test applies. It uses only the items where the two models disagree, and it can need fewer examples than the unpaired formula, depending on how often the models disagree. Miller (November 2024) makes the same point for paired differences on evals. To size a paired test, measure how often the two models disagree on a small pilot run.
Assumptions, and when they break
- Small sets. All three formulas rest on the normal approximation. Bowyer and co-authors (ICML 2025) show that intervals from the central limit theorem come out too narrow on sets of a few hundred items or fewer. On small sets, report the Wilson interval, and treat any sample size below about a hundred as a rough guide.
- Pass rates near 0% or 100%. The margin formula gives very small numbers there, and exactly 0 at 0% or 100%. A set with few failures says little about how often the model fails. Plan with a less extreme rate, or with 50%.
- Related items. Several questions about one document, or several turns of one conversation, behave like fewer independent items. Miller shows how to compute clustered standard errors for them. Count clusters, not rows, when you size the set.
- Judge noise. If an LLM judge records the pass or fail, its errors add to the sampling error and can shift the rate itself. Check the judge on human labels first: see how to check your LLM judge agrees with humans.
- Many outputs per prompt. Sampling several outputs for each prompt measures how stable the model is on that prompt. It does not add independent items. The sample size counts prompts.
- Drawn from the traffic you care about. The interval covers the population the items came from. A set built from old logs or a public benchmark says little about a new product feature.
Worked examples
How many examples for ±5 points. You expect a pass rate near 80% and want a 95% interval of about ±5 points. n = 1.960² × 0.8 × 0.2 / 0.05² = 245.85, so 246 examples. If the pass rate does come out at 80% on 246 examples, the Wilson interval is 0.746 to 0.845: about 5.4 points below and 4.5 above, because the Wilson interval leans toward 50%. With no idea of the pass rate, use 385. At 99% confidence the 80% case needs 425.
The interval on 15 of 20. A run of 20 examples passes 15, a rate of 0.750. The 95% Wilson interval is 0.531 to 0.888, so the true pass rate could sit anywhere from about half to almost nine in ten. The Wald interval is 0.560 to 0.940. Twenty examples cannot tell a 60% system from an 85% one.
Two models, 80% against 85%. A new model may lift the pass rate from 80% to 85%. To detect that gap at a 5% significance level with 80% power, each model needs 906 examples, 1,812 in total; for 90% power, 1,212 each. With 500 examples per model, power is 54.8%: a real five-point gain would show as significant only about half the time. A larger gap is cheaper to detect: 50% against 60% needs 388 per model.
What to do when you cannot afford n
- Report what you have. Run the set you can afford and publish the Wilson interval next to the pass rate. A wide interval on the page beats a point estimate that only looks precise.
- Stratify. Split the items by the slices that matter, such as task type, language or customer tier, and sample each slice on purpose. A small set with known coverage is easier to read than a large random one.
- Spend examples where the decision is. Collect more items only on the slices whose interval still straddles your pass bar. A slice that clears the bar on its whole interval needs no more.
- Pair the comparison. When you compare two models, run both on the same items and use a paired test, which can need fewer examples than the unpaired formula.
- Settle the margin first. Write down the smallest difference that would change your decision. A ±10 point margin needs about a quarter of the examples a ±5 point margin needs.
Questions
How many examples do I need for an LLM eval?
It depends on the margin you can accept and the pass rate you expect. For a pass rate near 80%, 246 independent examples give a 95% interval of about ±5 points. With no idea of the pass rate, 385 examples cover the worst case, a pass rate of 50%. The formula is n = z² × p × (1 − p) / E², rounded up.
What sample size do I need for a confidence interval on eval accuracy?
Pick the half-width E of the interval and the confidence level, then compute n = z² × p × (1 − p) / E², where z is 1.645, 1.960 or 2.576 for 90%, 95% or 99% confidence. At 95% and ±3 points, a pass rate near 80% needs 683 examples and a pass rate near 50% needs 1,068.
How do I compare two models on the same eval?
Run both models on the same items and record a pass or a fail for each model on each item. The two-proportion formula on this page gives the examples per model for two independent samples: telling 80% from 85% at a 5% significance level with 80% power takes 906 per model. When both models run on the same items, a paired test such as McNemar’s test uses the items where the two models disagree, and can need fewer examples, depending on how often they disagree.
Is the Wilson interval better than the normal interval?
For small sets and for pass rates near 0% or 100%, yes. The normal (Wald) interval can run past 0 or 1, and it shrinks to zero width when every item passes or every item fails. The Wilson interval stays between 0 and 1, and the NIST/SEMATECH handbook notes that it is recommended for almost any sample size and pass rate. For 15 passes out of 20, the 95% Wilson interval is 0.531 to 0.888.
Do I need more examples if I use an LLM judge?
Often, yes. These formulas assume each pass or fail is recorded without error. A judge that disagrees with people adds noise and can shift the pass rate itself, and more examples only narrow the interval around the judge’s rate, not around the true one. Check the judge against human labels first: see how to check your LLM judge agrees with humans.
Does running each prompt several times add examples?
No. Several outputs for one prompt share that prompt, so they are not independent items. Repeated runs show how stable the model is on each prompt. For the sample size, count prompts, and count related prompts, such as several questions about one document, as fewer than their number.
Sources
Checked
- NIST/SEMATECH e-Handbook of Statistical Methods, section 7.2.4.1, Confidence intervals. National Institute of Standards and Technology. Gives the Wilson interval for a proportion, credits Wilson (1927) and the recommendations of Brown, Cai and DasGupta (2001) and Agresti and Coull (1998), and notes that its lower limit cannot be negative. Accessed 17 November 2026.
- NIST/SEMATECH e-Handbook of Statistical Methods, section 7.2.4.2, Sample sizes required. National Institute of Standards and Technology. Derives the sample size for a proportion from the normal approximation and notes that a proportion of 0.5 gives the largest sample size. Accessed 17 November 2026.
- NIST/SEMATECH e-Handbook of Statistical Methods, section 7.2.4, Does the proportion of defectives meet requirements? National Institute of Standards and Technology. Sets the condition that the expected count on each side, N p and N (1 − p), be at least 5 before the normal approximation is used. Accessed 17 November 2026.
- NIST/SEMATECH e-Handbook of Statistical Methods, section 7.3.3, How can we determine whether two processes produce the same proportion of defectives? National Institute of Standards and Technology. Gives the z-test for two proportions with the pooled proportion, and Fisher’s exact test for small samples. Accessed 17 November 2026.
- proportion_confint, statsmodels 0.15.0 documentation. Computes the Wilson, normal and other intervals for a binomial proportion. Accessed 17 November 2026.
- power_proportions_2indep, statsmodels 0.15.0 documentation. Power of the z-test that two independent proportions are equal, with the pooled variance under the null and the unpooled variance under the alternative. Accessed 17 November 2026.
- mcnemar, statsmodels 0.15.0 documentation. McNemar’s test on a 2×2 table of paired outcomes; the exact version counts the items where the two outcomes differ. Accessed 17 November 2026.
- Adding Error Bars to Evals, Evan Miller. arXiv:2411.00640 (November 2024). Treats eval questions as a sample, with clustered standard errors for related questions and paired differences for comparing two models.
- Position: Don’t Use the CLT in LLM Evals With Fewer Than a Few Hundred Datapoints, Sam Bowyer, Laurence Aitchison and Desi R. Ivanova. ICML 2025. arXiv:2503.01747 (March 2025). Shows that intervals from the central limit theorem come out too narrow on small eval sets.
Where Slancha fits
Slancha builds models that predict where a model has gaps, so a team can run fewer, targeted evals instead of the whole set. Slancha sells those models, not eval software: keep your existing eval or observability platform.
Pilots by arrangement.
Related: estimate what a run costs, check a cheaper judge and the ways to make AI evals cheaper.
Related guides
- How to measure LLM output consistency when the same prompt gives different answers
- How to test a model upgrade before you switch
- How to reduce token spend in an AI agent pipeline
- How to build agent evals from production traces
- How much do LLM evals cost?
- How many examples does an LLM eval need?
- Can a cheaper LLM judge replace an expensive one?
- How to check your LLM judge agrees with humans
- How to write an LLM-as-judge rubric that catches real failures
- Eval cost guide
- Eval speed guide
- Eval cost calculator
- LLM eval glossary
- All guides