Demand forecasting is the practice of estimating future customer demand for each product, location and time period, using historical sales, known events and external signals. In e-commerce inventory management, the forecast is the starting input for purchasing, safety stock and replenishment decisions: it determines how many units to order, when to order them and where to hold them.
A forecast is never exact. Its value lies in being less wrong than the alternatives and in quantifying uncertainty, so that a merchant can balance the cost of a stockout against the cost of excess and dead stock.
How demand forecasting works
A demand forecast decomposes past sales into underlying patterns and projects them forward. The main components are level (the current baseline rate of sales), trend (sustained growth or decline), seasonality (recurring patterns by week or year) and irregular effects such as promotions or outages.
An important subtlety is that recorded sales are not the same as demand. When an item is out of stock, sales drop to zero even though customers still want it. Good practice is to correct for censored demand by excluding or adjusting stockout periods, otherwise the model learns that demand is lower than it really is and perpetuates the shortage.
The table below summarizes the inputs most often used in online retail forecasting and what each one contributes.
| Input | Example | What it explains |
|---|---|---|
| Sales history | Daily units per SKU over two years | Baseline level, trend and seasonality |
| Promotion calendar | Planned 20% discount week | Short-term uplift and post-promotion dip |
| Price changes | Permanent price reduction | Shift in baseline through price elasticity |
| Traffic and conversion | Product page views | Early signal of rising interest |
| Holidays and events | Black Friday, school start | Recurring peaks outside normal seasonality |
| Stock availability | Days out of stock | Correction for lost, unrecorded demand |
Forecasting methods and when they fit
Forecasting methods range from simple statistical rules to machine learning models trained across thousands of products. The right method depends on data volume, how regular the demand is and how much explanatory data is available, not on sophistication alone.
| Method | How it works | Best suited to |
|---|---|---|
| Moving average | Averages the last n periods | Stable items with little trend |
| Exponential smoothing | Weights recent periods more heavily, with optional trend and season terms | Established SKUs with clear seasonality |
| ARIMA models | Models autocorrelation in the time series | Long, regular histories |
| Croston method | Forecasts demand size and interval separately | Intermittent, slow-moving items |
| Machine learning | Gradient boosting or neural networks with many features | Large catalogs with rich promotional data |
| Judgmental adjustment | Planner overrides based on market knowledge | New launches and one-off events |
New products have no history at all. Forecasters handle them with analogous products (a similar item launched earlier), category-level curves or pre-order signals. Long-tail items that sell a few units a month are better handled by intermittent-demand methods than by standard models, which tend to forecast a misleading fractional unit every day.
Measuring forecast accuracy
Forecast accuracy is measured by comparing predictions with actual demand after the fact, and the choice of metric changes conclusions. No single metric is sufficient, so mature teams track accuracy together with bias, which shows whether forecasts are systematically too high or too low.
| Metric | What it measures | Main limitation |
|---|---|---|
| MAPE | Average absolute error as a percentage of actuals | Undefined or extreme when actuals are near zero |
| WAPE | Total absolute error divided by total actual volume | Hides poor accuracy on small items |
| Bias | Average signed error | Positive and negative errors can cancel out |
| MASE | Error relative to a naive forecast | Less intuitive for business users |
Accuracy also depends on the level of aggregation. A forecast for a whole category for a month is usually far more accurate than one for a single size and color for a single day. Typical SKU-level weekly errors in online retail range widely, from roughly 20% to over 50% WAPE, depending on catalog volatility, so targets should be set against a naive baseline rather than an abstract ideal.
From forecast to inventory decisions
A forecast becomes useful only when it drives replenishment parameters. The expected demand during supplier lead time sets the core of the reorder point, while the spread of forecast errors sets the safety stock needed to reach a chosen service level.
The following table shows how forecast outputs connect to neighboring inventory concepts.
| Inventory decision | Forecast input used | Effect of a poor forecast |
|---|---|---|
| Reorder point | Expected demand during lead time | Orders placed too late or too early |
| Safety stock | Forecast error variability | Too little buffer or tied-up capital |
| Purchase quantity | Demand over the coverage period | Overbuying or frequent small orders |
| Warehouse allocation | Demand by region | Split shipments and slower delivery |
| Inventory turnover target | Annual demand per SKU | Unrealistic turnover goals |
Because purchasing commits money long before sales occur, probabilistic forecasts that give a range, such as the 50th and 90th percentile of demand, are more valuable than a single number. They let planners choose explicitly how much risk of stockout to accept for each product class.
Limitations and common mistakes
Demand forecasting fails most often through process and data problems, not through the choice of algorithm. Frequent mistakes include:
- Training on sales instead of demand, which ignores lost sales during stockouts.
- Ignoring promotions and price changes, so one-off spikes are mistaken for a new baseline.
- Overriding statistical forecasts without tracking the result, which often adds bias rather than insight.
- Forecasting at the wrong granularity, for example daily per size when purchasing is monthly per style.
- Treating the forecast as a target, which mixes sales ambitions with neutral estimates.
External shocks such as supply disruptions, viral social media attention or sudden competitor price cuts remain fundamentally hard to predict. In these cases, short review cycles and fast replanning matter more than a better model.
Understanding it simply
Demand forecasting is an educated guess about how much customers will buy in the coming weeks or months. A shop looks at what sold before, notes what is coming up, such as holidays or sales, and estimates how many of each product it will need.
It works much like planning food for a party. Knowing how many guests came last year and whether more are invited this time helps buy the right amount. Buy too little and people go hungry; buy too much and food goes to waste. The goal is not perfection but fewer costly surprises.
Applied in practice
An online store selling outdoor equipment carries about 4,000 SKUs and buys from suppliers with lead times of six to ten weeks. Before each autumn season, the planning team generates weekly forecasts per SKU using exponential smoothing with yearly seasonality, adjusted for a planned discount campaign in October and corrected for weeks when items were out of stock last year.
For rain jackets, the forecast shows demand rising roughly threefold from August to October. The team uses the 90th percentile of the forecast for its best sellers and the median for slow movers, which sets safety stock accordingly. At the end of the season, stockouts on top sellers fall noticeably compared with the previous year, while leftover stock stays within the clearance budget, freeing cash for the winter range.