Safety Stock: Formula, Step-by-Step Example and Common Mistakes
How to calculate safety stock with the Z-score formula, demand deviation and lead time, with a numerical example, the link to the reorder point and the mistakes that inflate inventory.
What safety stock is
Safety stock is the quantity of product you hold above expected demand to cover two things you do not control: customers ordering more than forecast, and suppliers delivering later than agreed.
It is not a "just in case" buffer picked by eye. It is a number that comes from three inputs: how much your demand varies, how long the product takes to arrive and what service level you want to give. Change any of the three and safety stock changes with it.
It helps to distinguish it from cycle stock, which covers average demand between one replenishment and the next. Cycle stock depends on how much you order each time; safety stock, on how wrong you are.
The basic formula
The most used formula, valid when demand varies and lead time is stable:
Where:
- SS is safety stock, in units.
- Z is the safety factor associated with the service level you want (see the table below).
- σd is the standard deviation of demand per period (day, week or month, the same period in which you measure lead time).
- LT is lead time in those same periods.
The square root appears because variability accumulated over several periods does not grow linearly but with the square root of the number of periods, as long as periods are independent of each other.
How to choose the Z factor
The Z factor comes from the normal distribution: it is the number of standard deviations you need to cover so that the probability of not running out during lead time equals the chosen service level.
| Service level (cycle) | Z factor | Reading |
|---|---|---|
| 85 % | 1.04 | C items, low value |
| 90 % | 1.28 | C and slow B items |
| 95 % | 1.65 | Standard for most B items |
| 97.5 % | 1.96 | A items |
| 98 % | 2.05 | A items |
| 99 % | 2.33 | Critical: no substitute, stock-out penalty |
| 99.9 % | 3.09 | Only when a stock-out is unacceptable |
Two things the table teaches. First, cost grows faster than service: going from 95 to 99 % raises Z from 1.65 to 2.33, 41 % more safety stock for four points of service. Second, "cycle service level" (probability of no stock-out during a replenishment cycle) is not the same as fill rate (share of demand served). Fill rate is usually higher than cycle service level, because a stock-out rarely affects all of the period\'s demand.
Step-by-step example
A distributor sells an item with these figures, measured in weeks:
- Average demand: 200 units per week.
- Standard deviation of weekly demand (last 52 weeks): σd = 50.
- Supplier lead time: LT = 3 weeks, stable.
- Target service level: 95 %, so Z = 1.65.
Applying the formula:
That is, to have a 95 % probability of not running out while the order arrives, this item needs 143 units above expected demand during lead time.
If the target service level were 99 %, safety stock would be 2.33 × 50 × 1.732 = 202 units. Four points of service cost 59 more units, permanently in inventory.
When lead time varies too
In real life the supplier does not always take three weeks. If lead time has its own standard deviation (σLT), the full formula combines both sources of variability:
Where d is average demand per period and σLT the standard deviation of lead time, in the same periods.
Continuing the example, suppose lead time varies with σLT = 0.5 weeks:
Half a week of delivery variability raised safety stock from 143 to 218 units. In many catalogs supplier variability weighs more than demand variability, and it is the one almost nobody measures. Before raising safety stock, it is sometimes cheaper to negotiate with the supplier.
Safety stock and reorder point
Safety stock is not used on its own. It goes into the reorder point (ROP), the inventory level at which a new order must be placed:
With the example figures (stable lead time):
When available inventory (on hand plus in transit minus committed) drops below 743, you order. The 600 units cover expected demand during the three weeks of delivery; the 143 cover variability. If about 143 units are still left when the order arrives, the system is working as designed. If 300 are systematically left, safety stock is inflated; if it is often zero, it is short or lead time is longer than the one you used.
How to calculate it in Excel
With weekly demand in a range, for example B2:B53:
- Standard deviation of demand:
=STDEV.S(B2:B53). - Z factor for a service level in cell
E1(for example 0.95):=NORM.S.INV(E1). Returns 1.645. - Safety stock with stable lead time in
E2:=NORM.S.INV(E1)*STDEV.S(B2:B53)*SQRT(E2). - With lead time variability (σLT in
E3, average demand withAVERAGE):=NORM.S.INV(E1)*SQRT(E2*STDEV.S(B2:B53)^2+AVERAGE(B2:B53)^2*E3^2).
For a full catalog, the table has one row per item with average demand, deviation, lead time, its deviation and the service level assigned by ABC class. The rest is these same formulas filled down.
Common mistakes
- Using the deviation of sales instead of demand. When there were stock-outs, sales were lower than real demand and the deviation comes out artificially low. Months with stock-outs must be corrected or the calculation feeds on itself: less safety stock, more stock-outs, even lower deviation.
- Same service level for the whole catalog. A 98 % on C items ties up capital in what matters least. Classify (ABC by value, XYZ by variability) and assign a level per class.
- Mixing periods. Weekly deviation with lead time in days, or the reverse. Everything in the same time unit.
- Ignoring supplier variability. As the example shows, half a week of σLT changed the result by 50 %. Measure actual lead times, not the contract ones.
- Applying the formula to intermittent demand. With many zero periods, demand is not normal and the standard deviation does not describe the risk. That case calls for a different treatment.
- Computing it once and forgetting it. Deviation changes with seasonality, launches and supplier changes. It is recalculated every cycle.
- Confusing safety stock with anticipation stock. Inventory you build up before a season or a promotion is planned, not safety. Mixing them inflates the first and hides the second.
The link with the forecast
The basic formula uses the deviation of demand. But if you have a forecast, what really matters is not how much demand varies but how wrong you are when forecasting it. That is why the more precise version replaces σd with the standard deviation of forecast error (actual minus forecast) per period.
The consequence matters: when the forecast improves, safety stock goes down, without touching the service level. A highly seasonal item has a high demand deviation, but if the model captures the seasonality the error is small and so is the safety stock needed. That is the path by which a better forecast turns into less inventory at the same service.
For that you need a forecast that saves every cycle and measures its error per item. That is what ForecastSolve does in Excel and DemandSolve for a team: every month the forecast, the actual and the error metrics that feed this calculation are recorded.
Want to know how much safety stock you have in excess?
If your forecast does not measure its own error, safety stock is computed blind. We show you how to do it with your data.
Learn about ForecastSolve →Frequently asked questions
Is safety stock added to normal inventory?
Yes. Target inventory is cycle stock (what covers expected demand until the next replenishment) plus safety stock (what covers variability). The reorder point includes both.
Which service level should I use?
Not the same for the whole catalog. A items and fast movers usually get 97 to 99 %; C items, 85 to 90 %. Going from 95 to 99 % costs 41 % more safety stock, so the decision is economic, not technical.
How often should safety stock be recalculated?
At least every S&OP cycle (monthly), because demand deviation and lead time change. A safety stock computed once and forgotten ends up protecting the demand of two years ago.
Does the formula work for intermittent demand?
Poorly. It assumes demand follows a normal distribution, and with many zero months that does not hold. Those items need a different approach; we explain it in the article on intermittent demand.
Want to apply this in your operation?
Book a 15-minute call. We will tell you where we would start with your data, no sales pitch.
Book 15 minutes →