Skip to main content
v2026.11,986 entries · CC-BY 4.0

Tolerance Interval: Formula, Worked Example and R/Python Code

What a tolerance interval is, the normal-theory formula for k, a worked 95%/95% example, and Excel, R and Python code.

Written and maintained by CASRAI Editorial Board

Published

On this page

A tolerance interval is a range, calculated from a sample, that is expected to contain at least a stated proportion of all values in the population, with a stated level of confidence that the range really does so. A “95%/95%” tolerance interval, for instance, is built so that in 95% of repeated samples the interval covers at least 95% of the population. It differs from a confidence interval, which covers a parameter such as the mean, and from a prediction interval, which covers a single future observation.

This guide gives the normal-theory formula with every symbol explained, a worked example with the arithmetic shown, a table for reading the result, the assumptions that most often fail, a reporting template, and code for Excel, R and Python.

What is a tolerance interval?

The NIST/SEMATECH e-Handbook of Statistical Methods defines the idea by contrast: “a confidence interval covers a population parameter with a stated confidence,” while statistical tolerance limits “are limits within which we expect a stated proportion of the population to lie.” The two end points of a tolerance interval are called tolerance limits, and the proportion p to be covered is often called the coverage factor (NIST e-Handbook 7.2.6.3). Derek Young’s article on the R tolerance package uses the same two-number description: the quantity P is the content of the interval, and the confidence level 1 − α reflects sampling variability.

Two numbers therefore define every tolerance interval, and both must be stated whenever one is reported:

  • Coverage (P or p): the minimum proportion of the population the interval should contain, for example 0.90 or 0.95.
  • Confidence (1 − α): how often, over repeated samples, an interval built this way achieves that coverage, for example 0.95 or 0.99. Minitab’s help page notes that both are traditionally set close to 100% and that its defaults are 95% for each.

NIST also separates the statistical term from the engineering one: “Engineering tolerances are specified outer limits of acceptability.” A drawing that says a shaft must measure 25.00 mm ± 0.05 mm is an engineering tolerance. A statistical tolerance interval is computed from data to describe where a stated share of production or measurements actually falls, and the two are often compared against each other in process and method assessment.

Tolerance interval vs confidence interval vs prediction interval

The three intervals answer different questions from the same sample. The table uses the hypothetical data from the worked example below (n = 20, mean 50.0, standard deviation 2.4), so the widths can be compared directly. Definitions of the confidence and prediction intervals follow the Minitab help page; the arithmetic is the standard textbook t-based formula, computed for this guide.

Interval What it covers Example result (n = 20, mean 50.0, s = 2.4)
95% confidence interval for the mean The unknown population mean 48.88 to 51.12
95% prediction interval Where one new observation is likely to fall 44.85 to 55.15
95%/95% two-sided tolerance interval At least 95% of all population values, with 95% confidence 43.39 to 56.61
Mean ± 1.96 s (no tolerance factor) Nothing guaranteed: treats the sample estimates as if they were the true mean and standard deviation 45.30 to 54.70

The confidence interval is narrowest because it describes only the mean. The tolerance interval is widest because it has to allow for uncertainty in both the estimated mean and the estimated standard deviation while still capturing most of the population. The last row is the common shortcut; it is too narrow for a small sample, which is exactly what the tolerance factor k corrects. For the confidence-interval side of the comparison, see the CASRAI guides on the 95 percent confidence interval and on how hypothesis tests and confidence intervals connect, and the dictionary entry for confidence interval.

Tolerance interval formula for normally distributed data

For data from a normal population, a two-sided tolerance interval has the same shape as “mean plus or minus a multiple of the standard deviation,” where the multiple is a tolerance factor that depends on the sample size, the coverage and the confidence:

Lower limit = x̄ − k2 s    Upper limit = x̄ + k2 s

NIST gives Howe’s approximation for the two-sided factor:

k2 = z(1+p)/2 × √[ ν (1 + 1/N) / χ21−α, ν ]

Symbol Meaning
x̄ Sample mean
s Sample standard deviation (divisor N − 1)
N Number of observations in the sample
p Coverage: the proportion of the population the interval should contain
α One minus the confidence level, so confidence = 1 − α
ν Degrees of freedom, N − 1
z(1+p)/2 Standard normal quantile that leaves (1 − p)/2 in each tail; for p = 0.95 it is 1.960
χ21−α, ν Chi-square critical value on ν degrees of freedom. NIST’s own example confirms the convention: for 99% confidence it uses the value with 1% in the lower tail, χ2 = 23.650 for ν = 42. In software this is the lower-tail quantile at probability α.

