The Economic Order Quantity, or EOQ, is the order size that minimizes the annual relevant cost of holding one inventory item, and that minimum cost equals annual ordering cost plus annual holding cost. The classic closed-form result is Q* = √(2DS/H), where D is annual demand in units, S is the fixed cost per order in currency, and H is the annual holding cost per unit in currency. Total relevant cost uses the companion expression TC(Q) = DS/Q + HQ/2, and at the continuous optimum those two terms are equal, so the EOQ simultaneously minimizes cost and balances the spending on ordering against the spending on carrying stock. The model assumes unit purchase price does not change with order size, which is why purchase cost is left out of this comparison and "total cost of inventory" in EOQ means the decision-relevant variable cost, not the all-in spend on goods.

You can get both numbers in one pass with the EOQ Calculator, which evaluates this exact formula in your browser and reports the continuous optimum, orders per year, average days between orders, annual ordering cost, annual holding cost, and their combined relevant cost from three inputs.

calculate eoq and total cost of inventory
calculate eoq and total cost of inventory

The EOQ Formula and What "Total Cost" Means Here

When people search for how to calculate EOQ and total cost of inventory, they really want two numbers: the order size that balances their cost structure, and the inventory-relevant spend that size implies. The basic EOQ model gives both from three inputs, and the second number follows directly from the first.

The cost equation the formula minimizes is TC(Q) = (D × S) / Q + (H × Q) / 2. The first term, DS/Q, is annual ordering cost. It shrinks as Q grows because larger orders mean fewer ordering events. The second term, HQ/2, is annual holding cost, sometimes called carrying cost. It grows with Q because the average inventory on hand between replenishments is roughly Q/2. Setting the derivative to zero gives the square-root optimum Q* = √(2DS/H). Because the model assumes unit purchase price is independent of Q, the purchase cost itself is not part of this comparison; it is a fixed cost per unit times annual demand and is the same for any order quantity. That is why "total cost of inventory" inside EOQ means the variable, decision-relevant cost and not the full spend on stock.

Inputs the Calculator Needs and How to Match Units

The calculator has only three fields, but the unit discipline matters a lot because the formula multiplies and divides them directly. A mismatch between annual and per-order or per-unit bases is the most common source of nonsense results, and it is easy to miss because the calculator still returns a number.

InputSymbolRequired basisCommon mistake to avoid
Annual demandDUnits per yearEntering daily, weekly, or monthly demand as if it were annual
Fixed cost per orderSCurrency per orderMixing per-order freight with annual contracting fees
Annual holding cost per unitHCurrency per unit per yearEntering H as a percentage of unit price without converting

If your carrying cost is quoted as a percentage i of unit price C, convert it to H = i × C per unit per year before entry. The calculator does not infer currencies and does not perform that percentage conversion for you, so it will happily accept "20%" as if it were 20 currency per unit per year and produce a wildly wrong cost. All three numbers must speak the same annual currency, or the cost output will be off by a constant factor that is hard to spot.

How to Calculate EOQ and Total Cost of Inventory

This walks through the same three inputs the EOQ Calculator takes. Pick one planning year and one currency so the numbers stay consistent.

  1. Estimate annual demand D in units for the next planning year, using the forecast, sales history, or a stable run rate if the item is steady and well-understood.
  2. Estimate S, the fixed cost of placing and receiving one order, in the same currency. Include order processing, transport on the procurement side, and receiving inspection that scales per order rather than per unit.
  3. Estimate H, the annual cost of holding one unit for a year, in the same currency per unit. Include warehousing, insurance, shrinkage, obsolescence, and the opportunity cost of capital tied up in stock.
  4. Read off the EOQ, orders per year, average days between orders, annual ordering cost, annual holding cost, and combined relevant cost reported by the calculator.
  5. Compare the displayed EOQ to any feasible pack sizes — whole units, cases, pallets, or supplier multiples — by plugging the rounded quantity into TC(Q) = DS/Q + HQ/2 and checking the cost penalty.
  6. Copy the metrics you want to keep; the calculation runs locally and the inputs do not leave the browser.

