Safety Stock Formula

Lesson20 min readCalculation & Safety Stock

Safety stock is the extra inventory you hold to absorb demand surprises and supplier delays during the replenishment lead time. Below you will find the formula, five methods compared on one real SKU, Excel steps and a free calculator.

Every planner eventually gets the same phone call. A customer order is about to ship short, the sales team wants to know why, and somebody asks the question nobody likes: “Didn’t we have safety stock for this?”

Sometimes the honest answer is that the safety stock was a number someone typed into the ERP five years ago and never touched again. Sometimes it was calculated, but with the wrong inputs. And sometimes it worked exactly as designed, because no buffer can protect you against every possible week.

This lesson is about getting that number right. You will learn what safety stock really protects against, the five formulas people use (and which one I would actually trust), how to pick a service level, and how to do the whole thing in Excel. We will run every method on the same SKU, so you can see how wildly the answers differ.

The short answer

The most widely used safety stock formula, when both demand and lead time vary, is:

Safety stock = Z × √( LT × σd2 + d̄2 × σLT2 )

Z = service level factor (1.65 for 95%) · LT = average lead time · σd = standard deviation of demand per period · d̄ = average demand per period · σLT = standard deviation of lead time. If your lead time is reliable, it shrinks to Z × σd × √LT.

What safety stock actually protects you from

Safety stock is the extra inventory you hold to cover uncertainty during the replenishment lead time. That last part matters. You are not buffering against “the future” in general. You are buffering against the gap between the moment you place an order and the moment it lands on your dock, because that is the window where you cannot react.

Two things can go wrong in that window:

  • Demand comes in higher than expected. Customers order more than your forecast, or a big account places a one-off order.
  • Supply arrives later than expected. The vessel rolls, the supplier slips a week, the truck sits at a congested port.

The chart below shows how this plays out in a simple reorder point system. In the first cycle everything goes to plan and the replenishment arrives just as stock touches the safety stock line. In the second cycle demand spikes. Inventory dips into the buffer, but it never hits zero, and nobody gets that awkward phone call.

How safety stock works in a reorder point system Inventory falls steadily until it hits the reorder point, an order is placed and arrives after the lead time. In the first cycle demand is normal and stock arrives just as inventory touches the safety stock level. In the second cycle a demand spike pushes inventory into the safety stock, but the buffer prevents a stockout. Reorder point Safety stock (the buffer you hope not to touch) Order placed Order arrives Demand spike eats into the buffer, no stockout Lead time Lead time Inventory on hand Time →
Figure 1. Safety stock sits underneath your cycle stock. In a normal cycle you never touch it; in a bad cycle it absorbs the surprise.

What safety stock is not for: covering a forecast that is consistently too low, papering over a supplier that is always late, or storing inventory for a promotion you already know about. Those are planning problems with planning fixes. If your actual demand runs 15% above forecast every single month, the fix is the forecast, not a bigger buffer.

The three inputs you need before touching a formula

Most bad safety stock numbers are not caused by the wrong formula. They are caused by the wrong inputs. Get these three right and almost any reasonable method will give you something defensible.

1. A service level target

This is the probability that you will not run out of stock during a replenishment cycle. A 95% cycle service level means that in 95 out of 100 order cycles, you get through the lead time without a stockout. It is a business decision, not a statistical one, and we will come back to how to choose it.

2. A measure of variability

You need the standard deviation of demand, and if your lead times wobble, the standard deviation of lead time too. Here is the subtle point that trips up a lot of people: if you forecast demand, the variability that matters is the forecast error, not the raw demand. A product with seasonal sales can have a huge demand standard deviation but a small forecast error, because the seasonality is predictable. Using raw demand would massively overstate the buffer. If you do not forecast at all and simply plan to an average, raw demand variability is fine.

3. Consistent time units

If lead time is in days, demand and its standard deviation must be daily. If lead time is in weeks, use weekly figures. Mixing a weekly standard deviation with a lead time in days is the single most common error I find when I audit safety stock spreadsheets, and it can make the result wrong by a factor of two or three.

