Grubbs outlier test calculator
Check one list of numbers for a single outlier with Grubbs’ test: the G statistic, critical value, p-value, the flagged value and its position, two-sided or one-sided.
A clear answer. Here’s how.
The test statistic is G = (largest deviation from the mean) ÷ s, where s is the sample standard deviation (n − 1 in the denominator) of all N values: max |xᵢ − x̄| ÷ s two-sided, (x̄ − smallest) ÷ s or (largest − x̄) ÷ s one-sided. The value is flagged when G exceeds the critical value ((N − 1) ÷ √N) × √(t² ÷ (N − 2 + t²)), where t is the upper α ÷ (2N) point (α ÷ N one-sided) of Student’s t distribution with N − 2 degrees of freedom (Grubbs 1950; NIST/SEMATECH e-Handbook section 1.3.5.17.1). No G can exceed (N − 1) ÷ √N, which is 1.1547 for N = 3. The p-value is the same test turned round: t = G × √(N(N − 2) ÷ ((N − 1)² − N G²)), and p is N times the one-tailed probability of exceeding t (2N times, two-sided), capped at 1; this Bonferroni form is the exact tail probability once G is too large for two values to be that extreme together (G above √((N − 1) ÷ 2) two-sided or √((N − 1)(N − 2) ÷ (2N)) one-sided, which for N = 3 is every possible G, where it equals the exact geometric tail), and otherwise an upper bound that can be too large, as GraphPad also warns; the result says which applies, and simulated normal samples agree with the form above those points. The t quantile is found by bisection on the incomplete-beta t tail and checked against an independent closed-form series; the critical values agree with published tables to their rounding (Harvey’s Grubbs table, N = 4 to 14, and GraphPad’s N = 3 to 40 except one entry, N = 11, where GraphPad prints 2.34 and Harvey, an independent series and this tool give 2.355). The list shows the mean and standard deviation with and without the flagged value and the values left after it. The test assumes the data come from a normal distribution apart from the one possible outlier; it finds at most one, and applying it again to what is left is not a valid way to find more (it can miss two outliers that mask each other, or flag too many); for several outliers use a test designed for them, such as the generalised ESD test. A flagged value is a prompt to check where it came from, never a licence to delete it, and “no outlier detected” does not prove there is none. It is not suitable for strongly skewed data or fewer than about seven values. It is a calculator, not a substitute for a statistician when decisions depend on the answer.
How this is checked
5 reference checks passed These 5 cases were run when this page was built, on 20 October 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.
See the checks and where each expected answer comes from
Case 1
- Inputs
- The tool’s default inputs
- Expected, and what Toolmoz gave
- Values used (N) expected 8, Toolmoz 8Mean expected 206.43375, Toolmoz 206.43375Sample standard deviation expected 15.852564404987785, Toolmoz 15.852564404987783G statistic expected 2.4687646112124506, Toolmoz 2.4687646112124506Largest G possible for this N expected 2.4748737341529163, Toolmoz 2.4748737341529163Critical value of G expected 2.1266450871954654, Toolmoz 2.1266450871954654Position in your list expected 8, Toolmoz 8Most extreme value expected 245.57, Toolmoz 245.57P-value expected 3.0026386799164584e-7, Toolmoz 3.002638682070795e-7
- Where the expected answer comes from
- The NIST/SEMATECH Grubbs example (eight mass spectrometer measurements of a uranium isotope), two-sided at α = 0.05. NIST prints the statistic 2.4687 (the exact value is 2.46876); the mean is 1651.47/8 = 206.43375 and s = 15.85256 from exact fractions, the largest possible G is 7/√8, and the critical value, p-value and t = 34.797 use the closed-form Student t tail series of Abramowitz and Stegun 26.7.4 (no incomplete beta), in an independent Python script. Published tables give 2.13 (GraphPad, N = 8) and 2.126 (Harvey)
- Allowed difference
- ±1e-8 relative
Case 2
- Inputs
- Test high
- Expected, and what Toolmoz gave
- G statistic expected 2.4687, Toolmoz 2.4687646112124506Critical value of G expected 2.032, Toolmoz 2.031652001549944Result expected Outlier: 245.57 is flagged at α = 0.05, Toolmoz Outlier: 245.57 is flagged at α = 0.05
- Where the expected answer comes from
- The NIST handbook’s own test on the same data: upper one-sided, α = 0.05, test statistic G = 2.4687 and critical value 2.032, quoted as printed there. NIST rejects the hypothesis of no outlier because 2.4687 exceeds 2.032
- Allowed difference
- ±0.0006 absolute
Case 3
- Inputs
- Values 1 2 4Test high
- Expected, and what Toolmoz gave
- G statistic expected 1.0910894511799618, Toolmoz 1.0910894511799618Largest G possible for this N expected 1.1547005383792517, Toolmoz 1.1547005383792517Critical value of G expected 1.153118, Toolmoz 1.1531180614225283P-value expected 0.3184434225144853, Toolmoz 0.31844342251448476
- Where the expected answer comes from
- The smallest case, N = 3, can be solved exactly without any t distribution: the three standardised deviations lie on a circle, so the largest is (2/√3) cos φ with φ uniform on minus 60 to 60 degrees, and the one-sided tail is P(G above g) = arccos(g√3/2) ÷ (π/3). For 1, 2, 4: mean 7/3, s² = 7/3, G = (5/3) ÷ √(7/3) = 1.09109 and the tail is arccos(0.94491) ÷ (π/3) = 0.31844. Solving arccos(g√3/2) ÷ (π/3) = 0.05 gives the 5% critical value g = (2/√3) cos(0.05π/3) = 1.153118. The largest possible G is 2/√3 = 1.154701
- Allowed difference
- ±0.000001
Case 4
- Inputs
- Values 1 2 3 4 5 6 7 8 9 30Significance level α 0.01
- Expected, and what Toolmoz gave
- Critical value of G expected 2.4821, Toolmoz 2.482083249715332Values used (N) expected 10, Toolmoz 10G statistic expected 2.7049, Toolmoz 2.7054162541896827Result expected Outlier: 30 is flagged at α = 0.01, Toolmoz Outlier: 30 is flagged at α = 0.01
- Where the expected answer comes from
- N = 10, two-sided α = 0.01: Harvey’s Appendix 7 Grubbs table gives 2.482 (and 2.290 at α = 0.05, GraphPad 2.29); the unrounded 2.4821 is from the closed-form t tail series of Abramowitz and Stegun 26.7.4 in an independent Python script. By hand: the mean is 75/10 = 7.5, the sum of squares 116.5 + 22.5² = 622.75, s = √(622.75/9) = 8.3182, so G = 22.5 ÷ 8.3182 = 2.7049, above the critical value
- Allowed difference
- ±0.0006
Case 5
- Inputs
- Values -199.31 -199.53 -200.19 -200.82 -201.92 -201.95 -202.18 -245.57Test low
- Expected, and what Toolmoz gave
- G statistic expected 2.4687, Toolmoz 2.4687646112124506Critical value of G expected 2.032, Toolmoz 2.031652001549944Most extreme value expected -245.57, Toolmoz -245.57Position in your list expected 8, Toolmoz 8
- Where the expected answer comes from
- The NIST data with every sign reversed and the lower one-sided test: a reflection changes neither G nor the critical value, so the NIST figures 2.4687 and 2.032 apply with the smallest value flagged
- Allowed difference
- ±0.0006 absolute
What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- Values
- 199.31 199.53 200.19 200.82 201.92 201.95 202.18 245.57
- Test
- Two-sided: the value farthest from the mean, high or low
- Significance level α
- 0.05
Example result
- Values used (N)
- 8
- Values skipped (missing)
- 0
- Mean
- 206.43375
- Sample standard deviation
- 15.852564
- Most extreme value
- 245.57
- Position in your list
- 8
- G statistic
- 2.4688
- Largest G possible for this N
- 2.4749
- Significance level α
- 0.05
- Critical value of G
- 2.1266
- Equivalent Student t on N − 2 degrees of freedom
- 34.7971
- P-value
- 3.00e-7 (below 0.0001)
- P-value is
- The exact tail probability
- Result
- Outlier: 245.57 is flagged at α = 0.05
- Mean without the flagged value
- 200.84286
- Standard deviation without the flagged value
- 1.2023548
- Values without the flagged value
- 199.31, 199.53, 200.19, 200.82, 201.92, 201.95, 202.18
Test: two-sided: the value farthest from the mean, high or low. Grubbs’ test assumes the values are a sample from a normal distribution apart from the one possible outlier, and looks for one outlier only. Running it again after removing the flagged value is not valid as a way to find more (it can miss two outliers that hide each other, or flag too many); use a test designed for several outliers, such as the generalised ESD test, for that. The p-value is Grubbs’s Bonferroni form, N × the t tail probability doubled, capped at 1. It is the exact tail probability once G is too large for two values to be as extreme together (here G above 1.871), and an upper bound that can be too large below that. A flagged value is a reason to check where it came from, not a licence to delete it, and “no outlier detected” does not show there is none.