POS, inventory and multi-branch on one ledger — every sale posts to stock, cash and the P&L the moment it rings.Why ledger-first →
Inventory · February 19, 2026 · 9 min read

Safety stock formula: variance-based approach

Safety stock is the buffer against running out when demand or lead time misbehaves. Pick the level by formula and you get the service you target with the cash you can afford. Pick by gut feel and you get one or the other, randomly.

What safety stock is and is not.

Safety stock is the inventory you hold beyond what you expect to need during normal lead time. It exists to absorb two kinds of variability: demand variability (sometimes you sell more than average) and lead time variability (sometimes the supplier takes longer than promised). When everything is exactly average, safety stock sits idle. When something goes off, it covers you until the next replenishment lands.

It is not a forecast buffer for general optimism. It is not a hedge against catastrophic supplier failure. It is not extra stock for a known seasonal peak (that goes into the cycle stock, not safety). Safety stock is a statistical buffer for normal variability, sized by formula, not gut.

The variance-based formula.

Standard safety stock formula: SS = z × σ_d × √L, where z is the z-score for your desired service level, σ_d is the standard deviation of daily demand, and L is the lead time in days. Example: 95% service level (z = 1.65), demand std dev 5 units/day, lead time 9 days. SS = 1.65 × 5 × 3 = 25 units.

For more accuracy when lead time itself varies, use SS = z × √(L × σ_d² + d² × σ_L²), where d is mean demand and σ_L is standard deviation of lead time. This is more conservative and matters when supplier reliability is poor — common with international suppliers or smaller domestic ones.

Service level → z-score90% → z = 1.2895% → z = 1.6598% → z = 2.0599% → z = 2.33Doubling cost from 95→99%Formula inputsσ_d = demand std dev (3-6 mo data)L = mean lead time (days)σ_L = lead-time std devSimple: z × σ_d × √LVariable LT: full root form
Service level is non-linear — chasing 99% roughly doubles your buffer vs 95%. Pick the level that matches stockout cost.
  • z-score for 90% = 1.28, 95% = 1.65, 98% = 2.05, 99% = 2.33
  • σ_d = standard deviation of daily demand from at least 3-6 months of history
  • L = mean lead time from supplier, in days
  • σ_L = standard deviation of lead time, computed from supplier history

Picking the right service level.

Service level is the probability of not stocking out during a replenishment cycle. 95% is the default for most growing businesses — meaning 1 in 20 cycles you might run out briefly. 98% is appropriate for critical items where stockouts cost customer relationships. 99% is for genuinely critical pharma, medical devices, regulated items.

Higher service level costs more safety stock — the relationship is non-linear. Going from 95% to 99% roughly doubles safety stock for the same demand pattern. The decision is a trade-off between stockout cost (lost sales, lost relationships) and carrying cost (cash tied up, expiry risk, space). For most SKUs, 95% is the sweet spot.

A worked example: a items.

A Phoenix pharmacy chain analyses an A-class antibiotic. Daily sales over 6 months: mean 22 units, standard deviation 6.5 units. Supplier lead time: mean 4 days, standard deviation 1 day. Service level target: 98% (z = 2.05).

Simple formula: SS = 2.05 × 6.5 × √4 = 26.6, round to 27 units. With variable lead time: SS = 2.05 × √(4 × 6.5² + 22² × 1²) = 2.05 × √(169 + 484) = 2.05 × 25.6 = 52.4, round to 53. The variable lead time formula gives nearly double the safety stock — which is right, because supplier unreliability is a real risk that simple SS does not capture. Most ERPs default to simple SS; the better ones support both.

When the formula breaks down.

New SKUs with no demand history: no formula works. Default to 30 days of expected demand for the first 90 days, then re-compute from actual data. Highly seasonal items: use seasonally-adjusted demand windows, not annual averages. Promotional periods: exclude from the demand history before computing variance.

Items with clearly bimodal demand (sometimes 0/day, sometimes 50/day with no middle): standard formula gives wrong answers. Use min-max with very generous max, or move to vendor-managed inventory if the supplier will play. Trying to formula-set safety stock on these items overstocks during slow periods and stocks out during peaks.

Reviewing and updating safety stock.

Set safety stock once and forget = wrong. Demand patterns change. Suppliers get better or worse at lead time. Service level requirements shift with market position. Review safety stock per SKU per branch quarterly, more often for fast-moving categories.

A useful trigger: if a SKU has stocked out twice in 6 months, the safety stock is too low or the service level target was wrong. If a SKU has had no stockout in 24 months and consistently over 60 days of cover, the safety stock is too high. Both directions need adjustment. Most systems can flag these patterns; Nonari's reorder report recomputes from live sales each time it opens, flags items that are out, critical or low, and lists items whose cover has run past 180 days.

How nonari computes safety stock.

Nonari's reorder report derives safety stock per item from your own sales with the simple formula at about a 95% service level: 1.65 × the standard deviation of daily demand × √lead time, with the lead time taken from the item. Demand is measured over a trailing window you choose — 90 days by default — for the branch you are looking at, and zero-sales days count, so intermittent demand is not overstated as steady. Until an item has sold on at least 14 days in the window, no buffer is derived rather than one built on noise.

The derived figure sits beside whatever you set by hand, and a manual safety stock or reorder point always wins. The system does not silently change values — it suggests, you decide — and every change to an item's settings lands in the audit log, so the next planner can see who changed what and when. This matters for accountability and for keeping the planner connected to the why behind the numbers.

Frequently asked

Common questions.

What service level should I use as default?

95% is right for most growing businesses. Critical pharma and patient-safety items can justify 98-99%. Slow-moving C items can drop to 90%.

How much demand history do I need?

Minimum 3 months for a rough number, ideally 6-12 months for a reliable variance estimate. Less than 3 months means you do not have enough data — use rough rules of thumb until you do.

What if my supplier lead time has improved?

Use the recent history (last 3 months) rather than longer history that includes the worse period. Suppliers can change for the better.

Can I set different safety stock by branch for the same SKU?

Yes — and you should. Demand patterns and supplier lead times differ by branch, especially across cities. In Nonari the derived buffer already does this: run the reorder report for one branch and it sizes safety stock from that branch's own sales.

Does Nonari support multi-tier safety stock for ABC classes?

Not as a per-class setting: the derived buffer uses one service level, about 95%, for every item. To hold an A item at 98-99%, type its safety stock on the item — a manual figure always overrides the derived one.

Try nonari

Put your books on autopilot.

Free to start. No credit card. Bring your books, kick the tires, export everything if you decide to leave.