Safety stock calculator with lead-time variability
Calculate safety stock from average daily demand, lead time, their standard deviations and a cycle service level, with the formula and a worked example.
Plan an inventory project
Calculator
Safety stock is, in the ASCM dictionary’s words, “a quantity of stock planned to be in inventory to protect against fluctuations in demand or supply.” This calculator sizes that buffer for one item from five numbers: how much you use per day, how much that varies, how long the supplier takes, how much that varies, and how often you accept running short during a replenishment cycle.
How to use the calculator
- Average daily demand. Use shipments or consumption, not sales orders, over a period long enough to be representative. Keep one day basis everywhere: if lead time is in working days, demand must be per working day.
- Standard deviation of daily demand. Calculate it from the same daily history; a spreadsheet’s STDEV function on the daily totals is enough. If you plan from a forecast, use the standard deviation of forecast error instead, because that is what the buffer has to absorb.
- Average lead time. Measure from purchase order release to stock available to pick, using your receipt history rather than the supplier’s quote.
- Standard deviation of lead time. From the same receipts. Enter 0 only if the supplier is genuinely consistent.
- Cycle service level. The probability of not running out during one replenishment cycle. Set it per item class, not once for the whole catalog.
The formula
The calculator combines demand variability and lead-time variability, assuming both are independent and roughly normal:
σLT = √(L × σd² + d² × σL²)
Safety stock = z × σLT
| Symbol | Meaning | Example value |
|---|---|---|
| d | Average daily demand | 120 units |
| σd | Standard deviation of daily demand | 35 units |
| L | Average lead time | 9 days |
| σL | Standard deviation of lead time | 2 days |
| σLT | Standard deviation of demand over the lead time | Calculated |
| z | Service level factor from the normal distribution | 1.645 at 95% |
The first term inside the root is daily demand variability scaled to the lead time. Variance adds up day by day, so the standard deviation grows with the square root of the lead time, as the MIT ESD.260 lecture shows. The second term is the extra uncertainty from a lead time that moves. When σL is 0, the formula reduces to the familiar z × σd × √L.
Example (fictional). Item EX-20118 ships an average of 120 units a day with a standard deviation of 35. The supplier’s lead time averages 9 days with a standard deviation of 2. The planner wants a 95% cycle service level.
- Demand term: 9 × 35² = 9 × 1,225 = 11,025
- Lead-time term: 120² × 2² = 14,400 × 4 = 57,600
- σLT = √(11,025 + 57,600) = √68,625 = 262.0 units
- z at 95% = 1.645
- Safety stock = 1.645 × 262.0 = 431 units, rounded up
- If lead time never varied: 1.645 × 35 × √9 = 173 units
- Days of cover: 431 ÷ 120 = 3.6 days
Reading the result
Without lead-time variability, the buffer would be 173 units. The other 258 units exist because the supplier is inconsistent, not because customers are. A conversation about delivery reliability, or a second source, can be worth more than the stock.
The service level is a cycle service level. At 95%, you expect to run short in about one replenishment cycle in twenty; it does not mean 5% of units go unfilled. Fill rate is usually higher, and you can track it with the OTIF and fill rate calculator.
Higher service levels get expensive quickly. The factor z is 1.28 at 90%, 1.645 at 95%, 2.05 at 98% and 2.33 at 99%, so moving an item from 95% to 99% raises its safety stock by about 41%.
The result then feeds the reorder point: demand over the lead time plus safety stock. Carry it into the reorder point calculator.
Common mistakes
- Mixed time units. Weekly demand variability with a lead time in days gives a wrong answer that still looks plausible.
- Stockout days in the history. Days with zero shipments because the item was out of stock understate demand and distort its variability. Exclude them.
- Quoted lead times. Suppliers quote what they intend. Receipts show what happened.
- One service level for everything. Fast, high-value or critical items deserve a different target from slow, cheap ones.
- Set once, never reviewed. Recalculate when demand shifts or a supplier or lane changes, and at least quarterly for important items.
When the simple model stops working
The normal approximation suits items with steady demand on most days. It breaks down for:
- Intermittent demand, such as spare parts with many zero days and occasional large orders. See MRO and spare parts.
- Trend, seasonality and promotions. Use forecast error rather than raw demand variability, and recalculate before the season.
- Periodic review. If orders go out on a schedule, the buffer has to cover the review period plus the lead time.
- Very high service levels, where the tails of the real distribution matter more than the average.
- Several stocking locations that rebalance stock between themselves.
When safety stock has to be recalculated for thousands of items and written back to your ERP or WMS, it becomes software work. An inventory management software engagement builds the calculation into replenishment, with the inputs and overrides visible to planners.
Scope your project.
Tell us what you need to track, which systems you run and when it has to work. We reply with questions or a time to talk.