Converting weekly variability to daily Standard deviation does not scale linearly with time. If demand in each day is independent, you divide by the square root of the number of days. A weekly standard deviation of 67 units over a 5-day working week becomes 67 ÷ √5 = 30 units per day, not 67 ÷ 5 = 13.4. The same square root logic is why lead time sits under a square root sign in the formula.

Service level and the Z-score

Safety stock formulas assume that demand during the lead time follows roughly a normal (bell-shaped) distribution. The Z-score tells you how many standard deviations above the average you need to stock to hit your chosen service level.

Lead-time demand as a normal distribution A bell curve of demand during lead time. The area up to Z = 1.645 (95%) is covered by average demand plus safety stock. The 5% tail to the right is the chance of a stockout in a replenishment cycle. Average lead-time demand + Z × σ 95% of cycles: no stockout 5% of cycles: stockout risk Safety stock
Figure 2. At a 95% service level you stock enough to cover average lead-time demand plus 1.65 standard deviations. The red tail is the 5% of cycles where demand is so high that even the buffer runs out.

You do not need to calculate Z by hand. Use this table, or =NORM.S.INV(service level) in Excel.

Cycle service levelZ-scoreExpected stockout cycles
50%0.001 in 2 (no safety stock at all)
80%0.841 in 5
85%1.04about 1 in 7
90%1.281 in 10
95%1.651 in 20
97.5%1.961 in 40
98%2.051 in 50
99%2.331 in 100
99.5%2.581 in 200
99.9%3.091 in 1,000

Look at the jump between rows. Going from 90% to 95% adds 0.37 to Z. Going from 99% to 99.9% adds 0.76. Every extra point of service near the top costs more inventory than the last one, which is why “just set everything to 99%” is an expensive habit. Figure 4, later in the lesson, shows this curve for a real SKU.

The five safety stock formulas, from crude to robust

There is no single “official” formula. Different textbooks, ERP systems and consultants use different versions, and they give different answers. Here they are in rough order of sophistication.

Method 1: Max minus average (the rule of thumb)

SS = (max daily demand × max lead time) − (average daily demand × average lead time)

It is popular because it needs no statistics. You look at your worst day and your worst lead time and size the buffer for both happening together. The problem is that “worst day” and “worst lead time” almost never coincide, and a single outlier in your history (a data entry error, a one-time bulk order) can inflate the buffer enormously. There is also no service level in it, so you cannot tell anyone what protection you are actually buying. Fine for a quick sanity check, risky as a policy.

Method 2: Demand variability only

SS = Z × σd × √LT

This is the classic textbook formula and the right one when your lead time is short and very reliable, such as a domestic supplier with a fixed weekly delivery. It ignores supply risk completely, so it will understate the buffer for imported goods.

Method 3: Lead time variability only

SS = Z × d̄ × σLT

The mirror image of Method 2. Use it when demand is very stable (a component consumed at a steady rate by a production line) but supply is unreliable. In practice this is rarer than people think.

Method 4: Combined, independent variability (King’s formula)

SS = Z × √( LT × σd2 + d̄2 × σLT2 )

This is the formula most practitioners mean when they say “the safety stock formula”, and it is the one I recommend as a default. It was popularised for practitioners by Peter King in APICS Magazine and appears in standard inventory textbooks. It combines both sources of uncertainty, assuming they are independent of each other, which is usually reasonable: a supplier delay does not normally make your customers buy more.

The square root matters. Because the two risks are independent, they rarely peak together, so the combined buffer is smaller than simply adding Method 2 and Method 3.

Method 5: Additive (both, added together)

SS = Z × σd × √LT + Z × d̄ × σLT

You will see this in some spreadsheets and blog posts. It assumes the worst demand and the worst lead time arrive together every time. That makes it conservative, sometimes appropriately so (if a port strike also triggers panic buying, the two are correlated), but usually it just ties up cash.

MethodCovers demand riskCovers supply riskHas a service levelBest for
1. Max minus averageYes, crudelyYes, crudelyNoQuick sanity checks
2. Demand onlyYesNoYesReliable local suppliers
3. Lead time onlyNoYesYesStable demand, shaky supply
4. Combined (King)YesYesYesMost SKUs: the sensible default
5. AdditiveYesYesYesCorrelated risks, critical items

