Inventory
Safety stock is the extra stock you hold so a late delivery or a sales spike does not empty the shelf before the next order lands. For most small stores, the best formula is z x square root of (lead time x demand variance + daily sales squared x lead-time variance), with z from your service level (1.65 for 95%). Use the max-based method only as a quick sanity check, because it sets the buffer at the worst case of both at once.
By Vishruth, Founder, Tenpo AI
11 min read

The formula most small stores should use is safety stock = z x square root of (L x sigma_d squared + d squared x sigma_L squared), where z comes from the service level you want. If you would rather not do it by hand, the free safety stock calculator runs it, and the reorder point calculator adds it to your lead-time demand. The rest of this guide shows where each formula comes from and why the three common ones give such different answers.
Key points
On one example product the three formulas give 66, 13 and 24 units. Formula 3 is the default; the max method is a ceiling.
Every input comes from 8 to 12 weeks of sales and your last 6 to 10 deliveries, using STDEV.S.
Promotions, spikes and new products break the textbook assumptions, so adjust the inputs, not just the output.
What is safety stock, and what do the symbols mean?
Safety stock is the stock you hold above your expected demand during the lead time, so a delay or a busy week does not cause a stockout. Your reorder point is lead-time demand plus safety stock. These are the symbols used below.
d: average daily sales, in units.
sigma_d (standard deviation of daily sales): how much a typical day differs from the average.
L: average lead time, in days, from placing the order to having it ready to sell.
sigma_L: standard deviation of lead time, in days: how far deliveries typically stray from the average.
z: how many standard deviations of cover you buy, set by the service level.
The service level here is the chance of not stocking out during one reorder cycle. It is not “95% of units shipped on time”. Use this table, which matches a standard normal distribution.
90% service level: z = 1.28
95%: z = 1.65
97.5%: z = 1.96
99%: z = 2.33
Going from 95% to 99% raises the buffer by 41% (2.33 / 1.65 = 1.41).
What are the three common safety stock formulas?
They differ in how much variability they account for. All three use the same example product, which is an illustration: d = 6 units a day, sigma_d = 2.5, L = 10 days, sigma_L = 2 days, 95% service level (z = 1.645).
1. Max-based: the quick version
Safety stock = (maximum daily sales x maximum lead time) - (average daily sales x average lead time). Say your best day recently was 9 units and your slowest delivery was 14 days. That is 9 x 14 - 6 x 10 = 126 - 60 = 66 units. Shopify’s guide lists it as the basic method. The catch: it assumes the best day and the slowest delivery happen together, every cycle, and it grows whenever your data catches a new extreme.
2. Demand variability only
Safety stock = z x sigma_d x square root of L. Here: 1.645 x 2.5 x square root of 10 = 1.645 x 2.5 x 3.162 = 13 units. Use this when lead time is fixed or you hold the supplier to a firm date, for example stock made locally or already in a warehouse near you. It assumes deliveries arrive exactly on time, and overseas deliveries often do not.
3. Demand and lead-time variability
Safety stock = z x square root of (L x sigma_d squared + d squared x sigma_L squared). Step by step with the example:
Demand term: L x sigma_d squared = 10 x 2.5 x 2.5 = 62.5
Lead-time term: d squared x sigma_L squared = 6 x 6 x 2 x 2 = 144
Sum = 206.5, and its square root = 14.37
Safety stock = 1.645 x 14.37 = 23.6, so 24 units
Reorder point = d x L + safety stock = 6 x 10 + 24 = 84 units
The lead-time term (144) is more than double the demand term (62.5). That is the point: here a supplier that varies by two days matters more than customers who vary by 2.5 units a day. This is the formula on Wikipedia’s safety stock page; setting sigma_L to zero collapses it to formula 2.

