How to use the Safety Stock Formula: A Guide to Avoid Stockouts


Connect With a Fulfillment Expert Today.

Get Started

Subscribe to our blog

Join tens of thousands of ecommerce brands to get more articles like this and our latest resources delivered to your inbox.

“Change is the only constant in life.”

This is especially true in business.

No matter how well you forecast and plan, there will always be ebbs and flows. For ecommerce businesses, unexpected jumps in buying patterns and last-minute problems with suppliers can leave you high and dry, and out of stock.

Avoiding an out-of-stock situation is critical for direct-to-consumer brands. Not only do you lose sales when you run out of a SKU, but you may also lose customers for good. Very few people have the patience to come back to a business that doesn’t have what they need when they need it and may start shopping elsewhere.

So, how can you plan ahead and have systems in place to accommodate unexpected changes in supply and demand? Fortunately, there’s a simple safety stock formula to help you order enough product to avoid out-of-stock issues, secure inventory replenishment, and normal distribution.

What is safety stock?

Safety stock is the excess product you keep on hand in case of an emergency or supply chain failure that causes less than average inventory to be available.

Typically, businesses do their best to predict future sales and then manage inventoryand inventory costs according to that prediction. If sales were always constant and the lead time on orders never an issue, this would be a very simple process. But not everything in business is predictable, and there can be delays in the retail supply chain.

Safety stock is a way to keep a cushion in your inventory levels to make sure you don’t run out of items if your inventory forecast isn’t perfect. The amount of safety stock you need is based on a simple formula.

How to calculate safety stock

If crunching numbers isn’t in your strong suit, don’t worry! The formula for how to calculate the amount of safety stock you need is actually quite simple whether you use software or an inventory sheet template.

Here’s how to calculate safety stock equation for your ecommerce store:

1. Find the following for each SKU:

  • Maximum daily usage
  • Maximum lead time
  • Average daily usage
  • Average lead time

Keep in mind that if you order new products once a week, you can calculate safety stock using maximum and average weekly usage instead of daily (or whatever your timeframe is for ordering), as your guideline.

Average daily usage and average lead time are just that — an average. Look at your sales and lead time for the recent periods and use the average number to estimate what to expect.

For instance, if you sell 100 units on an average day (based on historical sales) and it takes you 5 days to replace that stock from your supplier, 100 and 5 are the respective averages or numbers that you need to plug into the formula.

Maximum daily usage and maximum lead time are reflected by the highest sales your historical records show and the longest lead time you can expect or have experienced. Be sure to account for delays for holidays like Chinese New Year if your supplier is in parts of Asia that observe it.

If your average is 100 units daily, but you’ve sold up to 150 units in a day, you would use 150 as your maximum daily usage in the calculation.

Similarly, if it has taken as long as 10 days to restock inventory (even though the average is 5 days), 10 would be the maximum lead time for your calculation.

2. Calculate your max (maximum daily usage x maximum lead time)

Next you’ll multiply the maximum daily usage by the maximum lead time.

Again, this is your worst case scenario. What would happen if you sell as many units as your historical maximum and you experience the longest possible lead time from your supplier? This number will help you create a big enough cushion of extra stock.

3. Calculate your average (average daily usage x average lead time)

Now multiply the average daily usage by the average lead time. This is the number you would likely order on a typical purchase order since it’s what you need to replenish stock with average customer demand.

4. Subtract the two

Finally, subtract the average number from the maximum number for a complete safety stock calculation like this:

(Maximum daily usage x Maximum lead time) – (Average daily usage x Average lead time)

The difference will show you the safety stock level you need in order to be prepared for an extreme scenario. Note: It’s possible that it won’t be enough buffer stock to cover an extreme surge in sales, but it will be enough to prevent stockouts most of the time.

Why safety stock is so important for ecommerce

Safety stock is critical for all businesses, but especially ecommerce. Remember those customers who will go elsewhere if you’re out of stock? Online shoppers are used to getting products quickly and easily. They can also jump to a competitor’s website faster than if they were window shopping at brick and mortar shops.

1. Minimize stockouts

Preventing stockouts is the biggest benefit of calculating safety stock. Every time you hit a cap on how much stock you have available, that represents the additional sales you weren’t able to make. Safety stock helps you maximize your revenue.

2. Leverage your warehouse

The right amount of safety stock makes the best use of your inventory storage system and capital. You could always avoid stockouts by ordering huge amounts of product, but that would clog up your storage space, increase your inventory carrying costs, and tie up money you could be spending more strategically, elsewhere.

If you use multiple warehousing locations to store inventory, optimize levels of stock based on the expected demand per location.

3. Forecast demand

The same method used to calculate safety stock can also help you predict other aspects of your business. For example, demand forecasting (or predicting demand for your products) can help you plan for shipping and customer service level needs, so you have enough help on hand to ensure your service levels don’t suffer.

You can also anticipate surges in sales during different times of the year and plan accordingly.

4. Keep up with the seasons

Maximum daily usage represents the highest sales volume of product you have sold during a period of time. It could be the most you’ve sold during a specific season, or even on a specific day (like a holiday). Recognizing these trends will help you be prepared with extra stock when you need it.

For example, if you know that every Cyber Monday you double your online sales, you can effectively calculate how much safety stock you should have on hand for upcoming holiday inventory prep. That way, you won’t risk losing out on sales on one of the hottest buying days of the year.

[Related: A Tale of 4 Direct-to-Consumer Brands: Comparing Seasonal, High-Growth, Unplanned, and Gradual Sales]

How 3PLs implement the safety stock formula to maintain optimal stock

This safety stock calculation is a very simple formula, and you must also track and calculate for changing conditions. Your business won’t always run like clockwork, and it can be difficult to stay on top of your numbers.

“Off the bat, I liked that I would be able to control multiple warehouses through one page with ShipBob. With my old 3PL, I could never just open a page and get the info I wanted. I had to click several times, then export it, and try to make sense of it.

ShipBob lets you manage your inventory while providing important data in a very digestible way.”

Wes Brown, Head of Operations at Black Claw LLC

Luckily, there’s a way to calculate and manage your safety stock automatically. A third-party logistics (3PL) provider, like ShipBob, can provide you with real-time tracking of stock levels and formulas to set reorder points and safety stock.

Using historical sales data, we can help you calculate your ideal reorder quantity and how much safety stock you need to avoid stockouts, while storing your inventory and fulfilling your orders.


The success of your ecommerce business depends on getting your products into your customers’ hands quickly and easily. You want to maximize sales, deliver orders on time, and provide an experience that drives customers to leave you glowing reviews.

By having the proper amount of safety stock on hand, you can avoid catastrophic out-of-stock issues, ensuring that your customers get what they need when they need it.

“So many 3PLs have either bad or no front-facing software, making it impossible to keep track of what’s leaving or entering the warehouse.

On the supply chain side, I just throw in what we placed at the factory into a WRO in the ShipBob dashboard, and I can see how many units we have on-hand, what’s incoming, what’s at docks, and so on. I can see all of those numbers in a few seconds, and it makes life so much easier.”

Harley Abrams, Operations Manager of SuperSpeed Golf, LLC

Ready to take the guessing and manual calculations out of your ordering? Get a free quote from ShipBob for real-time inventory management, the tools to forecast demand and automatically calculate reorder points for each SKU, and the best ecommerce fulfillment services.    

Written By:

Kristina is the Director of Marketing Communications at ShipBob, where she writes various articles, case studies, and other resources to help ecommerce brands grow their business.

Read all posts written by Kristina Lopienski