All posts

Sizing Safety Stock for Lead-Time Variability: King's Combined Formula

When Your Supplier Is the Problem, Not Your Forecast: Sizing Safety Stock for Lead-Time Variability

Here's a stockout that keeps schedulers up at night, and it has nothing to do with a forecast miss.

A filling line runs a steady finished SKU. Demand is boring—predictable week after week. Then one Tuesday the line goes dark because the co-packed flavor base didn't show up. The supplier's truck slipped three days. Your forecast was dead-on. Your demand plan was fine. But you still stocked out, and the plant still lost a shift.

When the post-mortem lands, somebody will blame the forecast anyway, because that's the reflex. But the variance that bit you lived in the dock schedule, not the demand signal. If your safety stock math only buffers demand, you were exposed the whole time and didn't know it.

This post walks through the fix: the combined-variability safety-stock formula (popularized by Peter King's Crack the Code), why the lead-time term often dominates, and how to decide where your buffer dollars actually belong.

The formula most schedulers use—and what it hides

If you've calculated safety stock before, you've probably used some version of this:

SS = Z × σ_D × √LT

Where Z is your service-level multiplier, σ_D is the standard deviation of per-period demand, and LT is the lead time in periods. It's clean, it's in every textbook, and it answers a real question: how much buffer do I need to cover demand that bounces around while I wait for replenishment?

But look at what's not in that formula: any term for lead time variability. There's √LT, the length of the wait, but nothing for how much the wait itself wobbles. That omission isn't a rounding error—it's an assumption. The demand-only formula quietly assumes your supplier is perfectly punctual: same lead time, every single time, forever.

Every CPG scheduler reading this knows how true that is. Ingredient suppliers slip. Co-packers reschedule. Packaging and label vendors run late in Q4. Freight gets stuck. The moment lead time has a standard deviation greater than zero, the demand-only formula is understating your real exposure.

The combined-variability formula

King's formula fixes the blind spot by adding a second variance term for lead time:

SS = Z × √( E(L) × σ_D²  +  E(D)² × σ_L² )

And the reorder point that goes with it:

ROP = E(L) × E(D) + SS

Let's define every term in plain operator language:

  • E(D) — average demand per period (say, units per day).
  • σ_D — standard deviation of that per-period demand (how much daily demand bounces).
  • E(L) — average lead time (days from order to usable stock on your floor).
  • σ_L — standard deviation of lead time (how much that delivery window wobbles).
  • Z — the service-level multiplier (more on this below).

The structure is the important part. Inside the square root there are two terms added together:

  1. E(L) × σ_D² — the demand-variability term. Demand noise, scaled by how long you're exposed to it.
  2. E(D)² × σ_L² — the lead-time-variability term. Supplier timing noise, scaled by how much you consume while you wait.

Here's the elegant part: if your supplier were perfectly reliable, σ_L would be zero, the second term vanishes, and the whole thing collapses back to SS = Z × σ_D × √E(L)—the familiar demand-only formula. So the classic equation isn't wrong; it's just the special case where you've assumed supply is deterministic. King's formula is the general case (Wikipedia: Safety stock).

Which term wins? A CPG worked example

The reason this matters isn't academic. The two terms can be wildly different in size, and the bigger one tells you where to spend. Let's run the same SKU under two supply realities.

Shared inputs: average demand E(D) = 500 units/day, target service level 95% so Z = 1.65.

Scenario A — steady demand, erratic supplier

  • Demand is predictable: σ_D = 50 units/day.
  • Lead time averages E(L) = 9 days but swings: σ_L = 3 days.
Demand term:     E(L) × σ_D²  = 9 × 50²        = 22,500
Lead-time term:  E(D)² × σ_L² = 500² × 3²      = 2,250,000

SS = 1.65 × √(22,500 + 2,250,000)
   = 1.65 × √2,272,500
   = 1.65 × 1,507.5
   ≈ 2,488 units

Look at the two terms. The lead-time term (2,250,000) is 100 times larger than the demand term (22,500). Nearly all your buffer exists to survive the supplier, not the forecast.

Scenario B — erratic demand, steady supplier

  • Demand bounces hard: σ_D = 150 units/day.
  • Lead time is reliable: E(L) = 9 days, σ_L = 0.5 days.
Demand term:     E(L) × σ_D²  = 9 × 150²       = 202,500
Lead-time term:  E(D)² × σ_L² = 500² × 0.5²    = 62,500

SS = 1.65 × √(202,500 + 62,500)
   = 1.65 × √265,000
   = 1.65 × 514.8
   ≈ 849 units

Now the demand term leads, but notice the magnitudes. The erratic-supplier SKU in Scenario A needs roughly three times the safety stock of the erratic-demand SKU in Scenario B—even though B's demand is far noisier.

The operator lesson: in Scenario A, every dollar you spend improving forecast accuracy buys almost nothing, because the demand term is a rounding error. The money is in the supplier. Tightening the delivery window from σ_L = 3 days to σ_L = 1 day would cut that lead-time term from 2,250,000 to 250,000 and drop safety stock to roughly 866 units. You'd free up more than 1,600 units of inventory by fixing the dock, not the forecast. That is the whole point of splitting the variance.

Choosing the right formula for the SKU

You don't need the full combined formula everywhere. Match the formula to where the variability actually lives (GAINS):

Situation Use Formula
Demand varies, supplier reliable Demand-only Z × σ_D × √LT
Demand stable, supplier erratic Lead-time-only Z × E(D) × σ_L
Both vary (most A-items) Combined (King's) Z × √(E(L)·σ_D² + E(D)²·σ_L²)
Thin data, quick estimate Max–min (Max Sales × Max LT) − (Avg Sales × Avg LT)

The max–min method is the back-of-envelope route when you don't trust your standard deviations yet: take your worst-case consumption over your worst-case lead time, subtract your average-case, and hold the difference (Netstock).

One more adjustment: if you review stock on a fixed calendar instead of continuously, your exposure window grows from the lead time to the lead time plus the review period, so the √LT becomes √(T+L). If that distinction is new to you, see continuous vs. periodic review for how the review clock changes your exposure.

Setting Z: the service-level dial

The Z multiplier is how you turn a target service level into a number. A 95% cycle service level corresponds to Z ≈ 1.65; in Excel you compute it directly with =NORMSINV(0.95) (Wikipedia: Safety stock; Netstock).

The dial is nonlinear and expensive at the top. Moving from 95% to 99% jumps Z from 1.65 to about 2.33—a 40% increase in safety stock for the last few points of protection. That's why blanket "99% on everything" policies quietly bleed working capital. Before you turn the dial, be clear about which service metric you're targeting, because cycle service level and fill rate are not the same promise—see cycle service level vs. fill rate.

The honest caveats (so you don't over-trust the math)

King's formula is a sharp tool, not scripture. A few things to keep honest:

  • No universal formula exists. The safety-stock literature is explicit that the right formula depends on your assumptions, and no single equation covers every case (Wikipedia: Safety stock).
  • It assumes i.i.d.-normal demand and statistically stable supply. Seasonality, trend, and promo spikes all break the independent-and-identically-distributed assumption. If your demand has a strong season or your supplier's reliability degrades every December, a single σ_D and σ_L computed over the whole year will mislead you.
  • Naive variance math can understate the buffer. Academic work shows that traditional procedures which simply multiply per-period demand variance by lead time can understate lead-time-demand variance—leaving safety stocks too low (Prak et al., ScienceDirect). When demand itself is forecasted rather than known, the forecast error compounds the exposure.

The practical response: segment before you buffer. Don't compute one σ_L across all suppliers and seasons. Re-estimate from recent, relevant actuals, and recompute separately for your high-value, high-variability items. ABC-XYZ segmentation is the natural home for deciding which SKUs earn the full combined-formula treatment.

The CPG twist: perishables cap your lead-time buffer

There's a trap specific to food and beverage. The intuitive fix for an erratic supplier is "just hold more finished goods." But safety stock of perishable or time-sensitive product can spoil before you use it (Wikipedia: Safety stock). A 2,488-unit buffer against a late ingredient is worthless if the finished SKU only has 21 days of shelf life and you turn it in 30.

That ceiling changes the calculus. When shelf life caps how much you can safely hold, the lever shifts from absorbing lead-time variability to reducing it:

  • Shrink σ_L at the source. Supplier scorecards, firm delivery windows, and penalty/incentive terms tighten the distribution instead of paying to buffer it.
  • Dual-source critical inputs. Two imperfect suppliers often yield a tighter combined lead-time distribution than one unreliable one.
  • Apply SMED thinking to inbound. Faster, more consistent receiving and staging cuts the back end of your lead time.

For scheduling under a hard shelf-life ceiling, see shelf-life-constrained production scheduling. And if you want the deeper theory on why variability—not just utilization—drives the queue that becomes your lead time, Kingman's equation is the companion read.

Operator takeaways

A concrete checklist you can run this week:

  1. Measure σ_L from your own receiving data. Pull the last 12 months of actual order-to-dock times per supplier. The standard deviation of that series is your σ_L. Most schedulers have never calculated it.
  2. Recompute safety stock with the combined formula for your A-items—the ones where a stockout actually hurts.
  3. Compare the two variance terms. Put E(L)·σ_D² next to E(D)²·σ_L². Whichever is bigger is your real problem.
  4. Act on the bigger one. If the lead-time term dominates, stop tuning the forecast and go fix the supplier. If the demand term dominates, the forecast work pays off.
  5. Respect shelf life. If buffering collides with spoilage, pivot from holding stock to stabilizing lead time.

The headline insight is simple: a stockout is not automatically a forecast failure. Before you blame the demand plan, check whether the variance lived in the dock schedule all along. If you're stuck in a cycle of reactive replenishment, stop firefighting stockouts covers the operating-model side of this shift.

Keeping the buffer live

The hard part isn't the formula—it's that σ_D and σ_L both drift. Suppliers improve or degrade; demand variability shifts by season. A safety stock computed once and frozen in a spreadsheet is stale within a quarter. An agentic scheduler keeps both variability terms current from live floor and receiving data, re-sizes buffers as supplier reliability changes, and flags when the lead-time term starts to dominate—so you're acting on this quarter's variance, not last year's. See why headless and agentic for how that fits a modern planning stack, or explore what agents can do.

Sources

More from the journal