Worked example: one SKU, five very different answers

Let’s make this concrete. Imagine a distributor in Ohio that sells nitrile work gloves to manufacturers. The gloves are made in Malaysia and shipped via the West Coast. The planner pulls 90 days of history and finds:

InputValue
Average daily demand (d̄)120 cases
Standard deviation of daily demand (σd)30 cases
Highest single-day demand185 cases
Average lead time (LT)10 days
Standard deviation of lead time (σLT)2 days
Longest lead time observed14 days
Target cycle service level95% (Z = 1.645)
Unit cost / annual holding cost rate$18 / 25%

Now we run each method. Always round safety stock up to a whole unit.

  1. Max minus average: (185 × 14) − (120 × 10) = 2,590 − 1,200 = 1,390 cases.
  2. Demand only: 1.645 × 30 × √10 = 1.645 × 30 × 3.162 = 156.04, so 157 cases.
  3. Lead time only: 1.645 × 120 × 2 = 394.8, so 395 cases.
  4. Combined (King): first the inside of the square root: 10 × 302 + 1202 × 22 = 9,000 + 57,600 = 66,600. The square root of 66,600 is 258.07. Multiply by 1.645 to get 424.5, so 425 cases.
  5. Additive: 156.04 + 394.8 = 550.8, so 551 cases.
Safety stock for the same SKU under five methods Max minus average gives 1,390 units, the additive method 551, the combined formula 425, lead time only 395 and demand only 157. Max minus averageMax minus average: 1,390 units1,390Additive (both variabilities)Additive (both variabilities): 551 units551Combined, King’s formulaCombined, King’s formula: 425 units425Lead time variability onlyLead time variability only: 395 units395Demand variability onlyDemand variability only: 157 units157 Units of safety stock, 95% service level, same input data
Figure 3. Same SKU, same data, same 95% target. The rule of thumb asks for more than three times what the combined formula does. Hover a bar to see its value.

Notice what dominates the combined result. The supply-side term (57,600) is more than six times the demand-side term (9,000). For this SKU, the planner’s time is far better spent making the Malaysian lead time more reliable than polishing the demand forecast. That insight alone is worth doing the calculation properly.

From safety stock to reorder point

Safety stock is half of the reorder point. The other half is the demand you expect during the lead time:

Reorder point = d̄ × LT + SS = 120 × 10 + 425 = 1,625 cases

When on-hand plus on-order inventory drops to 1,625 cases, you place the next order. Holding the 425-case buffer costs 425 × $18 × 25% = about $1,913 a year. The max minus average answer would cost around $6,255 for the same SKU. Multiply that gap across a few thousand items and you can see why finance cares which formula you use.

What does more service cost?

Safety stock required at each service level For the worked example, safety stock rises from 331 units at 90% to 425 at 95%, 531 at 98% and 601 at 99%. The curve steepens sharply above 95%. 010020030040050060070080%85%90%95%98%99% 90% service level: 331 units of safety stock33195% service level: 425 units of safety stock42598% service level: 531 units of safety stock53199% service level: 601 units of safety stock601 Cycle service level target Safety stock (units)
Figure 4. Safety stock for the glove SKU at different service levels (combined formula). Moving from 95% to 99% adds 176 cases, a 41% increase, to cut expected stockout cycles from 1 in 20 to 1 in 100. Hover a point for its value.

Safety stock calculator

Enter your own numbers. The calculator runs all five methods side by side, gives you the reorder point and the annual cost of holding the buffer, and redraws the service level curve for your SKU. Keep every time unit the same: if lead time is in days, enter daily demand.

Calculate your safety stock

Safety stock (combined)
–
units, recommended default
Reorder point
–
units
Annual holding cost
–
of the safety stock
MethodSafety stock

Assumes normally distributed demand and independent demand and lead time. Z is calculated exactly, so results can differ by a unit from table-based Z values. Results are rounded up.

How to calculate safety stock in Excel