NIST adds that this formula applies “if the data are from a normally distributed population,” and offers Guenther’s correction factor w, which for reasonably large N is close to 1 (NIST gives 0.9972 for N = 40 and 95% confidence). Because k2 contains χ2 in the denominator, it grows quickly as N shrinks or as the confidence rises: a small sample needs a much wider interval to make the same promise.

One-sided tolerance limits

When only an upper or only a lower limit matters, such as a maximum impurity level, a one-sided factor k1 is used instead. NIST presents two ways to compute it, the Natrella formulas and the non-central t method, and for its example of N = 43, p = 0.90 and 99% confidence the two give 1.8752 and 1.8740. NIST’s comment is that “unless you have small samples (say N ≤ 10), the difference in the methods should not have much practical effect.” The R tolerance package computes the one-sided factor exactly for every method option.

Worked example: a 95%/95% two-sided tolerance interval

Illustrative example with invented numbers, not a real data set. Suppose a laboratory measures an analyte in N = 20 independent samples and obtains a mean x̄ = 50.0 mg/L and a standard deviation s = 2.4 mg/L. The goal is an interval expected to contain at least 95% of future results, with 95% confidence.

  1. Set the inputs. p = 0.95, confidence = 0.95 so α = 0.05, and ν = N − 1 = 19.
  2. Normal quantile. z(1+0.95)/2 = z0.975 = 1.960.
  3. Chi-square value. The lower-tail 5% point of χ2 with 19 degrees of freedom is 10.117.
  4. Numerator inside the root. ν(1 + 1/N) = 19 × (1 + 1/20) = 19 × 1.05 = 19.95.
  5. The ratio and its root. 19.95 / 10.117 = 1.9719, and √1.9719 = 1.4043.
  6. Tolerance factor. k2 = 1.960 × 1.4043 = 2.752.
  7. Half-width. k2 s = 2.752 × 2.4 = 6.605.
  8. Limits. 50.0 − 6.605 = 43.39 and 50.0 + 6.605 = 56.61 mg/L.

The interpretation is that, if this procedure were repeated on many samples of 20 from the same normal process, 95% of the intervals so computed would contain at least 95% of the process’s values. The same method on the NIST sample size of N = 43 with p = 0.90 and 99% confidence gives k2 = 2.217, which agrees with the value NIST publishes.

How to read a tolerance interval

Most misreadings come from forgetting that the result has two probabilities attached to it. This table states what can and cannot be concluded from the example above; the first four rows follow the NIST and Minitab definitions, and the last two apply them to the example.

Statement Correct? Why
“About 95% of future results will lie between 43.39 and 56.61.” Not exactly The claim is “at least 95%, with 95% confidence over repeated samples,” not a fixed 95%.
“The interval contains the true mean.” Wrong question That is the job of a confidence interval, not a tolerance interval.
“The next single measurement will fall in the interval.” Not the design goal A prediction interval targets one new observation; a tolerance interval targets a proportion of the population.
“The interval is the specification limit.” No NIST distinguishes statistical tolerance limits from engineering tolerances, which are set by design or requirement.
“If the specification is 40 to 60 mg/L, this process is covered.” Yes, for 95%/95% 43.39 to 56.61 lies inside 40 to 60, so under the normal assumption at least 95% of the process is inside the specification with 95% confidence.
“A larger sample will not change the interval.” No k2 falls as N grows (the data table below lists factors from N = 5 to 200), so the same coverage and confidence give a narrower interval.

