Skip to content
Inventory & supply chain

Safety stock calculator — service level and z-score

Calculate safety stock two ways: service level with a z-score table, or max usage minus average usage. Includes days of cover and stock value.

Free · no signup · runs in your browserUpdated
Short answer

Safety stock by the service-level method is z × standard deviation of demand × √lead time. At 95% service (z = 1.65), a daily demand deviation of 90 units and a 12-day lead time, safety stock is 513 units. The simpler max-minus-average method gives 5,330 units for the same item.

Safety stock is the inventory you hold for the demand you did not forecast and the delivery that arrived late. It buys availability, and it is paid for in cash, space and obsolescence. The only honest way to set it is to name the service level you want and price what it costs.

This calculator runs both common methods side by side. The service-level method scales the buffer to measured demand variability. The max-minus-average method needs no statistics and almost always returns a larger number — seeing both is how you find out whether your current buffer has a rationale.

Your numbers

Method
Demand and lead time
units/day

Use demand, not shipments — shipments hide the demand you could not serve.

days

Measured order-to-available, from your last 20 receipts. Same day basis as demand.

$

Landed cost per unit, used to price the buffer.

Service-level method
units

Sample standard deviation over 12–24 recent periods, with one-off orders removed.

The probability of not stocking out during a replenishment cycle. Not the same as fill rate.

Max-minus-average method
units/day

Highest daily usage you have actually seen in the review window.

days

Longest order-to-available time recorded for this supplier.

Result

Safety stock at 95% service level
513 units

1.2 days of cover at 420 units a day

Service-level method513 units
Max-minus-average method5,330 units
z used1.6449
σ of demand over the lead time311.8 units
Demand during average lead time5,040 units
Value of the selected buffer$4,308
z at 95% service level = 1.6449
√lead time = √12 = 3.4641
σ over the lead time = 90 × 3.4641 = 311.8 units
Safety stock = 1.6449 × 311.8 = 513 units
513 units is 1.2 days of cover, costing $4,308 to carry as stock. The max-minus-average method would hold 5,330 units for the same item — 10.4× more — because it stacks peak demand on top of the longest lead time. This formula treats lead time as fixed, so if your supplier slips, add lead-time variance with the reorder point calculator.
Service-level method at your current σ and lead time. The last few percentage points of availability cost the most.
Service levelzSafety stockStock value
80%0.8416262 units$2,204
85%1.0364323 units$2,714
90%1.2816400 units$3,356
95%1.6449513 units$4,308
97.5%1.9600611 units$5,133
98%2.0537640 units$5,378
99%2.3263725 units$6,092
99.5%2.5758803 units$6,746
99.9%3.0902963 units$8,093

Everything is computed in your browser. Nothing you type is sent anywhere or stored.

The formula

Safety stock = z × σdemand × √Lead time
z
The one-sided normal z-score for your target cycle service level. 1.65 at 95%, 2.33 at 99%, 3.09 at 99.9%.
σdemand
Standard deviation of demand per period, in units. Use the same period as the lead time — daily deviation with lead time in days.
Lead time
Replenishment lead time in the same periods as σdemand. The square root appears because variances add over independent periods, not standard deviations.
Max-minus-average
The alternative: (max usage per day × max lead time) − (average usage per day × average lead time). No statistics, no distribution assumption.

The service-level formula assumes lead time is fixed. If your supplier's lead time itself varies, this understates the buffer — the combined formula in the reorder point calculator adds lead-time variance properly.

Worked example

Average daily demand
420 units
Standard deviation of daily demand
90 units
Average lead time
12 days
Target service level
95% (z = 1.6449)
Max daily usage / max lead time
610 units / 17 days
Result
Service level: 513 units · Max-minus-average: 5,330 units

√12 = 3.4641, so safety stock = 1.6449 × 90 × 3.4641 = 513 units, about 1.2 days of cover. The max-minus-average method gives (610 × 17) − (420 × 12) = 10,370 − 5,040 = 5,330 units, ten times larger. Part of that gap is real — it covers a 17-day supplier — and part is the method's habit of stacking two worst cases that rarely coincide.

The service level to z-score table

z is a lookup, not a judgement call. It converts the cycle service level you want — the probability of not running out during a replenishment cycle — into the number of standard deviations of cover you need. The cost of that cover is not linear: the last 4.9 percentage points cost more than the first 90.