If your history sits in Excel, you can calculate everything with built-in functions. Say daily demand is in B2:B91 and the lead times of your last 20 deliveries are in D2:D21:

Average demand       =AVERAGE(B2:B91)
Std dev of demand    =STDEV.S(B2:B91)
Average lead time    =AVERAGE(D2:D21)
Std dev of lead time =STDEV.S(D2:D21)
Z (95%)              =NORM.S.INV(0.95)

Safety stock (combined)
=ROUNDUP(NORM.S.INV(0.95)*SQRT(AVERAGE(D2:D21)*STDEV.S(B2:B91)^2
 + AVERAGE(B2:B91)^2*STDEV.S(D2:D21)^2), 0)

Two practical tips. Use STDEV.S (sample) rather than STDEV.P, because your history is a sample of all possible demand. And include the zero-demand days in your range. Leaving them out is a quiet way to overstate average demand and understate variability at the same time.

What changes in a periodic review system

Everything above assumes continuous review (the fixed quantity method): you watch inventory constantly and order the moment it crosses the reorder point. Many businesses do not work that way. They review stock every Monday, or place a container order every two weeks.

In a periodic review system, you are exposed to uncertainty for the review period plus the lead time, because an order you just missed cannot be placed until the next review. The formula simply extends the protection interval:

SS = Z × √( (R + LT) × σd2 + d̄2 × σLT2 )

For the glove SKU with a weekly review (R = 7 days) and only demand variability, the buffer rises from 157 to 1.645 × 30 × √17 = 204 cases. Review less often and you need more safety stock. The calculator above handles this if you enter a review period.

Choosing service levels: stop using one number for everything

A single company-wide service level is easy to explain and almost always wrong. Your fast-moving, high-margin products and your slow, cheap, easily substituted ones do not deserve the same protection. A common approach is to segment with an ABC-XYZ classification and set targets per segment:

SegmentTypical profileExample target
A items, critical to key customersHigh volume, high margin, stockouts lose orders97 to 99%
B itemsModerate volume and value93 to 96%
C items, easily substitutedLow volume, low value85 to 92%
Erratic, lumpy (Z-class) itemsFew large orders, many zero periodsReview case by case

These are starting points, not rules. Some companies deliberately give C items a high service level, because their safety stock is cheap and a missing low-value part can hold up a whole order. Ask what a stockout actually costs for each segment, then decide.

Cycle service level is not fill rate A 95% cycle service level means 5% of cycles see some stockout. It says nothing about how many units were short. Fill rate measures the share of demand you shipped from stock, and a 95% cycle service level usually delivers a fill rate well above 95%. If your customer contract specifies fill rate, size the buffer for fill rate, which uses a different calculation. Mixing up the two is how companies end up holding far more stock than the contract requires.

Eight safety stock mistakes I see all the time

  1. Mixing time units. A weekly standard deviation with a lead time in days. Check this first, always.
  2. Using demand variability when you forecast. If you plan to a forecast, size the buffer on forecast error. Otherwise you are buffering against seasonality you already planned for.
  3. Ignoring lead time variability. For imported goods it is often the bigger risk, as the glove example shows.
  4. Setting and forgetting. Demand patterns, suppliers and lead times change. Recalculate at least quarterly, and after any big change in sourcing.
  5. One service level for every SKU. Expensive on the long tail, risky on the critical items.
  6. Applying the normal distribution to lumpy demand. An item that sells 0, 0, 0, 400, 0 is not bell-shaped. These need a different method, such as a Monte Carlo simulation, or plain judgement.
  7. Forgetting the review period. Weekly ordering with a continuous review formula leaves you under-protected.
  8. Treating safety stock as untouchable. It exists to be used. If planners refuse to dip into it, it becomes dead stock with a nicer name.

Textbook vs reality

What the textbook says

Demand is normally distributed, demand and lead time are independent, the inputs are stable, and the formula gives you the optimal buffer.

What actually happens

Data is messy, lead times have long tails (one vessel misses a sailing and you lose two weeks), and a big customer can change behaviour overnight. The formula gives you a well-reasoned starting point. A good planner then adjusts it with what the data cannot see.