Assumptions and common mistakes

  • Normality. The NIST formulas hold for data from a normally distributed population, and Minitab’s guidance is to use its normal tolerance interval if the data follow a normal distribution. Check a normal probability plot or histogram first, and see standard deviation for the quantity the interval is built on. For skewed positive measurements the R package offers a log-normal option, log.norm = TRUE.
  • Distribution-free alternative needs more data. Minitab states that a nonparametric tolerance interval for a 95% minimum population percentage needs a sample of “approximately 90 or more” for an accurate result, and larger for higher percentages. A sample of 20 cannot support that route.
  • Mixing up α and confidence. In the R function the argument alpha is “the level chosen such that 1 − alpha is the confidence level,” and P is “the proportion of the population to be covered.” Passing 0.95 for alpha when 95% confidence is intended gives 5% confidence.
  • Using a t- or z-multiplier instead of k. The last row of the comparison table above shows the error: 1.96 s understates the width for a sample of 20.
  • Reporting only one of the two numbers. “A tolerance interval of 43.39 to 56.61” is incomplete without both the coverage and the confidence.
  • Confusing statistical and engineering tolerances. Do not compare a computed interval to a tolerance limit and call the process “within tolerance” without saying which kind of tolerance is meant.
  • Pooling non-independent measurements. The formulas assume independent observations; repeated readings on one specimen do not count as N separate samples. This is an editorial note on the model, not a statement from the sources above.

Related terms: a reference interval is the clinical-laboratory cousin, describing the central 95% of values in a reference population, and the uncertainty it carries is a separate question from the tolerance interval’s confidence.

How to report a tolerance interval (APA-style example)

State the method, the sample size, both probabilities, the summary statistics and the limits, and name the software and the formula used. Template with the hypothetical numbers from the worked example:

A two-sided normal tolerance interval expected to contain at least 95% of the population with 95% confidence was 43.39 to 56.61 mg/L (N = 20, M = 50.0, SD = 2.4; tolerance factor k = 2.752, Howe approximation).

For a one-sided limit, say so and give the single bound: “A one-sided upper tolerance limit covering at least 95% of the population with 95% confidence was …” Add a sentence on how normality was checked. If the paper compares the interval with a specification, give the specification limits in the same units so a reader can verify the comparison.

How to calculate a tolerance interval in Excel, R or Python

All three snippets use the Howe formula above with the example’s inputs and return a factor of about 2.752 and limits of about 43.39 and 56.61.

Excel

With N in B1, mean in B2, standard deviation in B3, coverage in B4 (0.95) and α in B5 (0.05). CHISQ.INV returns the left-tailed quantile, which is the value the formula needs.

k: =NORM.S.INV((1+B4)/2)*SQRT((B1-1)*(1+1/B1)/CHISQ.INV(B5,B1-1))
Lower: =B2-k*B3    Upper: =B2+k*B3

R

The tolerance package function normtol.int takes the raw data. Its documented signature is normtol.int(x, alpha = 0.05, P = 0.99, side = 1, method = c("HE", "HE2", "WBE", "ELL", "KM", "EXACT", "OCT"), m = 50, log.norm = FALSE), and the Howe method "HE" is described as often viewed as extremely accurate, even for small samples. Without the package, base R reproduces the formula:

library(tolerance); normtol.int(x, alpha = 0.05, P = 0.95, side = 2, method = "HE")

N = 20; m = 50; s = 2.4; P = 0.95; a = 0.05
k = qnorm((1+P)/2) * sqrt((N-1)*(1+1/N)/qchisq(a, N-1))
c(m - k*s, m + k*s)

Python

from scipy.stats import chi2, norm
import math
N, m, s, P, a = 20, 50.0, 2.4, 0.95, 0.05
k = norm.ppf((1+P)/2) * math.sqrt((N-1)*(1+1/N)/chi2.ppf(a, N-1))
print(k, m - k*s, m + k*s)

In Python, chi2.ppf(a, N-1) is again the lower-tail quantile. The base-R and Python versions return 2.752, 43.39 and 56.61 for the example.

Sources

Data: Two-sided normal tolerance factors k2 (Howe approximation) by sample size

Tolerance factors k2 for a two-sided normal tolerance interval (mean plus or minus k2 times s), computed with the Howe approximation given in the NIST/SEMATECH e-Handbook, section 7.2.6.3, for nine sample sizes and three coverage/confidence combinations. Values are rounded to three decimals; the N = 43, 90% coverage, 99% confidence value (2.217) matches the NIST worked example.

Two-sided normal tolerance factors k2 (Howe approximation) by sample size
Sample size Nk2 for 90% coverage, 99% confidencek2 for 95% coverage, 95% confidencek2 for 99% coverage, 95% confidence
56.6115.0946.694
103.5823.3824.445
152.9442.9553.883
202.6592.7523.617
302.3852.553.351
432.2172.4223.183
602.1032.3333.066
1001.9772.2332.934
2001.8652.1432.816

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Tolerance Interval: Formula, Worked Example and R/Python Code

2 free questions a day, no account.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →