Inventory Forecasting 101: The Formula Every Ecommerce Store Needs
If you run an ecommerce store, you've done this math before. Probably on a napkin. Probably wrong.
"How many weeks of stock do I have left?"
The answer is never just "a few weeks." It's always "it depends." Depends on how fast you're selling. Depends on when you last reordered. Depends on whether that one product went viral.
Inventory forecasting exists to answer the "it depends" question with numbers. Specifically, one number: how many days until this product runs out?
Once you know that number, you know when to reorder. And when you know when to reorder, you stop running out.
The Core Formula: Days of Stock
The fundamental calculation in inventory forecasting is called days of stock — sometimes called Days Sales of Inventory (DSI).
Days of Stock Formula
Current inventory = units you have on hand right now
Sales velocity = your average units sold per day
Example
You sell a product with 200 units in stock. Over the last 30 days, you've sold 100 units.
Sales velocity = 100 ÷ 30 = 3.33 units/day
Days of stock = 200 ÷ 3.33 = 60 days
At your current sales rate, that product will run out in 60 days.
Simple. Useful. Here's why most ecommerce stores get into trouble with this formula:
The Two Mistakes That Break the Math
They use the wrong sales velocity. A simple 30-day average works for steady products. For anything with seasonal variation, recent promotions, or trending demand, a flat 30-day average misrepresents reality.
They ignore lead time. Days of stock tells you when you'll run out. It doesn't tell you when to order. To answer "when should I reorder?", you need to add your supplier lead time into the equation.
From Days of Stock to Reorder Point: The Complete Formula
A days-of-stock number is a countdown. The reorder point is the alarm.
Reorder Point Formula
This formula tells you: at what stock level should I place a new order so new inventory arrives before I run out?
Example — Workout protein powder
Current stock: 140 units
Average daily sales (last 30 days): 5 units/day
Supplier lead time: 10 days
Safety stock: 30 units
Reorder Point = (5 × 10) + 30 = 80 units
When stock falls to 80 units, place the order. At 5 units/day, you'll sell through 80 units in 16 days. New stock arrives in 10 days. You have 6 days of buffer remaining when new stock arrives.
Current stock = 140 units
Days of stock = 140 ÷ 5 = 28 days
Reorder trigger = 80 units, which equals 80 ÷ 5 = 16 days from now
You have 16 days to place the order before you're in stockout territory.
How to Calculate Sales Velocity the Right Way
The Wrong Way
- Divide total sales by 365 and call it daily velocity
- Uses outdated annual data
- Ignores recent trends
- Same number for every product
The Right Way
- Use the last 30 days as your baseline
- Check last 7 days as a sanity check
- Weight recent sales more heavily
- Adjust for seasonal variation
For most ecommerce stores, use the last 30 days as your baseline:
Sales Velocity
Sanity Check Your Velocity
Last 30 days: 261 units sold → 8.7 units/day
Last 7 days: 73 units sold → 10.4 units/day
Your product is accelerating. The 30-day average masks the recent uptick. When calculating your reorder point, use 10 units/day — not 8.7. If you use the slower number, you'll reorder too late.
DaysOfStock uses a weighted velocity calculation that weights recent sales more heavily, so the days-of-stock number reflects your current demand, not last quarter's.
Working a Full Example: Safety Stock Calculation
Let's walk a complete inventory forecast for a single SKU.
Full Inventory Forecast: Merino wool base layer (size M)
- Calculate sales velocity. Last 30 days: 58 + 47 + 62 + 55 + 61 + 52 + 48 + 45 = 426 units. Sales velocity = 426 ÷ 30 = 14.2 units/day
- Identify lead time. Supplier confirmed: 7 days for in-stock items, up to 14 days for restocks. Use 14 days — the maximum, not the minimum.
- Calculate safety stock. Safety stock = (Max daily sales × Max lead time) − (Avg daily sales × Avg lead time). Revised calculation: Max daily = 15 units, Safety stock = (15 × 14) − (14.2 × 7) = 210 − 99.4 = 111 units
- Calculate reorder point. ROP = (14.2 × 14) + 111 = 198.8 + 111 = 310 units. When stock falls to 310 units, order.
- Calculate days of supply. Current: 55 units. Days of stock = 55 ÷ 14.2 = 3.9 days. This product is in critical territory — you need to order now.
The Hard Truth This Math Reveals
Most WooCommerce stores are understocked relative to their actual risk, not just overstocked on dead inventory. The reorder point for this product — 310 units — is almost 6× your current stock of 55 units. You didn't know because you weren't doing the math.
The Order Quantity Question
Once you know your reorder point, the next question is how much to order.
Two Common Approaches
Match your lead time supply:
Order enough to last the length of your reorder cycle. If you reorder every 30 days, order 30 days of supply + safety stock.
Order quantity = (Daily sales × cycle length) + safety stock − current stock
For the example product: (14.2 × 30) + 111 − 55 = 482 units
Use supplier minimums as a floor:
Many suppliers have minimum order quantities (MOQs). If your supplier MOQ is 100 units and your calculated order quantity is 60, order 100 — not 60.
Consider cash flow:
Every dollar tied up in inventory is a dollar not available for ad spend, operations, or growth. If you're paying $25/unit and want to keep 35 days of supply, that's $25 × 310 = $7,750 in working capital for one SKU. For a store with 50 SKUs, this adds up fast.
Lead Time: The Variable Most Stores Get Wrong
Lead time is the gap between placing an order and receiving it in your warehouse. It's the variable that most determines your reorder point — and the variable most store owners estimate incorrectly.
Use Your Maximum Lead Time
Typical lead times:
Domestic (US) fulfillment: 3–7 days
Dropship from manufacturer: 7–14 days
Imported from overseas: 21–60 days
Most WooCommerce stores use the optimistic lead time — "usually 7 days" — when their supplier sometimes takes 14. Use your maximum lead time, not your average.
If your supplier says "usually 7 days, sometimes up to 2 weeks," use 14 days in your reorder point calculation. The cost of carrying extra safety stock for a few extra days is lower than the cost of a stockout.
If you don't know your actual lead time, check your last 10 purchase orders. Find the maximum. Use that number.
Automate the Math: DaysOfStock Calculates This for Every Product
The formula is straightforward. Doing it for 50 products, weekly, with accurate sales velocity and lead time data, is not.
DaysOfStock connects directly to your WooCommerce store and:
- Pulls your 90-day sales history automatically
- Calculates days-of-stock for every SKU using weighted sales velocity
- Computes your reorder point based on your actual lead times
- Sends you a daily email when any product crosses its reorder threshold
- Adjusts dynamically as sales velocity changes — no manual updates
You see one number per product: days until stockout. The math is done. You just act on the alert.
Plans start at $22/month. 7-day free trial. No spreadsheets required.
Calculate your days of stock automatically
Try DaysOfStock free for 7 days — no credit card required.
Start Free TrialQuick Reference: Inventory Forecasting Formulas
Key Formulas at a Glance
| Days of Stock (DOS) | Current Inventory ÷ (Units Sold in Last 30 Days ÷ 30) |
|---|---|
| Reorder Point (ROP) | (Average Daily Sales × Lead Time) + Safety Stock |
| Safety Stock | (Maximum Daily Sales × Maximum Lead Time) − (Average Daily Sales × Average Lead Time) |
| Lead Time Demand | Average Daily Sales × Supplier Lead Time |
When to Recalculate
Update Your Forecast When:
- You launch a new product — no history, start with a conservative estimate, update after 30 days
- A product goes on sale or promotion — velocity will spike, recalculate immediately
- You change suppliers — lead time changes
- You notice demand trending up or down — over 2+ weeks of data
- A seasonal period starts or ends — seasonal products need more frequent updates
For steady products with no changes, a monthly review is sufficient.