Cycle service levelzSafety stock at σ = 90, LT = 12Extra over 90%
90%1.2816400 units
95%1.6449513 units+113
97.5%1.9600611 units+211
99%2.3263725 units+325
99.9%3.0902963 units+563
Going from 90% to 99.9% availability costs 2.4× the buffer on this item.

Why the square root of lead time

Because variances add, not standard deviations. Over 12 independent days the variance of total demand is 12 × 90², so the standard deviation is 90 × √12 = 311.8 units, not 90 × 12 = 1,080. Multiplying by lead time instead of its square root overstates safety stock by 3.5× at a 12-day lead time, which is a common and expensive spreadsheet error.

Choosing between the two methods

Service level (z × σ × √LT)Max minus average
NeedsDemand history to compute σ, and a service-level policyOnly observed maximum usage and maximum lead time
HandlesDemand variability, at a stated confidenceBoth demand and lead-time worst cases, at unstated confidence
Typical resultSmaller, defensible, tunable per item classLarger, often several times larger
Fails whenDemand is intermittent or heavily skewed, so the normal assumption breaksOne freak month sets the maximum forever
Best forA-items with enough history to trust σNew items, C-items, and any item where you have no clean history

A reasonable policy uses both: the service-level method for A-items where the buffer is worth arguing about, max-minus-average as a sanity ceiling, and a flat days-of-cover rule for the long tail. Rank the items first with ABC analysis.

Before you raise the buffer

  • Check σ is demand, not shipments. Shipments are censored by your own stockouts, so a badly-served item looks less variable than it is.
  • Strip out one-off orders before computing σ, or a single project order sets the buffer for the whole year.
  • Use the supplier's actual lead times, not the value in the item master. Received-date minus order-date, last 20 receipts.
  • Fix the lead time first. Cutting lead time from 12 days to 6 removes 29% of the buffer for free, because √6 ÷ √12 = 0.71.
  • Price the alternative. Compare the carrying cost of the extra buffer against what a stockout actually costs you with the stockout cost calculator.

Every input here — demand history by item, receipt dates against order dates, current on-hand — already exists in your ERP and is tedious to extract. Ask for "daily shipped units by item for the last 90 days" or "purchase order lines with order date and receipt date for item X", and check the query it shows you before you set a policy on the answer.

Frequently asked questions

What is the safety stock formula?

The standard version is z × σdemand × √lead time, where z comes from your target service level and σ is the standard deviation of demand per period. At 95% service, σ of 90 units a day and a 12-day lead time, safety stock is 1.6449 × 90 × 3.4641 = 513 units.

What z value should I use for 95% service level?

1.6449, usually rounded to 1.65. This is the one-sided normal value — you only care about demand being higher than expected, not lower. Other common values: 1.28 at 90%, 1.96 at 97.5%, 2.33 at 99% and 3.09 at 99.9%.

Why is my max-minus-average safety stock so much bigger?

Because it multiplies the worst observed demand by the worst observed lead time, and assumes both happen at once. That combination is far less likely than either alone. It also covers lead-time variability, which the basic service-level formula ignores completely, so some of the gap is genuine protection.

Should safety stock be the same for every item?

No. Buffer belongs where a stockout is expensive and demand is unpredictable. A common policy sets 98–99% service on A-items, 95% on B-items and a flat two-week cover on the C tail, then reviews the exceptions. A flat percentage across thousands of SKUs over-buys the tail and under-buys the top.

Does safety stock change with order quantity?

Not in the formula — safety stock depends on variability during lead time, not batch size. It changes in effect, because ordering in larger batches means fewer replenishment cycles a year and therefore fewer chances to stock out. Set order quantity with EOQ and the buffer separately.

How do I calculate the standard deviation of demand?

Take demand per period for at least 12 to 24 recent periods, in the same unit as your lead time, and compute the sample standard deviation. Remove known one-off orders first, and use demand rather than shipments so your own past stockouts do not hide the variability.

All 50 ERP & finance tools

Stop calculating it by hand. Just ask your ERP.

This calculator needs you to find the inputs first. ERPray pulls them from your own ERP account and computes the answer live — with the exact query shown so you can check it.