Behind the scenes, the implementation is: Q* = √(2DS/H), orders per year = D/Q, cycle days = 365 × Q/D, annual ordering cost = DS/Q, annual holding cost = HQ/2, and total relevant cost is their sum.

Reading the Results: Order Frequency and Cost Components

The calculator exposes six values precisely so you can sanity-check the model rather than trust a single number. Two of them deserve a closer look because they tell you whether the result makes operational sense.

Orders per year = D/Q tells you how often you should be replenishing. With the canonical textbook example D = 1200 units, S = 5, H = 1.2, documented at SUNY New Paltz Operations Management, Q* = √(2 × 1200 × 5 / 1.2) = √10000 = 100 units. That gives 1200/100 = 12 orders per year, or one every 365 × 100 / 1200 ≈ 30.4 days. The cycle-length output tells you immediately whether the implied cadence matches how the supplier actually delivers, and it flags bad inputs by producing unrealistic frequencies.

The cost balance is the second sanity check. Annual ordering cost is DS/Q = 1200 × 5 / 100 = 60, and annual holding cost is HQ/2 = 1.2 × 100 / 2 = 60. Their sum, the total relevant cost of inventory under this policy, is 60 + 60 = 120. Notice that the two components are equal at the optimum, which is the cost-balance invariant of the basic model rather than a coincidence: DS/Q = HQ/2 is mathematically the same condition as Q* = √(2DS/H).

When the Basic EOQ Model Fits and Where It Breaks

The formula is fast and transparent precisely because it assumes a clean world. If your situation matches those assumptions, the result is a strong baseline. If it does not, the EOQ still gives a defensible starting point, but the final decision usually needs a different or extended model.

SituationBasic EOQ fits?What to use instead or alongside
Constant known demand, constant unit price, no stockoutsYesBasic EOQ is the right baseline
Quantity discounts or volume price breaksNoCompute TC at each price break including purchase cost and pick the lowest
Seasonal demand or production-rate replenishmentNoProduction lot-size or Wagner–Whitin models
Uncertain lead time or service-level targetsNoAdd a reorder-point model with safety stock to decide when, not how much
Perishability, obsolescence, or planned stockoutsPartiallyShortage-cost EOQ or perishable inventory models

Lead time is a common point of confusion: it is not an EOQ input, because EOQ answers how much to order, not when to reorder. Timing belongs to a reorder-point rule built from expected demand during lead time plus any safety stock justified by service-level targets. The basic model also assumes instantaneous complete replenishment, no safety stock, no capacity or cash constraint, and no quantity discounts, and violating these assumptions can change the best quantity materially.

Sensitivity: When to Recalculate EOQ

D, S, and H are estimates rather than constants of nature, and the cost curve near the optimum is often flatter than intuition suggests. That means a moderately wrong input can move the recommended quantity without dramatically changing the cost, and a small re-estimation can shift the policy without harm. Use the EOQ Calculator for sensitivity exploration by adjusting one or two inputs at a time and watching how the cost components rebalance against each other.

Recalculate when any of the following change: demand forecast, supplier administration fees, warehouse or insurance rates, shrinkage assumptions, capital cost, or supplier pack constraints. Comparing two or three realistic scenarios is more informative than preserving one precise EOQ from stale inputs. Do not treat the output as an automatic purchasing commitment without validating it against the realities your operations team already manages: shelf life, lead-time risk, service levels, cash, and feasible pack sizes. For readers tracking inventory levels more broadly, a separate walk-through of how to calculate average inventory step by step pairs naturally with EOQ, because average inventory at EOQ is exactly Q/2 and is the building block for turnover, days-on-hand, and carrying-cost ratios further up the reporting chain.

If you're weighing options, How Do You Calculate EV Charging Costs at Home covers this in detail.