How to Calculate Safety Stock for a Shopify Store (2026 Guide)
How to calculate safety stock for your Shopify store: the standard formula, a worked example, and the reorder point step, from Forthcast.
Hylke Reitsma is co-founder of Forthsuite and a supply chain specialist with 8+ years of hands-on experience at Shell, Verisure, and Stryker. He holds an MSc in Supply Chain Management from the University of Groningen and writes practical guides to help e-commerce teams run leaner, faster supply chains. Selected by Replit as 1 of 20 founders for the inaugural Race to Revenue Cohort #1 (2026) and certified as a Replit Platform Builder.
Last Updated: April 2026
Learning how to calculate safety stock is what separates a Shopify store that rides out a demand spike from one that sells out during its best week of the year. Safety stock is the extra inventory you keep on top of expected demand, sized to cover the swings a forecast can never fully predict. Forthcast sets this number for every SKU in your catalog automatically, but understanding the math behind it lets you check whether any figure you are handed makes sense.
Below is the standard safety stock formula, a worked example with real numbers, and the step most guides skip: turning that buffer into a reorder point you can act on inside Shopify.
What safety stock actually protects against
Safety stock answers a single question: how much extra do I hold so that normal variation does not cause a stockout? It guards against two moving parts. The first is demand variability, the gap between an average day and a busy one. The second is lead time variability, the gap between the delivery date a supplier promised and the date the goods actually arrive.
If both your sales and your supplier were perfectly steady, you would need zero safety stock. You would order exactly enough to cover the lead time, and the next shipment would land the day you hit zero. Real stores never work that way. A product that sells 10 units a day might sell 4 on a slow Tuesday and 22 the day a creator posts about it. That spread is the risk safety stock is built to absorb.
It helps to separate the two costs at play. Hold too little buffer and you take the cost of a stockout: lost sales, customers who buy from a competitor, and the slow damage of a product page that says sold out. Hold too much and you take the carrying cost: cash tied up in boxes, storage fees, and the markdown risk if the product ages. Safety stock is the deliberate point you pick between those two costs, which is why a formula beats a guess.
The safety stock formula, explained
The most widely used method is the standard deviation formula, which ties your buffer to a target service level. It reads:
Safety stock = Z × σd × √L
- Z is the service level factor. A 95 percent service level uses a Z of 1.65, 90 percent uses 1.28, and 99 percent uses 2.33.
- σd is the standard deviation of daily demand, a measure of how much your sales bounce around the average.
- L is the lead time in days.
The service level is a business decision, not a math one. A 95 percent service level means you accept being out of stock about 5 percent of the replenishment cycles in exchange for holding less cash in inventory. Slow movers with cheap storage can sit at 98 or 99 percent. Bulky, low-margin items often live closer to 90 percent.
How to calculate safety stock step by step
Here is a worked example for a single SKU. Say you sell a kitchen gadget with these numbers:
- Average daily demand: 20 units
- Standard deviation of daily demand: 6 units
- Lead time: 9 days
- Target service level: 95 percent, so Z = 1.65
Plug those into the formula: Safety stock = 1.65 × 6 × √9 = 1.65 × 6 × 3 = 29.7, which rounds to 30 units. That 30-unit buffer is what you carry above the stock needed to cover average demand during the lead time.
If you do not know your standard deviation, pull at least 8 to 12 weeks of daily sales for the SKU from Shopify, then use the standard deviation function in any spreadsheet. A longer window reflects your real pattern better, though you should split out one-off events like a flash sale so they do not distort the everyday spread.
When the simple formula is not enough
The version above assumes your lead time is fixed and only demand varies. Many Shopify stores face the opposite problem, where the supplier is the unpredictable part. When both demand and lead time swing, the extended formula adds a second term:
Safety stock = Z × √( (L × σd2) + (D̄2 × σL2) )
Here D̄ is average daily demand and σL is the standard deviation of lead time in days. The first term inside the root is the demand risk you already measured, and the second is the lead time risk. If your supplier's delivery time is steady, σL sits near zero and the formula collapses back to the simple version. If it swings widely, that second term can grow larger than the first. This is the math reason a dependable supplier is worth paying a little more for: every day you cut off the spread of lead times lowers the buffer you have to fund for the rest of the year.
Setting your reorder point on Shopify
Safety stock on its own does not tell you when to place an order. For that you need the reorder point, the inventory level that triggers a new purchase order. The formula is short:
Reorder point = (Average daily demand × Lead time) + Safety stock
Using the same SKU: (20 × 9) + 30 = 180 + 30 = 210 units. When on-hand inventory drops to 210, you place the next order. The first 180 units cover expected sales while you wait for the shipment, and the 30-unit buffer covers the days that run hot or the shipment that lands late.
Shopify does not track a reorder point per variant on its own, so most stores record it against each product and watch it next to the inventory column, or hand the job to a forecasting app that alerts them. The aim is to make the trigger a number, not a gut feeling someone checks on a Friday afternoon.
Common mistakes that inflate or starve your buffer
A few errors show up again and again when stores set safety stock by hand.
Using one buffer for every SKU. A flat "two weeks of stock" rule overstocks steady sellers and starves volatile ones. The whole reason to use the standard deviation method is that it sizes each buffer to that product's own behavior.
Ignoring lead time variability. The basic formula treats lead time as fixed. If your supplier swings between 7 and 21 days, you carry a risk the simple version does not capture, and you need the extended formula that adds a lead time variance term.
Letting the numbers go stale. Demand shifts with seasons, marketing, and product age. A buffer you set in January can be wrong by April. Recalculate on a schedule, or use a system that updates the inputs as new sales land.
How Forthcast calculates safety stock for you
Doing this by hand for 5 SKUs is reasonable. Doing it for 500 every few weeks is not, and that gap is where Forthcast fits. It reads your Shopify sales history, measures the demand spread for each variant, factors in the lead time you set per supplier, and produces a safety stock figure and reorder point for every product. When sales patterns move, the numbers move with them, so the buffer reflects how the product sells now rather than how it sold last quarter.
You stay in control of the service level, which is the one input that should reflect your strategy rather than the data. Set it higher for the products you never want to miss, lower for the long tail, and let the forecasting handle the arithmetic underneath.
The payoff of running the math per SKU instead of by feel shows up on two lines of your finances. Stockouts fall because the products with jumpy demand finally carry a buffer that matches their swings, so you stop missing sales on the items most likely to run out. At the same time, total inventory often drops, because the steady sellers that a flat rule overstocked get sized down to what they actually need. Holding the right buffer in the right place, rather than a blanket cushion everywhere, is how stores free up cash without raising their stockout rate.
If you want the safety stock math handled across your whole catalog without a spreadsheet to maintain, start your free 14-day trial of Forthcast at forthcast.io.
About the Author
Hylke Reitsma is co-founder of Forthsuite and a supply chain specialist with 8+ years of hands-on experience at Shell, Verisure, and Stryker. He holds an MSc in Supply Chain Management from the University of Groningen and writes practical guides to help e-commerce teams run leaner, faster supply chains. Selected by Replit as 1 of 20 founders for the inaugural Race to Revenue Cohort #1 (2026) and certified as a Replit Platform Builder.
LinkedIn