All guides

By September 6, 20268 min read

Economic Order Quantity (EOQ): Formula and Worked Example

The EOQ formula worked step by step, plus the assumptions behind it and an honest test of whether your own store meets enough of them to trust the answer.

Order little and often and you pay for the ordering: the time raising each purchase order, chasing it, receiving and counting it. Order rarely and deep and you pay to hold it: capital sitting in stock, shelf space, the risk it does not sell. Economic order quantity is the single order size at which those two costs stop trading against each other, and it is one square root away from figures you can assemble in an afternoon.

The site's reorder quantity guide names EOQ and then declines to use it, on the grounds that a small merchant rarely knows the two cost inputs with any precision. That reasoning stands and this post does not re-argue it. What follows is the formula itself, worked end to end, with the assumptions it rests on stated plainly enough that you can decide whether your own store meets them.

What EOQ answers

EOQ answers one narrow question: across a year, what fixed order size makes the total of ordering cost plus holding cost as small as it can be?

Notice what is not in that question. EOQ says nothing about when to order, which is the reorder point's job. It says nothing about how much buffer to carry, which is safety stock. It does not know your supplier has a minimum. It is a cost-minimising order size for a product whose demand is a flat line, and everything difficult about applying it comes from that last clause.

The formula

Q* = √(2DS ÷ H)

Where D is annual demand in units, S is the fixed cost of placing one order, and H is the cost of holding one unit for one year. Hillier and Lieberman's Introduction to Operations Research, chapter 19, derives the same result as Q* = √(2aK ÷ h), with a for the constant demand rate, K for the setup cost incurred per order and h for the holding cost per unit per unit time (chapter text). If you check this against another source and find different letters, that is all you have found.

The shape of the result is worth reading before the arithmetic. Demand and ordering cost are inside the square root on top, so quadrupling either only doubles the order size. Holding cost is underneath, so expensive-to-hold products get ordered in smaller, more frequent lots. Those two behaviours are the whole intuition of the model.

Finding your inputs

Three inputs. They vary enormously in how confidently you can pin them down, and honest error bars on each are more useful than a precise-looking answer.

  • D, annual demand in units. The reliable one. Take units sold over the last twelve months from your Shopify sales history, or annualise a shorter run if the product is newer. Use units, not revenue.
  • S, fixed cost per order. Your own estimate of what one purchase order costs to place regardless of its size: the time to raise and send it, chasing the supplier, receiving and counting the delivery, plus any per-shipment freight or customs handling that does not scale with quantity. Most small merchants have never measured this. An hourly rate times an honest count of the minutes gets you close enough.
  • H, holding cost per unit per year. The hard one, and the one to resist borrowing. Add up your own capital, storage, service and risk costs and divide by the units you hold. Inventory carrying cost works through the components. Do not take a percentage off a blog, including this one: there is no defensible published rate for a small Shopify merchant.

If S and H are estimates, so is Q*, and the sensitivity check in the next section is what tells you whether that matters.

Worked example

Illustrative figures throughout, chosen so the arithmetic is checkable rather than measured from any real store. "Cedar & Fig, 250g" sells 5 units a day at $7 cost and $18 retail, on a 12-day supplier lead time. Say this merchant has measured their own ordering cost at $35 per purchase order and their own holding cost at $1.75 per unit per year. That holding cost is this example's own measured figure, not the one worked through in the carrying cost guide, which builds a different store's rate from its own components. Use your own, because the order quantity moves a long way on it: at $3.72 a unit the same formula returns 185 rather than 270.

1,825

D: units a year, 5 per day

$35

S: cost of placing one order

$1.75

H: cost to hold one unit a year

270

Q*: economic order quantity

Substituting: 2 × 1,825 × 35 = 127,750. Divide by 1.75 and you get 73,000. The square root of 73,000 is 270.2, so Q* is 270 units.

At 5 units a day that is 54 days of cover per order, or roughly 6.8 orders a year. The annual cost at that quantity splits almost exactly in half: ordering is 1,825 ÷ 270 × $35, which is $237, and holding is 270 ÷ 2 × $1.75, which is $236. That equality is not a coincidence. It is what the formula solves for.

The sensitivity check, which matters more than the answer.

Order quantityOrdering cost/yrHolding cost/yrTotal
200 units$319$175$494
270 units (Q*)$237$236$473
350 units$183$306$489
500 units$128$438$565

Ordering 200 instead of 270 costs 4.5% more a year. Ordering 350 costs 3.4% more. The bottom of the total-cost curve is nearly flat, which means the precision of your S and H estimates matters far less than people assume: being roughly near EOQ captures almost all of the available saving. Order 500 because the supplier insists, though, and the total climbs about 20%, which is a number worth taking into a negotiation.

Ordering cost, holding cost and total cost against order quantityThree curves plotted against order quantity on the horizontal axis and annual cost on the vertical axis, using this post's worked figures. Ordering cost falls steeply as the order size grows, because fewer orders are placed each year. Holding cost rises as a straight line, because a bigger order means more average stock on the shelf. Total cost is the sum of the two and forms a shallow valley whose lowest point sits at two hundred seventy units, where the two component costs are equal at roughly two hundred thirty-six dollars each. The important feature is how flat the base of the valley is: anywhere between two hundred and three hundred fifty units, total annual cost stays within five percent of the minimum, so a rough estimate of the inputs still lands you in the useful region.The bottom of the curve is nearly flatCedar & Fig, 250g: D 1,825 units, S $35, H $1.75Q* 270 units200 to 350: within 5% of the minimum270smaller orderslarger orderscosttotalholdingordering
Being near EOQ is worth almost as much as being on it. That is the argument for using it as a sanity check rather than as an instruction.

