ForHosting KIT · Finance & money

EOQ calculator

With 1000 units of yearly demand, 10 per order and 0.5 to hold one unit for a year, the economic order quantity is 200 units: five orders a year and 50 in each cost. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Annual demand
1,000
Ordering cost
10
Holding cost
0.5
You get
Eoq
200
Orders per year
5
Annual ordering cost
50
Annual holding cost
50

The economic order quantity, or EOQ, is the lot size that minimizes the sum of ordering cost and inventory holding cost for a stable annual demand. Purchasing and operations teams still use the Harris–Wilson square-root identity because it needs only three numbers you already have: annual demand in units, the cost of placing one order, and the cost of holding one unit for a year. This EOQ calculator accepts those three finite figures and returns the optimal order size, plus the implied number of orders per year and the two cost legs that meet at the minimum.

What economic order quantity is and how the square root appears

The economic order quantity is the order size Q that minimizes the sum of two opposing inventory costs when demand is steady and replenishment is instantaneous. Annual ordering cost falls as Q grows, because you place fewer replenishment orders over the year. Annual holding cost rises as Q grows, because average on-hand stock under the classic sawtooth is Q divided by two.

The Harris–Wilson formula finds the unique positive Q where those two cost legs are equal: EOQ equals the square root of two times annual demand times ordering cost per order, divided by holding cost per unit per year. Annual demand is the number of units you expect to use or sell over a year. Ordering cost is the fixed cost of placing one purchase or production order — paperwork, receiving, or machine setup — not the purchase price of the goods themselves.

Holding cost is the cost of carrying one unit for one year, covering capital, warehousing, insurance, and obsolescence, and it must be strictly positive. The capability returns that square-root quantity as eoq and, when the quantity is positive, the implied orders per year as annual demand divided by eoq together with the two annual cost legs that meet at the minimum. It does not apply quantity discounts, finite replenishment (the production-quantity model), or safety stock; those are different models with extra parameters.

Where an EOQ calculator earns its keep

Buyers and inventory planners use an economic order quantity calculator when a SKU has reasonably stable annual demand and they want a lot size that does not over-order into the warehouse or under-order into a storm of setup tickets. Production supervisors use the same three numbers as a setup-cost versus holding-cost check before they change a run length.

Operations-research and supply-chain classrooms need a deterministic oracle for the Wilson formula so homework, LMS plugins, and exam generators mark the same square root a student would compute by hand, including the hard failure when holding cost is not positive. Failed validation does not consume balance.

Purchasing lot size for a stable SKU

Turn annual demand, ordering cost per order, and holding cost per unit per year into the cycle lot size a buyer can put next to current pack quantities.

Classroom and exam checks of the Wilson formula

Mark EOQ homework and generated exam items with a deterministic square-root oracle that rejects a non-positive holding cost instead of inventing infinity.

Replenishment and run-length reviews

Drop the same three policy numbers into a production or inventory review so setup cost and holding cost meet at a documented lot size.

What happens if holding cost is zero or negative?

Holding cost per unit per year must be a finite number greater than zero; a zero or negative carrying charge makes the EOQ square-root identity undefined and is not billed.

Should I round EOQ to a whole number of units?

If your SKU cannot be split, round that figure to a feasible pack size in your own policy; the model itself does not impose integer lots.

Does EOQ include safety stock or quantity discounts?

No. This calculator is the basic EOQ model with instantaneous replenishment and no discounts. Safety stock, reorder point, finite production rates (EPQ), and price-break tables are separate models with extra inputs.

What is the EOQ formula?

Take the square root of two times annual demand times the cost per order, divided by the yearly holding cost per unit. With 1000 units, 10 per order and 0.5 to hold a unit, the answer is 200 units.

What goes into ordering cost and holding cost?

Ordering cost is the fixed cost of placing one order: paperwork, receiving or machine setup, not the price of the goods. Holding cost is what keeping one unit for a year costs: capital, warehousing, insurance and obsolescence.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/fin/eoq

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/fin/eoq \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"annual_demand":1000,"ordering_cost":10,"holding_cost":0.5}'
{
  "annual_demand": 1000,
  "ordering_cost": 10,
  "holding_cost": 0.5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "fin.eoq",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Holding cost must be strictly positive; a zero or negative carrying charge would divide by zero and is rejected as invalid_input rather than a hollow quantity of infinity.

What economic order quantity is and how the square root appears

When holding cost is zero the square-root identity is undefined: there would be no penalty for infinite stock, so the model does not apply and this endpoint refuses the request.

Input contract, response shape, and error behaviour

On success the body echoes the three inputs, then reports eoq. Example: one thousand units of annual demand, ten of ordering cost per order, and one half of holding cost per unit per year yields an economic order quantity of two hundred units, five orders per year, and fifty of each cost leg. POST a JSON body with three required finite numbers. annual_demand is units per year; aliases demand and yearly_demand map to the same field. ordering_cost is the fixed cost of placing one order; aliases order_cost and setup_cost are accepted so a purchasing ledger can keep its column names. holding_cost is the carrying charge per unit per year; aliases carrying_cost and holding_cost_per_unit are accepted. Each numeric field may arrive as a JSON number or a numeric string. Missing fields, empty strings, and non-finite values fail with invalid_input naming the field. If annual_demand or ordering_cost is negative the request fails. Those failures are not billed. When eoq is positive the body also includes orders_per_year, annual_ordering_cost, annual_holding_cost, and total_relevant_cost; those optional legs are omitted, never null, when eoq is zero. Pair the JSON with your own lead-time buffer if you need a reorder point; this endpoint returns the cycle lot size only, not a safety-stock schedule.

Where an EOQ calculator earns its keep

Keep holding_cost strictly positive, keep annual_demand and ordering_cost non-negative, pin the rounded lot size in tests, and you get a reproducible economic order quantity for purchasing checklists, classrooms, and edge workers without standing up an MRP engine of your own.

How is economic order quantity calculated?

EOQ = sqrt(2 × annual_demand × ordering_cost / holding_cost). When that lot size is positive the API also returns orders per year (annual_demand / EOQ) and the two annual cost legs that are equal at the minimum.

What does the EOQ calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →