Economic Order Quantity Formula
What Is the EOQ Formula?
The EOQ formula calculates the order quantity Q* at which total annual inventory cost reaches its minimum. Total annual cost has two components: annual ordering cost, which equals (D ÷ Q) × S and falls as Q rises; and annual holding cost, which equals (Q ÷ 2) × H and rises as Q rises. The formula finds the exact quantity where these two costs cross and their sum is lowest.
At the EOQ quantity, annual ordering cost and annual holding cost are always exactly equal to each other. This is not a coincidence — it is the mathematical condition for the minimum. If you calculate both costs for any EOQ result and they match, your arithmetic is correct.
EOQ Formula Variables Explained
| Symbol | Name | Unit | How to measure it | Common errors |
|---|---|---|---|---|
| D | Annual demand | units / year | Sum of units sold or consumed over the past 12 months; adjust for known trend or seasonality before applying | Using a single busy month multiplied by 12; forgetting to annualize weekly or monthly figures with the right divisor |
| S | Ordering cost | $ / order | Labor to create and process the purchase order + supplier setup fees + inbound freight per order ÷ units in order (where freight is order-fixed, not per-unit) | Omitting internal processing labor; confusing per-unit freight (a holding cost component) with per-order freight (an ordering cost) |
| H | Holding cost per unit per year | $ / unit / year | Unit purchase price × holding rate. The holding rate is typically 20–30% per year and covers: capital opportunity cost (~10–15%), storage space (~5–8%), insurance and shrinkage (~1–2%), and obsolescence risk (~2–5%) | Using only the warehouse rent line and ignoring capital cost — this understates H by 50% or more, which inflates EOQ and leads to chronic over-ordering |
EOQ Formula Derivation
The formula is derived by minimizing the total annual cost function with respect to Q.
TC(Q) = (D / Q) × S + (Q / 2) × HThe first term is annual ordering cost (number of orders × cost per order). The second is annual holding cost (average inventory × holding rate).
dTC/dQ = −DS/Q² + H/2 = 0
DS/Q² = H/2 → Q² = 2DS/H → Q* = √(2DS/H)
d²TC/dQ² = 2DS/Q³ > 0 for all positive Q. ✓ The critical point is a minimum, not a maximum.
EOQ Calculation: Step-by-Step Example
A warehouse stocks a fastener with these annual inputs: D = 12,000 units, S = $50 per order, H = $3 per unit per year.
Enter D, S, and H — the calculator returns EOQ, orders per year, and the full cost curve instantly.
EOQ Formula Assumptions
D is stable and known in advance. The formula breaks down for highly seasonal or lumpy demand — use a demand-weighted average or switch to a dynamic lot-sizing method (Periodic Order Quantity, Wagner-Whitin) when demand varies by more than ±25% across periods.
S is the same regardless of order size. If the supplier offers tiered setup fees or freight rates that change with volume, S is not fixed and the standard EOQ understates or overstates the optimal quantity.
H does not change as inventory level changes. In practice, storage rates can step up when a second warehouse rack or extra temperature zone is needed; treat EOQ as approximate in those situations.
The entire order arrives at once when inventory reaches zero. When replenishment takes time (non-zero lead time), the formula itself still holds — but you need to add a separate reorder point calculation to know when to place the order.
Unit purchase price is constant across all order sizes, and no cost is assigned to running out of stock. When either condition fails, use an extended variant (see below).
EOQ Formula Variants
The standard formula assumes the five conditions above. When they do not hold, use the appropriate variant.
Related Tools and Guides
Frequently Asked Questions
What unit should I use for annual demand in the EOQ formula?
Use the same unit you use to count inventory items — units, cases, pallets, or kilograms. The only rule is consistency: D, EOQ, and all related quantities must use the same counting unit. If you track demand in cases, H must be the holding cost per case per year, not per individual item inside the case.
How do I find holding cost per unit per year?
Estimate holding cost as 20–30% of unit value per year for most products. The rate covers four components: capital opportunity cost (money tied up in inventory), storage space, insurance and shrinkage, and obsolescence or deterioration. Multiply the rate by the unit purchase cost to get H in $/unit/year. For example, a $10 item with a 25% holding rate has H = $2.50/unit/year.
What is the total annual inventory cost at EOQ?
Total annual cost at EOQ = (D ÷ EOQ) × S + (EOQ ÷ 2) × H. Because ordering cost equals holding cost at EOQ, you can simplify: total cost = 2 × (EOQ ÷ 2) × H = EOQ × H. For the worked example (EOQ = 632, H = $3): 632 × $3 = $1,896 ≈ $1,897 (rounding). This shortcut lets you verify total cost without computing both terms separately.
Why does the EOQ formula use a square root?
The square root appears because EOQ minimizes a total cost function that is the sum of a decreasing hyperbola (ordering cost) and an increasing line (holding cost). Setting the first derivative of their sum to zero and solving for Q produces a Q² term, so taking the square root of both sides yields Q* = √(2DS/H). The square root also explains why EOQ changes slowly relative to its inputs: a 4× increase in demand only doubles EOQ.
What happens if I order more or less than EOQ?
Total cost rises in both directions but the penalty is asymmetric. Ordering 50% more than EOQ raises total annual cost by about 8.3%. Ordering 50% less raises it by about 16.7% — twice as much for the same percentage deviation. This means the cost curve is flatter above EOQ than below it, so rounding an EOQ result up to the nearest pallet or case quantity carries less cost risk than rounding down.