Why do the formulas disagree, and which should a small store use?
Use formula 3 at a 95% service level, then check it against the max-based number. Each formula answers a different question, and here they differ by a factor of five.
Formula 2 under-protects when suppliers are late. If the delivery takes 14 days (4 days late), demand is 14 x 6 = 84 units. A reorder point of 73 leaves you 11 units short, about 1.8 days out of stock. A reorder point of 84 gets you to zero on the day the truck arrives.
The max method is extreme, not wrong. Treating 66 units as a normal-curve buffer means about 4.6 standard deviations (66 / 14.37), far past any row of the z table. It will almost never stock out, and it ties up cash to get that.
Formula 3 is a bounded risk. At 95%, you accept a stockout in roughly 1 reorder cycle in 20, and you decide whether that is acceptable per product.
The honest limit: with 8 to 12 data points, sigma_d and sigma_L are rough estimates. Treat the max-based figure as a ceiling and formula 3 as the starting point.
Sources do not agree on one formula. The Wikipedia page gives the combined version above and warns that no universal formula exists. Shopify’s page lists the max-based method, then two lead-time-only variants attributed to Heizer and Render (z x sigma of lead time) and to Greasley (that, multiplied by average demand). On the example, the Greasley form gives 1.645 x 2 x 6 = about 20 units: close to formula 3 here only because the lead-time term dominates. Pick based on what actually varies for you.
How do I estimate sigma from 8 to 12 weeks of data?
Put weekly units in one column and your delivery times in another, then use STDEV.S, which is the sample standard deviation. Assume weekly units in B2:B13 and lead times in days in D2:D9.
Average daily sales d: =AVERAGE(B2:B13)/7
Daily sigma_d: =STDEV.S(B2:B13)/SQRT(7)
Average lead time L: =AVERAGE(D2:D9)
Lead-time sigma_L: =STDEV.S(D2:D9)
z for 95%: =NORM.S.INV(0.95)
Safety stock: =z*SQRT(L*sigma_d^2+d^2*sigma_L^2)
Dividing by the square root of 7 assumes days are independent, a simplification. STDEV.S on a daily column also works, though weekday patterns inflate it slightly.
Example data (made up for illustration): 12 weekly totals of 38, 41, 29, 44, 52, 36, 40, 63, 35, 39, 42, 31 units, and 8 deliveries of 9, 10, 12, 8, 11, 10, 13, 9 days. The sheet gives d = 5.83 a day, sigma_d = 3.48, L = 10.25 days, sigma_L = 1.67. Safety stock = 1.645 x square root of (10.25 x 3.48 squared + 5.83 squared x 1.67 squared) = 24.3 units, reorder point 5.83 x 10.25 + 24.3 = 84.
The 63-unit week (week 8) looks like a promotion. Drop it and sigma_d falls to 2.38 and safety stock to 19.7. If you plan promotions separately (see the AI inventory guide), exclude them from sigma and add promo stock on top. If spikes are routine, leave them in.
Why do the textbook assumptions break for a small store?
The formulas assume demand is independent, identical and bell-shaped, and supply is steady. Wikipedia notes that seasonal or trending demand violates this, and that a normal curve overstates safety stock when demand varies a lot relative to its average, because sales cannot go below zero.
For a small store that shows up in four ways.
Promotions and ad spikes. Sales jump because you made them jump. Model them as a separate planned uplift, not as randomness.
Trend and season. A product growing 10% a month has a rising mean, so last quarter’s sigma is stale. Recompute monthly.
Correlation. The combined formula treats demand and lead time as independent. A late shipment that lands just as a campaign starts is worse than that maths suggests; if you see this pattern, add the demand-only and lead-time buffers (13 + 20 in the example) instead of combining them. That is a judgment call, not a textbook rule.
Stale inputs. One commenter in an r/SupplyChainLogistics thread described companies calculating safety stock to three decimal places while the lead times in the system had not been updated in two years. The maths matters, they said, but the inputs matter more.
What if the product is new, or sells in lumps?
Use a rule you can defend and review weekly. For a new product with under four weeks of history, borrow the daily sales and variability of the most similar product you sell, or choose a fixed number of days of cover and recompute as weeks of real sales arrive. For lumpy items (many zero-sale days, then bursts), work in weekly buckets and compare formula 3 with the max-based number. For a product that sells about 1 unit a week, a simple “hold at least N units” rule is honest.
In the same thread, one reply described a hybrid: a formula sets the baseline and planners override it for new products and unreliable suppliers. Another, a supermarket, uses fixed days of cover.
How do fixed and variable lead times change the answer?
A fixed lead time sets sigma_L to zero and shrinks the buffer a lot, so be sure it really is fixed. In the example, going from sigma_L = 2 to 0 cuts safety stock from 24 to 13 units, the whole difference between formula 3 and formula 2.
Do not use safety stock to hide a lead time that moved on purpose. In an r/supplychain thread a planner had added a week of safety stock to cover a longer delivery time. Most replies said to fix the lead-time setting instead, because safety stock is for variation, and a predictable change belongs in L. If a supplier now takes 14 days, set L to 14. Tracking this per supplier is what the supplier scorecard template is for, and shipping stops before Chinese New Year are covered in the 2027 order deadline guide.
How do I turn safety stock into days of cover and cash?
Divide by daily sales for days, and multiply by unit cost for cash. In the example, 24 units / 6 a day = 4 days of cover. At an example landed cost of $8 a unit, that is 24 x $8 = $192 of stock sitting as a buffer. The max-based 66 units would be 66 x $8 = $528, a gap of $336 on one product.
If safety stock sits on top of a minimum order quantity the two stack; see the MOQ and order quantity guide, and use landed cost, not the supplier’s unit price.
Copy-paste prompt for your own numbers
Paste this into any AI chat with your data, and check the answer against the spreadsheet formulas above.
You are an inventory analyst. I will paste (1) 12 weeks of weekly unit sales for one product as a CSV with columns week,units, and (2) my last supplier lead times in days as a list.
Compute: average daily sales d = mean(units)/7; daily sigma_d = sample standard deviation of weekly units / sqrt(7); average lead time L; sample standard deviation of lead time sigma_L.
Then compute safety stock with z for 95% (1.645) using z x sqrt(L x sigma_d^2 + d^2 x sigma_L^2), and the reorder point d x L + safety stock. Also compute the max-based safety stock (max daily sales x max lead time - d x L), assuming max daily sales = the best week divided by 7 rounded up.
Show every input, every intermediate number and the arithmetic, round safety stock up to a whole unit, and tell me in two sentences which weeks look like promotions and whether removing them changes the answer. Do not invent data. If something is missing, ask me for it.
Where does Tenpo fit?
Tenpo is our product, so weigh this accordingly. Otto, our operations assistant, reads stock cover per product, purchase orders and supplier delivery promises, and drafts reorders and supplier follow-ups that wait for your approval. It does not replace choosing a service level and checking sigma by hand as above. Do that once per product, then let the calculator or a sheet recompute it. You can try Tenpo or see the plans: $79 a month for one store, $199 a month for up to three.
Related
Sources
Safety stock, Wikipedia: combined formula, symbols, assumptions, warnings.
Safety stock formulas, Shopify: max-based method and two lead-time variants.
r/SupplyChainLogistics thread and r/supplychain thread: practitioner replies, one person’s experience each.
All worked numbers recomputed in python with a standard normal inverse CDF (z values 1.282, 1.645, 1.960, 2.326).