My practical advice: calculate with the combined formula, segment your service levels, then sit down with the numbers once a quarter and ask two questions. Where did we stock out despite the buffer? And where has the buffer not been touched in a year? The first list needs more protection or a better supplier. The second list is cash you can release.

Try it in a game Reading about reorder points is one thing; managing one under pressure is another. Play Reorder Point Rush to set your own buffers and see how often you stock out, or try The Beer Game to watch how small demand changes grow into big swings upstream.

Check your understanding

1. Your lead time is in weeks. Which demand figure belongs in the formula?

Weekly. Every input must use the same time unit as the lead time.

2. Average daily demand 50, daily standard deviation 10, fixed lead time 4 days, 95% service level. Safety stock is about:

1.645 × 10 × √4 = 1.645 × 10 × 2 = 32.9, rounded up to 33.

3. Why is the combined formula smaller than adding the two separate buffers?

Because demand surprises and supply delays are independent, their variances add, not their standard deviations. The square root of the sum is smaller than the sum of the square roots.

4. You switch from continuous review to ordering once a week. Safety stock should:

Go up. You are now exposed for the review period plus the lead time.

Templates that go with this lesson

If you would rather not build these from scratch, these Excel templates from the Supply Chain Geek shop cover the full workflow, from measuring variability to setting service levels by segment.

Lead Time Variability Tracker Excel template
Best match

Lead Time Variability Tracker

Measure supplier lead time variability and calculate safety stock from your own receipt data.

View template
Supply Chain Service Level Calculator Excel template
Service levels

Service Level Calculator

Six service KPIs with SKU-level cycle service level analysis, so you can see what each target really delivers.

View template
Inventory Classification Excel template with ABC and XYZ analysis
Segmentation

Inventory Classification Template

ABC, XYZ, VED, FSN and more in one dashboard: the starting point for setting different service levels by segment.

View template
Inventory
Optimization Pack
Bundle deal

Inventory Optimization Pack

Several inventory templates in one bundle, for when you are building a full planning toolkit rather than solving one problem.

View bundle

Further reading. Peter L. King, “Crack the Code: Understanding Safety Stock and Mastering Its Equations,” APICS Magazine, July/August 2011. Edward A. Silver, David F. Pyke and Douglas J. Thomas, Inventory and Production Management in Supply Chains, 4th edition, CRC Press, 2017. ASCM, ASCM Supply Chain Dictionary, entries for safety stock and service level.

Frequently asked questions

What is the formula for safety stock?

The most widely used version is Safety stock = Z × √(LT × σd² + d̄² × σLT²), where Z is the service level factor, LT is average lead time, σd is the standard deviation of demand, d̄ is average demand and σLT is the standard deviation of lead time. If lead time is fixed, it simplifies to Z × σd × √LT.

What Z-score should I use for safety stock?

It depends on your target cycle service level: 1.28 for 90%, 1.65 for 95%, 2.05 for 98% and 2.33 for 99%. In Excel, use =NORM.S.INV(service level).

What is the difference between safety stock and reorder point?

Safety stock is the buffer for uncertainty. The reorder point is the inventory level that triggers a new order, and it equals expected demand during lead time plus safety stock.

How often should safety stock be recalculated?

At least quarterly for most items, monthly for fast movers or volatile items, and immediately after a change in supplier, shipping route or demand pattern.

Can safety stock be calculated without standard deviation?

Yes, with the max minus average method: (max daily demand × max lead time) minus (average daily demand × average lead time). It is simple but tends to overstate the buffer and has no link to a service level, so use it only as a rough check.

Should I use demand or forecast error to calculate safety stock?

If you plan replenishment from a forecast, use the standard deviation of forecast error. Raw demand variability includes patterns such as seasonality that the forecast already accounts for, so it overstates the buffer.

What is the difference between cycle service level and fill rate?

Cycle service level is the probability of not stocking out during a replenishment cycle. Fill rate is the share of demanded units shipped from stock. A 95% cycle service level usually gives a fill rate above 95%.