Safety Stock: How to Size It Statistically
Safety stock is the inventory buffer held against demand and lead-time variability. Formula: z × σ × √(lead time). With z-scores by service level and a worked example.Safety stock is the extra inventory held above expected demand to absorb the volatility in demand and the variability in supplier lead times. It is the buffer that prevents stockouts when reality deviates from the forecast.
The formula
The standard statistical formula for safety stock is:
safety stock = z × σ × √(lead time in days)
where:
- z is the z-score corresponding to your target service level (the probability you want to stock out)
- σ is the standard deviation of daily demand
- lead time is the time between placing an order and receiving it
Z-scores by service level
| Target service level | Z-score | Stockout frequency |
|---|---|---|
| 50% | 0.00 | 1 in 2 cycles |
| 75% (low) | 0.67 | 1 in 4 cycles |
| 90% (medium) | 1.28 | 1 in 10 cycles |
| 95% (high) | 1.65 | 1 in 20 cycles |
| 97.5% | 1.96 | 1 in 40 cycles |
| 99% | 2.33 | 1 in 100 cycles |
The right service level depends on the cost of a stockout vs the cost of carrying. A flagship product or a critical ingredient warrants 95%+. A long-tail SKU that sells once a week might warrant 75%. Most operators run blended — high service for top movers, lower for the tail.
Worked example
A coffee shop sells an average of 18 lbs of beans per day, with a daily-demand standard deviation of 4 lbs. Lead time is 3 days. The operator wants 95% service level.
- z = 1.65 (95% service)
- σ = 4 lbs/day
- lead time = 3 days
- safety stock = 1.65 × 4 × √3 ≈ 11.4 lbs
Note that safety stock is on top of expected lead-time demand (18 × 3 = 54 lbs). Total cushion at the reorder moment is about 65 lbs.
Why most safety stock numbers are wrong
Most operators set safety stock by gut feel: "keep an extra week." This produces enormous over-buffering on slow movers (where one extra week might be 10× the actual demand variance) and under-buffering on volatile items.
The statistical approach gives you a defensible number per item. With daily POS sync providing σ automatically, safety stock can be computed nightly and stay current as demand patterns change.
How LineNow computes safety stock
For every line item, LineNow:
- Pulls the 30-day daily-bucketed demand sequence from your POS.
- Computes μ (mean) and σ (standard deviation).
- For intermittent or erratic demand, uses MAD (mean absolute deviation) × 1.25 as a more robust σ estimator.
- Applies z based on the configured rush sensitivity: low (0.67), medium (1.28), high (1.65).
- Substitutes √(orderFrequencyDays) when the order cycle is shorter than the lead time, since it's the longer of the two that drives risk.
You can override the rush sensitivity per item or set a manual safety buffer on top.