Economic production quantity (EPQ): formula, example and limits

The economic production quantity (EPQ) is the batch size that keeps the yearly cost of setups plus the cost of holding stock as low as possible when you make the item yourself. It is the economic order quantity adapted for production: the batch does not arrive all at once. Stock builds up while the run is going, and customers take some of it out at the same time.

The EPQ formula:

EPQ = √(2DS ÷ (H × (1 − d/p)))

  • D: annual demand, in units a year
  • S: setup cost per run, in dollars
  • H: holding cost per unit per year, in dollars
  • d: demand rate, for example units a day
  • p: production rate while the run is going, in the same unit as d

d and p must use the same time unit. The ratio d/p is the share of each run that customers use up while you are still making it. The formula only works when p is greater than d. To run the numbers for your own products, use the EPQ calculator.

EPQ vs EOQ

The economic order quantity assumes the whole batch arrives at once, so stock jumps to Q and falls to zero: the most you hold is Q and the average is Q/2. In production, stock rises at p − d while the run is going, so it never reaches Q:

Maximum inventory = Q × (1 − d/p)

Average inventory = Q × (1 − d/p) ÷ 2

Less stock per batch means holding cost grows more slowly as the batch gets bigger, so the EPQ is always larger than the EOQ for the same inputs. If you buy the item instead of making it, use the EOQ calculator, and see EOQ vs MOQ for what to do when a supplier’s minimum gets in the way.

The other formulas you need

  • Runs per year = D ÷ Q
  • Run length = Q ÷ p
  • Time between runs = Q ÷ d
  • Annual setup cost = (D ÷ Q) × S
  • Annual holding cost = Q × (1 − d/p) ÷ 2 × H

At the EPQ the two annual costs are equal, which is a quick check on your arithmetic.

Worked example

Example inputs, not real data. A food plant makes a sauce on one filling line. Annual demand is 24,000 cases over 240 working days, so d = 100 cases a day. The line fills 400 cases a day while it runs (p). A changeover costs $450 (S). A case costs $15 and the plant uses a 20% yearly holding rate, so H = $3.00 a case a year.

  1. d/p = 100 ÷ 400 = 0.25, so 1 − d/p = 0.75.
  2. EPQ = √(2 × 24,000 × 450 ÷ (3.00 × 0.75)) = √(21,600,000 ÷ 2.25) = √9,600,000 ≈ 3,098 cases.
  3. Runs per year = 24,000 ÷ 3,098 ≈ 7.75, one run about every 31 working days (3,098 ÷ 100).
  4. Run length = 3,098 ÷ 400 ≈ 7.7 days on the line.
  5. Maximum inventory = 3,098 × 0.75 ≈ 2,324 cases.
  6. Annual setup cost = 7.746 × $450 ≈ $3,485.69. Annual holding cost = 2,323.8 ÷ 2 × $3.00 ≈ $3,485.69. Total: $6,971.37 a year.

Compared with the EOQ for the same inputs

EPQEOQ used for a production run
Batch size3,098√(2 × 24,000 × 450 ÷ 3.00) ≈ 2,683
Runs per year7.758.94
Maximum inventory2,3242,012 (2,683 × 0.75)
Annual setup cost$3,485.69$4,024.92
Annual holding cost$3,485.69$3,018.69
Total$6,971.37$7,043.61

Using the EOQ costs $72.24 a year more here. The bigger error is in the cost you think you have. The EOQ formula assumes all 2,683 cases arrive at once and puts holding cost at $4,024.92, a third more than the real $3,018.69.

The Lab’s Production Planning add-on works out the EPQ for each product from its demand, the cost of one changeover across its routing, its holding cost and the rate of its slowest operation, and shows batch sizes on the Production schedule page.

What setup cost should include

S is the cash cost of one changeover plus anything you lose because of it. In the example, the $450 is built like this:

  • Changeover and cleaning labor: 3 hours × 2 people × $38 = $228
  • First-article quality check: 1 hour × $45 = $45
  • Product lost at start-up: 20 cases of material at $7 = $140
  • Cleaning supplies and paperwork: $37

Machine time is the hard part. If the line has spare hours, an hour of changeover costs only the labor in it. If the line is the bottleneck, an hour of changeover is an hour of lost output for the whole plant, and S should include the margin on what you could not make. That one choice can move the EPQ more than any other input.

