Safety stock formula: how to calculate safety stock for an online shop
By Andrew Simpson, founder of Canopy Inventory. Last updated .
Quick answer
Safety stock is extra stock you hold in case sales run faster than expected or a delivery arrives late. The simplest safety stock calculation is in days: safety stock (units) = average daily sales × safety stock days. Other methods are a fixed number of units, the max-minus-average formula, and the statistical formula: safety stock = Z × standard deviation of daily sales × √lead time in days. Safety stock is added to your reorder point and to the order size, so you reorder earlier and hold a buffer.
What safety stock is for
Your reorder plan assumes a sales rate and a lead time. Real sales vary from week to week, and deliveries can be late. Safety stock is the buffer that covers the gap, so a busy week or a late shipment does not become a stockout. The trade-off is cash: every unit of safety stock is stock you have paid for and are holding.
Safety stock feeds the reorder point formula: reorder point = daily sales × lead time days + safety stock.
Safety stock formulas
- Days-based: safety stock (units) = average daily sales × safety stock days. The buffer grows and shrinks with the sales rate.
- Fixed units: safety stock = a set number of units you choose for each product, for example one carton. Simple, but it goes out of date when sales change.
- Max minus average: safety stock = (maximum daily sales × maximum lead time) − (average daily sales × average lead time). Uses your worst recent day and your slowest recent delivery, so it can be large.
- Statistical: safety stock = Z × σd × √L, where Z is the service factor for the share of order cycles you want to get through without running out, σd is the standard deviation of daily sales and L is the lead time in days. For example, Z is about 1.65 for 95% and about 2.33 for 99%. If lead time also varies: safety stock = Z × √(L × σd² + d² × σL²), where d is average daily sales and σL is the standard deviation of lead time in days.
Worked example: the same product, four answers
Example (round made-up numbers). A product sells an average of 10 units a day. Its busiest recent day was 16 units. Lead time averages 30 days, and the slowest recent delivery took 40 days. The standard deviation of daily sales is 4 units.
Days-based, with 7 safety days: 10 × 7 = 70 units.
Fixed units: one carton of 48 = 48 units.
Max minus average: (16 × 40) − (10 × 30) = 640 − 300 = 340 units.
Statistical, aiming for 95% (Z = 1.65) with a fixed lead time: 1.65 × 4 × √30 = 1.65 × 4 × 5.48 ≈ 36 units.
The reorder point with 7 safety days is 10 × 30 + 70 = 370 units. Same product, answers from 36 to 340 units. The method you choose matters more than the decimal places.
Which safety stock method should you use?
- Days-based is the easiest to keep up to date across a whole catalogue, because it scales with each product's sales rate. You choose the days from experience, for example how late your supplier's deliveries have been.
- Fixed units suits a handful of products with steady sales, but needs revisiting whenever sales change.
- Max minus average is easy to explain and covers the worst case you have seen, but it often holds more stock than you need.
- Statistical is the textbook method. It assumes daily sales roughly follow a normal distribution and that each day is independent. For products that sell a few units a day, or sell in bursts after promotions, that assumption is weak and the answer can be too low. It also needs daily sales history for every variant.
How to calculate safety stock with Shopify data
- Get the average daily sales for each variant from the Inventory sold daily by product report, choosing the period you want, for example the last 30 or 90 days.
- For the days-based method, multiply that average by your safety stock days. Shopify's standard inventory reports, as listed in its Help Center, do not include a safety stock figure, so this step is done in a spreadsheet.
- For the statistical method you also need units sold per day for each variant. Export your orders or a sales report broken down by day, then use =STDEV.S() on the daily units in Google Sheets or Excel to get σd.
- Add safety stock to the units you sell during the lead time to get your reorder point, and compare it with available stock from Products > Inventory.
How Canopy Inventory does it
Canopy Inventory, a read-only Shopify app coming soon to the Shopify App Store, uses safety stock in days only. You set it from 0 to 180 days; the default is 0. There is no units option and no statistical calculation.
Safety stock days move the reorder-by date earlier (stockout date minus lead time and safety stock days) and are added to the suggested buy quantity (enough for lead time, target cover and safety stock days, minus stock and units already on order). They do not change the stockout date. On the Free plan the setting is shop-wide; on Growth and Pro you can also set it per supplier and per SKU. See how Canopy calculates.
Set safety stock in days and see reorder-by dates for every SKU
Canopy Inventory shows how many weeks of stock each SKU has left, when it runs out and what to reorder. Read-only. Free for your 50 most recently sold SKUs.
Sources
- Shopify Help Center, inventory reports (Inventory remaining per product, Inventory sold daily by product, Products by sell-through rate, Month-end inventory value): help.shopify.com/en/manual/reports-and-analytics/shopify-reports/report-types/default-reports/inventory-reports
- Shopify Help Center, exporting inventory with a CSV file: help.shopify.com/en/manual/products/inventory/setup/inventory-csv
- How Canopy Inventory calculates each figure: How Canopy calculates
Last updated 6th November 2026: rewritten to compare the days-based, fixed, max-minus-average and statistical methods on one worked example. Unsourced figures removed.
Frequently Asked Questions
The simplest is safety stock = average daily sales × safety stock days. The statistical formula is safety stock = Z × standard deviation of daily sales × √lead time in days, where Z is about 1.65 for a 95% target.
For the days method, multiply the average daily sales cell by the safety days cell. For the statistical method, use =1.65*STDEV.S(daily sales range)*SQRT(lead time days).
Safety stock is the buffer. The reorder point is the stock level at which you reorder: units sold during the lead time plus safety stock.
There is no single right number. Start from how late your supplier's deliveries have actually been and how much a stockout of that product would cost, and hold more days for best sellers with unreliable supply.
Shopify's standard inventory reports, as listed in its Help Center, do not include a safety stock figure. You can get average daily sales from the Inventory sold daily by product report and work out safety stock in a spreadsheet.
No. Canopy Inventory uses safety stock in days only, from 0 to 180 days, with a default of 0.
Related pages
Related Articles

Reorder Point Formula: How to Calculate When to Reorder Stock
Reorder point = daily sales x lead time + safety stock. Worked examples in units and days, how to know when to reorder, and how to set it up from Shopify.

Lead Time: Meaning, How to Calculate It and How It Sets Your Reorder Date
Lead time is the time from ordering to stock ready to sell. What it includes, how to calculate it from your purchase orders, and how it sets your reorder date.

Why Shopify Brands Run Out of Stock (and What It Costs)
Why best sellers run out, how to work out the stockout date and what a stockout costs, and how to spot stockout risk in Shopify. With a worked example.
Get the Canopy Inventory install link
Canopy Inventory is coming soon to the Shopify App Store. One email the day it's live. Free for your 50 most recently sold SKUs.