How to use this calculator
Enter the sample mean, the standard deviation, the number of measurements and the confidence level you want. Leave the standard deviation set to from the sample unless you truly know the population σ in advance. To plan an experiment, enter the margin of error you are aiming for and the calculator gives the sample size needed.
Formulas
Worked example
16 bolts with mean length 50.2 mm and s = 2.8 mm, 95% confidence (the default)
- Standard error: 2.8/√16 = 0.70 mm.
- With df = 15, t0.025 = 2.131 (a z-value would be 1.960; t is wider because s is only an estimate).
- Margin: 2.131 × 0.70 = 1.49 mm, so the interval is 48.71 to 51.69 mm.
- To get the margin down to ±1 mm you would need n = 33 bolts.
Common t-values
For 95% confidence, t0.025 is 12.71 with 1 degree of freedom, 2.571 with 5, 2.228 with 10, 2.131 with 15, 2.086 with 20 and 2.042 with 30, approaching the z-value 1.960 for large samples. Small samples pay a real price: with only 3 measurements the interval is more than twice as wide as the z-formula suggests.
Assumptions and limits
- The measurements are independent and random. Repeated readings of one specimen are not independent samples of a population.
- For small samples (under about 30), the population should be roughly normal; for larger ones the central limit theorem makes the interval reliable anyway.
- This is an interval for the mean, not for individual values. Most individual parts fall well outside it.
Frequently asked questions
Does a 95% interval mean a 95% chance the true mean is inside?
Strictly, no: the true mean is fixed. It means the method captures the true mean in 95% of repeated experiments. In practice people read it as a range of plausible values for the mean.
When should I use z instead of t?
Only when σ is known from long experience with the process, not computed from this sample. If you calculated s from your data, use t.
How do I make the interval narrower?
Take more measurements (the width shrinks with √n), lower the confidence level, or reduce the scatter in the process itself.