APICS is the premier professional association for supply chain management.

Crack the Code

By Peter L. King, CSCP | July/August 2011 | 21 | 4

Understanding safety stock and mastering its equations

Determining appropriate inventory levels is one of the most important and most challenging the the tasks faced by operations managers. If you carry too much inventory, you tie up money in working capital; if you don’t carry enough inventory, you face stockouts. Fortunately, the cycle stock portion of the inventory equation is straightforward. What keeps people up at night is safety stock.

 Safety stock simply is inventory that is carried to prevent stockouts. Stockouts stem from factors such as fluctuating customer demand, forecast inaccuracy, and variability in lead times for raw materials or manufacturing. Some operations managers use gut feelings or hunches to set safety stock levels, while others base them on a portion of cycle stock level— 10 or 20 percent, for example. While easy to execute, such techniques generally result in poor performance. A sound, mathematical approach to safety stock will not only justify the required inventory levels to business leaders, but also balance the conflicting goals of maximizing customer service and minimizing inventory cost.

Safety stock determinations are not intended to eliminate all stockouts—just the majority of them. For example, when designing for a 95 percent service level, expect that 50 percent of the time, not all cycle stock will be depleted and safety stock will not be needed. For another 45 percent of cycles, the safety stock will suffice. But in approximately 5 percent of replenishment cycles, expect a stockout. (See Figure 1.)

While designing for a higher service level—say, 98 percent—would result in fewer stockouts, this requires significantly more safety stock. There must be a balance between inventory costs and customer service. By using the methods and equations that follow, you can find safety stock levels to achieve your desired customer service levels.

Variability in demand

Imagine the only variability you need to protect against is demand variability, and good historical data are available. The safety stock needed to give a certain level of protection simply is the standard deviation of demand variability multiplied by the Z-score—a statistical figure also known as standard score. For example, to satisfy demand with a 95 percent confidence level, according to statistical analysis, it’s necessary to carry extra inventory equal to 1.65 standard deviations of demand variability. This is equivalent to a Z-score of 1.65.

To further understand Z-score, imagine that no safety stock is carried. In this situation, the Z-score is zero. even so, there will be enough inventory to meet demand in 50 percent of cycles. If Z-score equals 1, the safety stock will protect against one standard deviation; there will be enough inventory 84 percent of the time. This percentage of cycles where safety stock prevents stockouts is called the cycle service level.

Figure 2 shows the relationship of desired cycle service levels to Z-score. As illustrated, the relationship is nonlinear: higher cycle service levels require disproportionally higher Z-scores and, thus, disproportionately higher safety stock levels. Typical goals fall between 90 and 98 percent, and—statistically speaking— a cycle service level of 100 percent is unattainable.

Rather than using a fixed Z-score for all products, set the Z-score independently for groups of products based on criteria such as strategic importance, profit margin, or dollar volume. Then, those stockkeeping units with greater value to the business will have more safety stock, and vice versa.

So far, it has been assumed that the demand periods equal total lead time, including any review period. When this is not the case, instead, calculate standard deviation based on periods equal to the lead time. For example, if the standard deviation of demand is calculated from weekly demand data and the total lead time including review period is three weeks, the standard deviation of demand is the weekly standard deviation times the square root of the time units, or √3.

Taking all this into consideration, the safety stock equation becomes:

The performance cycle includes the time needed to perform functions such as deciding what to order or produce, communicating orders to the supplier, manufacturing and processing, and delivery and storage, as well as any additional time required to return to the start of the next cycle.

Variability in lead time 

In the previous equation, safety stock is used to mitigate demand variability. However, when variability in lead time is the primary concern, the safety stock equation becomes: 

When both demand variability and lead time variability are present, statistical calculations can combine to give a lower total safety stock than the sum of the two individual calculations. In cases where demand and lead time variability are independent—that is, they are influenced by different factors—and both are normally distributed, the combined safety stock equation becomes:

In other words, the safety stock is Z-score times the square root of the sum of the squares of the individual variabilities.

But when demand and lead time variability are not independent of each other, this equation can’t be used. In these cases, safety stock is the sum of the two individual calculations:

Cycle service level and fill rate 
The previous equations are useful for predicting the safety stock needed to attain a certain cycle service level— a percentage of replenishment cycles. Sometimes, business leaders instead wish to control the amount of volume ordered that is available to satisfy customer demand—a quantity known as fill rate. Fill rate often is a better measure of inventory performance, as cycle service level merely indicates the frequency of stockouts without regard to their magnitudes. (See Figure 3.)

Cycle service level reflectsvolume of stockouts the frequency of stockouts

FIgure 3: Cycle service level and fill rate

