Every retailer and warehouse manager faces the same balancing act: order too little stock and you run out, losing sales and customer trust; order too much and cash sits idle on a shelf, quietly costing money in storage and spoilage. The classical answer is a reorder-point system — a rule that watches stock levels and automatically triggers a purchase order once inventory falls to a threshold calculated from recent demand, its variability, and how long a new order takes to arrive. This simulation runs that exact system day by day: a random daily demand is generated (with an adjustable weekly seasonal cycle), a rolling 30-day forecast of average demand and its standard deviation is recomputed, and a safety-stock buffer sized to your chosen service level is added on top of expected lead-time demand to produce a live reorder point.
Watch the stock-level line drift downward with daily sales, dip below the orange reorder-point line to trigger a purchase order, and climb back up when that order arrives after the configured lead time. Stockout days — when demand outstrips available stock — are highlighted in red. Tune the mean demand, demand variability, seasonal amplitude, lead time, service level and order-sizing method (fixed quantity or a calculated Economic Order Quantity), then watch the live KPIs — fill rate, stockout days, average inventory, holding cost and stockout cost — respond to your choices in real time.
What is a reorder point and how is it calculated?
The reorder point (ROP) is the stock level at which a new purchase order must be triggered so the replacement stock arrives before you run out. ROP = (average daily demand × lead time in days) + safety stock. The first term covers expected demand while you wait for the order to arrive; the safety-stock term covers demand that comes in higher than average during that same window. In this simulation the reorder point is recalculated every day from a rolling 30-day demand forecast, so it rises and falls as demand trends change.
How is safety stock calculated, and why does the service-level z-score matter?
Safety stock = z × σ × √(lead time), where σ is the standard deviation of daily demand (estimated from the trailing 30-day window) and z is the z-score for your chosen service level: about 1.28 for 90%, 1.645 for 95%, and 2.33 for 99%. The z-score converts a target probability of not stocking out into a number of standard deviations of buffer. Raising the service level from 90% to 99% nearly doubles the buffer, because the tail of the normal distribution gets much thinner as you push the probability of a stockout down.
Why do longer lead times need bigger safety-stock buffers?
Safety stock scales with the square root of lead time because demand uncertainty accumulates over every day you are exposed to it: variance adds linearly across independent days, so standard deviation grows with √(time). Doubling the lead time from 5 to 10 days only multiplies the required safety stock by about 1.41×, not 2× — but it also doubles the deterministic demand term (average demand × lead time) in the reorder point, so the total buffer you need to hold grows noticeably even though the uncertainty term grows sub-linearly.
Fill rate is the percentage of total customer demand that was actually met from stock on hand, without a stockout: units sold ÷ units demanded. A 100% fill rate means every customer got what they wanted immediately, but achieving it usually requires carrying very large safety stock, which drives up daily holding cost. Retailers rarely target 100%; they pick a service level (say 95–98%) that balances the cost of occasionally running out against the cost of tying up cash in inventory that sits on a shelf.
Holding cost accrues on every unit sitting in inventory every day (capital tied up, warehouse space, spoilage risk), while stockout cost is incurred only on demand that could not be met (lost sales, expediting fees, damaged customer trust). Increasing the reorder point and safety stock reduces stockout cost but increases holding cost, and vice versa. The total-cost curve in this simulation is typically U-shaped: too little stock and stockout costs dominate, too much stock and holding costs dominate, with a minimum somewhere in between that depends on your specific cost ratios.
EOQ is the order size that minimises the sum of ordering cost (a fixed cost per purchase order, e.g. paperwork, shipping setup) and holding cost, given by EOQ = √(2 × D × S ⁄ H), where D is annual demand, S is the cost per order, and H is the annual holding cost per unit. Ordering in small frequent batches keeps average inventory (and holding cost) low but racks up ordering costs; ordering in large infrequent batches does the opposite. EOQ is most useful when order costs and holding costs are both known and demand is reasonably steady; toggle it on to see the simulator compute an order quantity automatically instead of using a fixed batch size.
A rolling average forecast assumes recent history is representative of the near future. When demand has a weekly (or seasonal) cycle, a plain trailing average blends high-demand and low-demand days together, so it lags behind the true pattern — it under-forecasts just before a demand peak and over-forecasts just after one. In this simulation, turning up the seasonal amplitude widens the gap between the naive rolling forecast and actual demand, which shows up as more frequent stockouts near seasonal peaks even though the long-run average demand hasn't changed. Production forecasting systems handle this with seasonal decomposition rather than a flat moving average.