Economic Order Quantity Formula

The EOQ formula is EOQ = √(2DS / H), where D is annual demand in units, S is ordering cost per order in dollars, and H is holding cost per unit per year in dollars. It returns the order quantity that minimizes total annual inventory cost.
EOQ = √( 2 × D × S ÷ H )
D = annual demand (units/yr) S = ordering cost ($/order) H = holding cost ($/unit/yr)

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
Unit consistency rule: D, EOQ, and any derived quantity (orders per year, cycle stock) must all use the same counting unit. If D is in cases, H must be holding cost per case per year — not per individual item inside the case.

EOQ Formula Derivation

The formula is derived by minimizing the total annual cost function with respect to Q.

Step 1 — Write total annual cost:
TC(Q) = (D / Q) × S + (Q / 2) × H
The first term is annual ordering cost (number of orders × cost per order). The second is annual holding cost (average inventory × holding rate).
Step 2 — Differentiate with respect to Q and set to zero:
dTC/dQ = −DS/Q² + H/2 = 0
Step 3 — Solve for Q:
DS/Q² = H/2  →  Q² = 2DS/H  →  Q* = √(2DS/H)
Step 4 — Confirm minimum (second derivative > 0):
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.

1
Multiply 2 × D × S
2 × 12,000 × 50 = 1,200,000
2
Divide by H
1,200,000 ÷ 3 = 400,000
3
Take the square root
√400,000 = 632 units
4
Calculate orders per year and cycle length
12,000 ÷ 632 ≈ 19 orders/yr  |  365 ÷ 19 ≈ 19 days per cycle
5
Verify: ordering cost must equal holding cost at EOQ
Ordering: (12,000 ÷ 632) × $50 = $950  |  Holding: (632 ÷ 2) × $3 = $948 ✓
EOQ = 632 units  ·  19 orders/year  ·  Total annual cost ≈ $1,897
Cost penalty for deviation from EOQ: Ordering 50% more than EOQ (948 units) raises total annual cost by 8.3% to $2,054. Ordering 50% less (316 units) raises it by 16.7% to $2,213. The penalty for under-ordering is twice as steep as for over-ordering by the same percentage, so when in doubt, round up.
Skip the arithmetic

Enter D, S, and H — the calculator returns EOQ, orders per year, and the full cost curve instantly.

Open EOQ Calculator →

EOQ Formula Assumptions

Constant annual demand

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.

Fixed cost per order

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.

Fixed holding cost per unit per year

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.

Instantaneous replenishment

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.

No quantity discounts or stockout costs

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.

Standard EOQ
EOQ = √(2DS / H)
Use when: demand is constant, price is fixed, replenishment is instantaneous, no stockouts planned.
EOQ with Backorders
EOQ_b = √(2DS/H) × √((H+B)/B)
Use when: planned stockouts are acceptable and a backorder cost B ($/unit/yr) can be estimated. EOQ_b is always larger than standard EOQ.
Production Order Quantity (POQ)
POQ = √(2DS / (H × (1 − d/p)))
Use when: inventory is replenished gradually as it is produced (d = daily demand, p = daily production rate). POQ is always larger than EOQ.
EOQ with Quantity Discounts
Compare TC at EOQ vs. each discount break point
Use when: the supplier offers price breaks above a minimum order size. Calculate EOQ at the standard price, then compare total annual cost (ordering + holding + purchase) at each price tier.

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.