As illustrated in Figure 3, when supply and demand are relatively stable—that is, when standard deviations of demand and lead time are low—fill rate will tend to be higher than cycle service level. While stockouts still occur, the magnitude of stockouts tends to be small. Conversely, when demand or lead time variability is high, fill rate will be lower than cycle service level, and the volume of stockouts will be high.

To better understand these equations, consider the following example of a warehouse that holds large rolls of plastic film. The film gets sold to processors who cut it into shorter, narrower rolls for food packaging, pallet wrapping, or as a dielectric material in industrial capacitors.

The following are the relevant data for one unit type: 
Weekly demand = 50 rolls 
Standard deviation of weekly demand = 10 rolls 
Standard deviation of lead time = 0 
Production cycle = weekly 
Production capacity = 496 rolls/week.

The lead time is very stable and predictable. Process reliability is high enough that the manufacturing lead time never exceeds seven days, and the lead time of transport from the manufacturing facility to the warehouse never exceeds one day. Because this gives a standard deviation of lead time of zero, the safety stock requirements can be calculated from the original equation:

The desired cycle level is 95 percent; that is, the business can tolerate stockouts of this product on no more than 5 percent of the replenishment cycles, or slightly more than two per year. Using the chart in Figure 2, the Z-score is found 1.65. Performance cycle, which affects replenishment of the warehouse inventory, is the sum of the seven-day manufacturing time and the one day needed to arrive at the warehouse, for a total of eight days. T1, the time increment used to calculate σD, is seven days. Thus:

If lead time were variable, more safety stock would be required to meet performance goals, and the safety stock equation becomes:

In this example, lead time varies with a standard deviation of half a day, or approximately 0.07 weeks. Thus:

These results demonstrate that demand variability is the dominant influence on safety stock requirements: Its effect is almost 10 times that of lead time variability. With the recognition of what factors dominate an equation, it becomes easier to focus improvement efforts. In this case, if a reduction in safety stock is desired, it is far more productive to reduce demand variability than lead time variability. Conversely, if a high level of customer service is not required, safety stock can be lowered to a more appropriate level.

Once safety stock levels have been established, inventory levels should be monitored on an ongoing basis to determine if the inventory profile is as expected. Is the safety stock being consumed in about half of the cycles? Are service level targets being realized? If not, before any adjustments are made, perform a root cause analysis to see if any special causes are responsible for the deviations from expected results.

Safety stock alternatives
The previous calculations may result in safety stock recommendations higher than what business leaders feel they can carry. The good news is there are alternatives to mitigate variability other than safety stock.

One is implementing an order-expediting process for preventing stockouts when safety stock is insufficient to cover all random variation. This practice is especially appropriate for products that cost more to produce (and thus cost more to carry in inventory).

In one example involving an expensive but relatively lightweight product, total supply chain costs were reduced significantly. The company carried small amounts of safety stock in overseas warehouses, and it relied on air freight to cover peaks in demand. The cost of shipping a small percentage of total demand via air was minimal compared to the cost of carrying large amounts of safety stock of the valuable material on an ongoing basis.

Another alternative to carrying safety stock is to consider a make-to-order (MTo) or finish-to-order (FTo) production environment. If lead times allow, MTo eliminates the need for most safety stock. Meanwhile, FTo allows for less differentiation in safety stock than finished-product inventory, which lowers demand variability and reduces safety stock requirements. FTo and MTo also are well suited for situations where customers are willing to accept longer lead times for highly sporadic purchases.

In the end, safety stock can be an effective way to mitigate demand uncertainty and lead time variability while still providing high service levels to customers. But before proceeding with a plan, first understand how to determine appropriate levels of safety stock—and what degree of protection they provide.

Peter L. King, CSCP, is founder and president of consulting firm Lean Dynamics LLC and author of Lean for the Process Industries: Dealing with Complexity. Previously, he was a principal consultant in the lean technology division of DuPont. he may be contacted at peterking@leandynamics.us.

