Economic Order Quantity (EOQ)
The economic order quantity (EOQ) is the order size that minimizes ordering and inventory holding costs when consumption is constant and known in advance. The square-root formula balances frequent small orders against infrequent large ones. It assumes that every unit purchased will eventually be consumed.
EOQ leaves much of the work of purchasing unresolved: estimating whether goods will sell, deciding which products to fund, and weighing an immediate order against waiting. Lokad recommends assessing purchases by their expected economic returns, accounting for uncertainty and competing uses of cash across the supply chain.
Download the Excel examples. The workbook shows the formulas and every quantity tested in the examples below. Its inputs are editable, and it requires no macros.
The classical formula
Ford Whitman Harris introduced the model in 1913; it later became widely known as Wilson’s formula. Consider one product consumed at a constant rate and replenished in identical batches, with no shortages:
| Symbol | Meaning | Example |
|---|---|---|
| \(D\) | Demand per year | 1,200 units |
| \(K\) | Fixed cost per order | $50 |
| \(h\) | Holding cost per unit per year | $6 |
| \(c\) | Purchase price per unit | $25 |
| \(q\) | Units in each order | The quantity to choose |
There are \(D/q\) orders per year. Stock falls evenly from \(q\) to zero between receipts, giving average cycle stock of \(q/2\). Annual cost is therefore:
Annual purchasing cost \(Dc\) is constant: all \(D\) units are bought at the same price and consumed. Minimizing the ordering and holding costs gives:
Here, \(q^*\approx141.4\) units; comparing the neighboring integers gives 141. Ordering and holding cost about $849 per year, on top of $30,000 in purchases. The formula takes demand as an input. It provides no evidence that buying those 1,200 units will be profitable.
Demand and holding cost must use the same time unit. If holding cost is expressed as an annual fraction \(i\) of purchase price, then \(h=ic\). A monthly demand figure combined with an annual holding cost gives the wrong answer.
A known, constant lead time determines when to order through the reorder point. It does not appear in the formula for how much to order. With variable lead times, the arrival date is uncertain too: goods may arrive too late to meet the demand they were bought for.
What the calculation leaves out
EOQ optimizes a batch size to be repeated indefinitely for one product. A buyer must decide which goods to buy now, in what quantities, and when they need to arrive. The model excludes several factors that determine whether that purchase pays:
| Assumption | Consequence for purchasing |
|---|---|
| Demand is known and constant | Seasonality, intermittent demand, and forecast uncertainty cannot change the decision. |
| Every unit will be consumed | Markdown, expiration, and obsolescence losses have no place in the calculation. |
| Supply is reliable | Late arrivals, partial deliveries, and quantity-dependent lead times are omitted. |
| Each item can be treated separately | The calculation ignores shared freight, supplier minimums, substitution, and competition for cash. |
| Costs and opportunities repeat indefinitely | Buying now and waiting for better information cannot be compared properly. |
Adding safety stock leaves the order quantity tied to the same assumptions. Rounding that quantity to satisfy an MOQ or fill a pallet makes the order acceptable to the supplier, but does not establish its profitability.
Which ordering costs remain?
Automation removes much of the clerical work of placing an order. Dispatching a truck, clearing customs, and changing a production setup can still incur costs. Include them whenever the order causes the expense.
Dividing the purchasing department’s annual salary bill by last year’s order count gives an accounting cost per order. It does not measure the saving from placing one fewer order.
Price breaks can hide a better order
Suppose the supplier in the example above charges $23 per unit for orders of at least 400 units, instead of $25. This is an all-units discount: reaching the threshold reduces the price of the whole order. An incremental discount would apply only to units above the threshold and requires a different calculation.
For this example, holding cost stays fixed at $6 per unit per year. Replacing \(c\) with the price applicable to each candidate quantity gives:
| Order size | Ordering + holding | Total annual cost |
|---|---|---|
| 141 | $849 | $30,849 |
| 142 | $849 | $30,849 |
| 400 | $1,350 | $28,950 |
The cost rises slightly from 141 to 142 units, though rounding hides the difference in the table. It then falls sharply at 400. Stopping the search at the first increase would miss the cheaper order. Total cost can have several local minima even when the unit price only decreases.
With prices fixed within each tier, compare the lowest feasible cost in each tier and check its boundaries. A more general cost function requires either evaluating all admissible quantities or a search method suited to that function. The workbook tests every integer quantity from 1 to 1,000.
The 400-unit order has the lowest cost in this model, but buys four months of demand at once. Near the end of a selling season, some of those units may never sell. The discount is only worthwhile if its savings exceed the losses on unsold goods, which EOQ omits.
The mean forecast is not enough
Consider a different product, purchased once for a short season. There is no starting stock and no opportunity to replenish during the season. All goods arrive before sales begin. The selling price is $20; unsold units recover $2 each at the end. An order costs $20 to place, plus $10 per unit—or $9 per unit when at least 120 units are ordered.
Suppose seasonal demand has three possible outcomes:
| Demand | Probability |
|---|---|
| 60 units | 25% |
| 100 units | 50% |
| 140 units | 25% |
Mean demand is 100 units. Profit is sales revenue plus the value recovered from unsold stock, less purchasing and ordering costs. Unfilled demand brings no revenue; the example assigns no additional cost to lost customer goodwill. Three order quantities give:
| Demand | Buy 100 | Buy 120 | Buy 140 |
|---|---|---|---|
| 60 | $260 | $220 | $80 |
| 100 | $980 | $940 | $800 |
| 140 | $980 | $1,300 | $1,520 |
| Expected profit | $800 | $850 | $800 |
If demand were certain to be 100 units, ordering 100 would give the highest profit. Under the distribution above, ordering 120 gives the highest expected profit. Ordering 140 gets the same discount, but the extra sales at high demand do not compensate for the losses at low demand. Both forecasts have a mean of 100; they lead to different purchases.
Ordering 120 rather than 100 requires an extra $80 in purchases for an extra $50 of expected profit. It also earns $40 less if demand is low. A buyer must weigh that return and risk against other purchases the same $80 could fund. The highest expected profit for one product need not give the company the best risk-adjusted rate of return on its cash.
The workbook tests quantities from zero to 200, including the option of not ordering. Three demand outcomes keep the example easy to check. Actual purchasing requires probabilistic forecasts of demand and lead times, rather than a few handpicked scenarios.
Shared costs and delivery dates
A supplier charges $40 per delivery. After purchasing and other costs, but before delivery, product A is expected to earn $70 and product B $25. Ordered alone, A earns $30 and B loses $15. Ordered together, they earn $55. Rejecting B because it loses money on its own would forgo $25 of profit on the joint order.
Splitting the delivery fee equally between A and B would conceal this dependency: remove A, and B must cover the full fee again. The order must be evaluated as a whole. The same applies to supplier-level MOQs, container capacity, and production setups. Checking that a set of independently calculated EOQs meets those constraints says nothing about whether another combination would be more profitable.
The next purchase to consider may be a pack, a mixed pallet, or a complete supplier order. Comparing only individual units can miss a profitable combination. A rule that keeps buying while the next unit looks profitable, then stops, can fail when costs are shared or quantity discounts apply.
An order arriving after the selling season may be worthless, however low its price. A larger order may itself lengthen the supplier’s lead time. Purchasing therefore requires forecasts of lead times as well as demand. Greater uncertainty can favor waiting, buying less, or choosing another supplier; adding stock is not a universal remedy.
How Lokad calculates purchases
Lokad compares the purchases a company can make now with alternatives such as waiting, transferring existing stock, or changing suppliers. It recalculates quantities as stock, outstanding orders, forecasts, and supplier terms change.
For each option, the calculation uses available and incoming stock, the probabilities of future demand and arrival dates, and the resulting sales and costs. The economic drivers include margins, stockout costs, the value of leftover goods, and the cost of using scarce capacity. Accounting allocations must not be mistaken for expenses the decision will cause.
In simple cases, prioritized ordering ranks additional purchases by their economic return. Shared costs and constraints require comparing packs, pallets, and complete orders too. These purchases compete for the company’s cash and capacity. Their ranking must account for risk and how long the resources will be tied up.
Today’s order serves demand until later replenishments take over. Any stock left at that point still has a resale value or incurs disposal and holding costs. Stopping the calculation at an arbitrary month-end and ignoring those leftovers can make overbuying look profitable.
Supply Chain Scientists implement and maintain these calculations in Lokad’s programmatic platform, which generates routine orders unattended. An economically absurd order is grounds for investigating the data, forecasts, costs, or choices represented in the calculation. Correcting the cause improves subsequent orders; repeatedly overriding an EOQ setting leaves the cause untouched. This ongoing work is described in Introduction to Supply Chain, particularly the chapters on economics and decisions, and in the article on holimization.
Using the workbook
The workbook has three examples: classical EOQ, an all-units discount, and uncertain demand. Change the blue input cells to recalculate them; the tables below row 22 show every quantity tested. Use one currency throughout. The same figures work in dollars or euros, with no conversion. Quantities are whole units, and the best quantity reported is the best within the tested range. Input checks flag invalid values.
These are teaching examples, with known probabilities and simplified costs. The price-break example also corrects earlier versions of this page, which recommended stopping the search at the first increase in cost.