The assumptions

The basic EOQ model rests on three assumptions, stated directly by the textbook it comes from: a known constant demand rate; an order that arrives all at once exactly when the inventory level reaches zero, which implicitly requires a constant lead time; and no planned shortages. A fourth condition sits alongside them: unit cost does not change with order size, since the basic model has no quantity discounts.

The same chapter is blunt about how those hold up. Its assumptions are "rather demanding ones. They seldom are satisfied completely in practice", and it singles out lead time specifically: "although the schedule may call for a constant lead time, variations in the actual lead times often will occur."

It also gives the other half, which gets dropped from most write-ups. EOQ models "have been found to be robust in the sense that they generally still provide nearly optimal results even when their assumptions are only rough approximations of reality. However, in those cases where the assumptions are significantly violated, it is important to do some preliminary analysis to evaluate the adequacy of an EOQ model before it is used."

EOQ is not wrong. It is conditional, and the conditions are checkable before you rely on it.

Read those two quotes together and you get a usable rule. Rough inputs are fine, which the flat curve above already showed. Badly broken assumptions are not, and you are expected to notice before you order.

When EOQ is the wrong tool

Four situations break it hard enough to justify that preliminary analysis:

Seasonal or promotion-driven demand. The constant-demand assumption is the load-bearing one, and a store whose fourth quarter is several times its second quarter does not have a constant demand rate in any useful sense. Neither does a SKU whose sales are mostly created by the discounts you schedule.

Minimum order quantities and case packs. EOQ produces a number and the supplier hands you a constraint. When the minimum exceeds Q*, the minimum wins and EOQ becomes a way of pricing the gap rather than a way of choosing the quantity.

Perishability and shelf life. The model has no concept of stock expiring. If 54 days of cover outlives the product, the cost curve is missing its largest term.

Quantity discounts. The basic model assumes unit cost is flat regardless of order size. When your supplier prices in brackets, the basic formula is the wrong variant; the same textbook chapter derives a separate EOQ-with-quantity-discounts model for that case.

Thin or intermittent demand deserves a mention too. If a SKU sells in occasional clusters rather than at a rate, the annual demand figure you feed in is an average of something that never happens.

What to use instead

For most small Shopify catalogues the practical order quantity comes from a target stock level rather than a cost optimisation: work out how much cover you need to reach your next planned order, subtract what you have on hand and on order, and order the difference. That method is worked through in the reorder quantity guide, and it uses inputs you already track instead of two cost figures you would be estimating.

The rest of the decision splits cleanly. When to order is the reorder point. How much buffer to sit on top of it is safety stock. If you would rather express the whole policy as two numbers per SKU, min/max planning is the same mechanism under older names.

Where EOQ still earns its place is as a check. Calculate it once a year on your largest SKUs. If your habitual order size is inside the flat part of the curve, stop thinking about it. If it is three times Q*, you have found a real cost worth arguing with a supplier about.

The one input you should never have to estimate is D. StockCue reads up to 24 months of your order history and forecasts demand with seasonality on every plan including Free, which gives you the demand side of this calculation without an export. The two cost figures are yours to measure; no app can read them out of your store.

Frequently Asked Questions

What is the EOQ formula?

The economic order quantity is Q* = the square root of (2 × D × S ÷ H), where D is annual demand in units, S is the fixed cost of placing one order, and H is the cost of holding one unit for one year. The operations-research textbook that derives it writes the same equation as the square root of 2aK ÷ h, with a for the demand rate, K for the setup cost per order and h for the holding cost per unit per unit time. Same formula, different letters.

What inputs do I need to calculate EOQ?

Three, and only one of them is easy. Annual demand in units comes straight from your sales history. The fixed cost per order is your own estimate of the time and fees involved in raising, chasing and receiving one purchase order, independent of its size. The holding cost per unit per year is the hardest, because it means adding up your own capital, storage, service and risk costs rather than borrowing a percentage from a blog.

Is EOQ still useful for a small Shopify store?

It is useful as a sanity check on order size rather than as the number you order. Its own source textbook says the model is robust enough to give nearly optimal results when the assumptions are only rough approximations, but that where they are significantly violated you should analyse before relying on it. Seasonal and promotion-driven demand, which describes most small stores, violates the constant-demand assumption badly enough to warrant that check.

What happens to EOQ when the supplier has a minimum order quantity?

The minimum wins, because it is a constraint and EOQ is only advice. If EOQ says 270 units and the supplier's minimum is 500, you order 500 and carry the extra cover. What EOQ gives you in that situation is the size of the penalty: you can price the difference in annual holding and ordering cost and use it as a concrete argument for negotiating the minimum down or sourcing elsewhere.

STOCKCUE

EOQ needs an annual demand figure that stays current. StockCue forecasts demand from up to 24 months of your own order history, with seasonality included on every plan including Free, so D is not a spreadsheet you rebuild each quarter.

Install StockCue on Shopify →
Shovon, Software Engineer at Devmerx

Shovon

Software Engineer

Shovon writes about Shopify inventory operations for Devmerx, the studio behind StockCue: Inventory Forecast.

Need help with your Shopify store?

Devmerx builds and optimises Shopify stores for DTC brands. Book a free 20-minute consultation.