All comments will be published pending approval. Read the APICS Comment Policy.


  1. Chaitanya November 30, 2012, 10:32 AM


    Very good article and gives insight into safety stock calculation. But it will be helpful how Target days supply effects the SS calculation in addition to Z score, lead time and Std deviation.



  2. Varun November 19, 2013, 07:46 AM
    Target days supply should have no effect on SS calcualtions. IT is merely a goal set for how many days of inventory you want to carry. To get to that target involves next steps involving reduction in supplier lead time and MOQ definitions. Quite an extensive topic but the goal is to reduce SS at all times

  3. sean July 21, 2015, 10:13 AM
    I'm a big fan of this article and pass it on frequently to help explain why we use the equations shown above. I had a great question raised recently: "Does your equation take into consideration past-due backlog?" I'm stumped, it seems like it should be covered because it's just part of our regular demand but if it all gets shipped at once we may run out of parts. Does anyone have any advice?

  4. gaurav dua April 14, 2016, 09:59 AM
    are CFR and CSL interchangeable in formula ? 95% CSL means 1.65 times stock but baseline CFR is 99% for most companies and using this as CSL means 4 times SD resulting in too much stocks
    For SS ,it is better to target CSL (95% for A and B category) and because that means carrying enough SS ,it can cater to 98% or more of CFR
    So what should one use in formula - CSL or CFR where the two measures are very different and baseline expectations are also different 95% vs 99%

  5. Peter L. King, CSCP April 14, 2016, 01:35 PM
    CSL (Cycle Service Level) and CFR (Customer Fill Rate) are two entirely different measures and are not interchangeable. The calculations are entirely different.  For each of the equations described in the article, the Z score depends on CSL. The calculation of CFR is more complex, and is described in my book, Lean for the Process Industries (Productivity Press, 2009), as well as Chopra and Meindl, Supply Chain Management (Pearson Prentice Hall, 2007).

    In many cases, the CFR will be much higher than CSL, and the situation you describe, a 99% CFR with a 95% CSL, is not uncommon. However, with high demand variability, the opposite may be true; CFR can actually be lower than CSL.
  6. Filippo August 02, 2016, 10:50 AM
    Really nice article.
    Although this, I still have a doubt:
    Why does the SS formula take into account ((PC/T1)* σD^2) and not ((PC/T1)* σD)^2, when both variabilities (demand and time variability) are considered?
    I have this doubt, because, theoretically, the variance of a product of two variables(σ(X*Y) is equal to the following formula:
    σ(X*Y)= σx^2*σy^2 +σx^2*(E(Y))^2+ σy^2*(E(X))^2
    And applying this formula to the demand and time variability, the SS should be:
    SS=Z* σ(D*LT)
    And, therefore, the final result should be:
    SS= Z*sqrt((PC/T1)*σD)^2+(σLT*D)^2)
  7. Peter L. King, CSCP August 03, 2016, 08:18 AM
    That’s a very good question, and it’s good you asked.  A lot of people assume the equation is incorrect based on the same reasoning you used, and just square the PC/T1 parameter, which is not correct. 

    The PC/T1 parameter is there to correct for situations where the time increments from which sD was calculated differ from the total lead time.  If for example, D is captured in weekly increments and sD is calculated from that data set, but the lead time is, say 17 days, you would have to multiply sD representing 7 day variability by SQRT (17/7) to approximate the sD for 17 day periods.  So SQRT (17/7) would go into the combined variance equation, and whenever everything gets squared, it goes to the first power.

    I hope that clarifies it for you.  Many people are confused by the equation, expecting it to be symmetrical, and when it is not, just square the (PC/T1) term to make it so.

    For a more thorough treatment of this general topic, it is covered in chapter 15 of my book, Lean for the Process Industries – Dealing with Complexity, Productivity Press, 2009.  In fact, the Crack the Code article was a heavily edited version of chapter 15.
  8. Jess August 21, 2016, 04:31 PM
    How would I find the safety stock if I'm given a MAPE instead?

    I'm having a hard time wrapping my head around this. How would I calculate SS with the following info below?
    Demand per month: Jan = 100, Feb = 350, Mar = 200, Apr = 700, May = 200, June = 800
    Lead-time: 4 weeks + variability of 10%
    Service Lvl: 98%

    Thanks for any help.
  9. Peter L. King, CSCP August 29, 2016, 08:20 AM
    I have never known of anyone using MAPE, or any average deviation or error, to set safety stock levels.  It is much better to use a statistical measure of variation or of error so you can calculate the likelihood of a stockout under various conditions and compare that to customer delivery targets.  So if you’re using forecasts to calculate cycle stock, you should use standard deviation of forecast error to set safety stock levels.   (In a pure statistical sense, this may not be a true standard deviation, but it is calculated in a similar fashion.)

    If your forecast demand varies as much as you show, then the cycle stock target should be adjusted month by month to agree with the forecast.
    The lead time variability should be stated as a standard deviation around the 4 weeks, rather than as 10%, again so you can estimate the likelihood of lead time variation causing a stockout for various levels of safety stock.
    I hope that helps.  If not, I’ll be happy to take another crack at explaining it.


  1. RadEditor - HTML WYSIWYG Editor. MS Word-like content editing experience thanks to a rich set of formatting tools, dropdowns, dialogs, system modules and built-in spell-check.
    RadEditor's components - toolbar, content area, modes and modules
    Toolbar's wrapper 
    Content area wrapper
    RadEditor's bottom area: Design, Html and Preview modes, Statistics module and resize handle.
    It contains RadEditor's Modes/views (HTML, Design and Preview), Statistics and Resizer
    Editor Mode buttonsStatistics moduleEditor resizer
    RadEditor's Modules - special tools used to provide extra information such as Tag Inspector, Real Time HTML Viewer, Tag Properties and other.