Because the EPQ grows with the square root of S, halving the setup cost cuts the best batch, and the yearly setup and holding cost, by about 29%. That is the case for setup time reduction: shorter changeovers make smaller batches cheap.

H should cover the cost of capital, storage, insurance, spoilage and obsolescence, as a yearly rate on the unit cost. Use your own rate; the 20% above is only an example.

When EPQ breaks down

Many products share the line

The formula treats each product as if it had the line to itself. Add up what each one needs. The sauce takes 24,000 ÷ 400 = 60 of the 240 line days, plus its changeovers. Five products like it would need 300 days of a 240-day year before a single changeover, and no batch size fixes that: you need more capacity. When the total fits but the separate EPQs collide, one practical fix is a fixed cycle: every product runs once every N weeks, each batch is N weeks of its demand, and you check the result in a finite-capacity schedule, not in the formula.

Minimum or fixed batch sizes

A kettle, an oven load, a die, a bar of stock or a supplier’s minimum can set the batch for you. Round the EPQ to that multiple. If a minimum forces a batch much larger than the EPQ, price the extra stock the way you would the true cost of a supplier MOQ.

Shelf life

With first in, first out, the last case of a run waits longest. Its age when it is used is about Q ÷ d − Q ÷ p: at 3,098 cases, 30.98 − 7.75 ≈ 23.2 days. If the sauce must ship within 20 days of filling, the batch can be no more than 20 ÷ (1/100 − 1/400) ≈ 2,667 cases, so a practical batch is 2,600.

Demand that is not steady

The formula assumes demand is level all year. With seasonal demand, work it out separately for each season, and let the production plan, not the formula, decide when to build ahead.

Rounding to a practical batch size

The total cost curve is flat near the EPQ. A batch 20% larger than the EPQ costs about 1.7% more a year; one 20% smaller costs about 2.5% more. So round to whatever runs well: whole pallets, whole shifts, or a fixed number of weeks of demand.

Batch (cases)Runs a yearTime between runsSetup + holding a yearvs EPQ
2,0001220 working days$7,650.00+9.7%
2,4001024 working days$7,200.00+3.3%
2,6009.2326 working days$7,078.85+1.5%
3,000830 working days$6,975.00+0.05%
3,098 (EPQ)7.7531 working days$6,971.37—
4,000640 working days$7,200.00+3.3%

Rounding to 3,000 cases, a run every 30 working days (six five-day weeks), costs $3.63 a year more than the exact EPQ. If the 20-day shelf life applies, 2,600 cases costs $107.48 a year more, which is the price of the shelf-life limit.

Common mistakes

  • Using the EOQ for items you make. It understates the batch and overstates holding cost.
  • Mixing units: annual demand with an hourly production rate, or d per calendar day and p per working day.
  • Counting machine time in S on a line with spare hours, or leaving it out on the bottleneck.
  • Treating the EPQ as exact. The inputs are estimates and the cost curve is flat, so round.
  • Setting each product’s EPQ without checking that the line has room for all of them.

Want the EPQ for your own products?

Try the free EPQ calculator, or see how the Lab’s Production Planning add-on works out batch sizes from your routings and changeover costs.

Frequently asked questions

What is the difference between EOQ and EPQ?

EOQ assumes the whole order arrives at once. EPQ assumes stock builds up while you produce and customers take it out at the same time, so average stock is lower and the best batch is larger.

What happens when the production rate is close to the demand rate?

1 − d/p gets close to zero and the EPQ gets very large: you would almost run continuously. If d is equal to or larger than p, the line cannot keep up and the formula does not apply.

Does EPQ work in a job shop?

Only for repeat parts with steady demand and a known setup cost. For one-off jobs the batch is the customer’s order quantity, and the real question is sequencing, not batch size.

How often should I recalculate the EPQ?

Whenever demand, setup time or the holding rate changes noticeably, and after any setup reduction work. Review it at least once a year.

Try the Statadventure live tools

Inventory tools for US manufacturers: reorder point, safety stock, EOQ and landed cost, with the inputs and assumptions shown.

Open the live tools

Contact us

Scroll to Top